audit-4.0.2/0000755001034500103450000000000014655201460006367 5audit-4.0.2/AUTHORS0000644001034500103450000000014614655201403007355 This program was started by Rik Faith. It is now being maintained by Steve Grubb audit-4.0.2/audit.spec0000644001034500103450000002431214655201403010270 Summary: User space tools for kernel auditing Name: audit Version: 4.0.2 Release: 1%{dist} License: GPL-2.0-or-later AND LGPL-2.0-or-later Group: System Environment/Daemons URL: http://people.redhat.com/sgrubb/audit/ Source0: http://people.redhat.com/sgrubb/audit/%{name}-%{version}.tar.gz BuildRequires: make gcc BuildRequires: kernel-headers >= 5.0 BuildRequires: systemd Requires: %{name}-libs = %{version}-%{release} Requires: %{name}-rules%{?_isa} = %{version}-%{release} Requires(post): systemd coreutils Requires(preun): systemd Requires(postun): systemd coreutils Recommends: initscripts-service %description The audit package contains the user space utilities for storing and searching the audit records generated by the audit subsystem in the Linux 2.6 and later kernels. %package libs Summary: Dynamic library for libaudit License: LGPL-2.0-or-later BuildRequires: libcap-ng-devel %description libs The audit-libs package contains the dynamic libraries needed for applications to use the audit framework. %package libs-devel Summary: Header files for libaudit License: LGPL-2.0-or-later Requires: %{name}-libs%{?_isa} = %{version}-%{release} Requires: kernel-headers >= 5.0 %description libs-devel The audit-libs-devel package contains the header files needed for developing applications that need to use the audit framework libraries. %package libs-static Summary: Static version of libaudit library License: LGPL-2.0-or-later Requires: kernel-headers >= 5.0 %description libs-static The audit-libs-static package contains the static libraries needed for developing applications that need to use static audit framework libraries %package python3-audit Summary: Python3 bindings for libaudit License: LGPL-2.0-or-later BuildRequires: python3-devel python-unversioned-command swig Requires: %{name}-libs%{?_isa} = %{version}-%{release} %description python3-audit The audit-libs-python3 package contains the bindings so that libaudit and libauparse can be used by python3. %package -n audispd-plugins Summary: Plugins for the audit event dispatcher License: GPL-2.0-or-later BuildRequires: krb5-devel libcap-ng-devel Requires: %{name} = %{version}-%{release} Requires: %{name}-libs%{?_isa} = %{version}-%{release} %description -n audispd-plugins The audispd-plugins package provides plugins for the real-time interface to the audit system, audispd. These plugins can do things like relay events to remote machines or analyze events for suspicious behavior. %package -n audispd-plugins-zos Summary: z/OS plugin for the audit event dispatcher License: GPL-2.0-or-later BuildRequires: openldap-devel Requires: %{name}%{?_isa} = %{version}-%{release} Requires: %{name}-libs%{?_isa} = %{version}-%{release} %description -n audispd-plugins-zos The audispd-plugins-zos package provides a plugin that will forward all incoming audit events, as they happen, to a configured z/OS SMF (Service Management Facility) database, through an IBM Tivoli Directory Server (ITDS) set for Remote Audit service. %package rules Summary: audit rules and utilities License: GPL-2.0-or-later Recommends: %{name} = %{version}-%{release} %description rules The audit rules package contains the rules and utilities to load audit rules. %prep %setup -q %build %configure --with-python3=yes \ --enable-gssapi-krb5=yes --with-arm --with-aarch64 \ --with-libcap-ng=yes --without-golang --enable-zos-remote \ --enable-systemd --enable-experimental --with-io_uring make CFLAGS="%{optflags}" %{?_smp_mflags} %install mkdir -p $RPM_BUILD_ROOT/{sbin,etc/audit/plugins.d,etc/audit/rules.d} mkdir -p $RPM_BUILD_ROOT/%{_mandir}/{man5,man8} mkdir -p $RPM_BUILD_ROOT/%{_libdir}/audit mkdir --mode=0700 -p $RPM_BUILD_ROOT/%{_var}/log/audit mkdir -p $RPM_BUILD_ROOT/%{_var}/spool/audit make DESTDIR=$RPM_BUILD_ROOT install # Remove these items so they don't get picked up. rm -f $RPM_BUILD_ROOT/%{_libdir}/libaudit.a rm -f $RPM_BUILD_ROOT/%{_libdir}/libauparse.a find $RPM_BUILD_ROOT -name '*.la' -delete find $RPM_BUILD_ROOT/%{_libdir}/python3.?/site-packages -name '*.a' -delete # On platforms with 32 & 64 bit libs, we need to coordinate the timestamp touch -r ./audit.spec $RPM_BUILD_ROOT/etc/libaudit.conf touch -r ./audit.spec $RPM_BUILD_ROOT/usr/share/man/man5/libaudit.conf.5.gz %check make %{?_smp_mflags} check # Get rid of make files so that they don't get packaged. rm -f rules/Makefile* %post %systemd_post auditd.service # If an upgrade, restart it if it's running if [ $1 -eq 2 ]; then state=$(systemctl status auditd | awk '/Active:/ { print $2 }') if [ $state = "active" ] ; then auditctl --signal stop || true systemctl start auditd fi # if an install, start it since preset says we should be running elif [ $1 -eq 1 ]; then systemctl start auditd fi %post rules %systemd_post audit-rules.service # Copy default rules into place on new installation files=`ls /etc/audit/rules.d/ 2>/dev/null | wc -w` if [ "$files" -eq 0 ] ; then cp %{_datadir}/%{name}-rules/10-base-config.rules /etc/audit/rules.d/audit.rules # Fix up permissions chmod 0600 /etc/audit/rules.d/audit.rules # Make the new rules active augenrules --load fi %preun %systemd_preun auditd.service # If uninstalling, stop it if [ $1 -eq 0 ]; then auditctl --signal stop || true fi %preun rules %systemd_preun audit-rules.service # If uninstalling, delete the rules loaded in the kernel if [ $1 -eq 0 ]; then auditctl -D > /dev/null 2>&1 fi %files libs %license COPYING.LIB /%{_lib}/libaudit.so.1* /%{_lib}/libauparse.* %config(noreplace) %attr(640,root,root) /etc/libaudit.conf %{_mandir}/man5/libaudit.conf.5.gz %files libs-devel %doc contrib/plugin %{_libdir}/libaudit.so %{_libdir}/libauparse.so %{_includedir}/libaudit.h %{_includedir}/audit_logging.h %{_includedir}/audit-records.h %{_includedir}/auparse.h %{_includedir}/auparse-defs.h %{_datadir}/aclocal/audit.m4 %{_libdir}/pkgconfig/audit.pc %{_libdir}/pkgconfig/auparse.pc %{_mandir}/man3/* %attr(644,root,root) %{_mandir}/man5/ausearch-expression.5.gz %files libs-static %license COPYING.LIB %{_libdir}/libaudit.a %{_libdir}/libauparse.a %files -n python3-audit %defattr(-,root,root,-) %attr(755,root,root) %{python3_sitearch}/* %files %license COPYING %doc README.md ChangeLog rules init.d/auditd.cron %attr(644,root,root) %{_mandir}/man8/auditd.8.gz %attr(644,root,root) %{_mandir}/man8/aureport.8.gz %attr(644,root,root) %{_mandir}/man8/ausearch.8.gz %attr(644,root,root) %{_mandir}/man8/aulast.8.gz %attr(644,root,root) %{_mandir}/man8/aulastlog.8.gz %attr(644,root,root) %{_mandir}/man8/ausyscall.8.gz %attr(644,root,root) %{_mandir}/man5/auditd.conf.5.gz %attr(644,root,root) %{_mandir}/man5/auditd-plugins.5.gz %attr(755,root,root) %{_sbindir}auditd %attr(755,root,root) %{_sbindir}ausearch %attr(755,root,root) %{_sbindir}aureport %attr(755,root,root) %{_bindir}/aulast %attr(755,root,root) %{_bindir}/aulastlog %attr(755,root,root) %{_bindir}/ausyscall %attr(644,root,root) %{_unitdir}/auditd.service %attr(750,root,root) %dir %{_libexecdir}/initscripts/legacy-actions/auditd %attr(750,root,root) %{_libexecdir}/initscripts/legacy-actions/auditd/condrestart %attr(750,root,root) %{_libexecdir}/initscripts/legacy-actions/auditd/reload %attr(750,root,root) %{_libexecdir}/initscripts/legacy-actions/auditd/restart %attr(750,root,root) %{_libexecdir}/initscripts/legacy-actions/auditd/resume %attr(750,root,root) %{_libexecdir}/initscripts/legacy-actions/auditd/rotate %attr(750,root,root) %{_libexecdir}/initscripts/legacy-actions/auditd/state %attr(750,root,root) %{_libexecdir}/initscripts/legacy-actions/auditd/stop %ghost %{_localstatedir}/run/auditd.state %attr(-,root,-) %dir %{_var}/log/audit %attr(750,root,root) %dir /etc/audit/plugins.d %config(noreplace) %attr(640,root,root) /etc/audit/auditd.conf %files rules %attr(755,root,root) %dir %{_datadir}/%{name}-rules %attr(644,root,root) %{_datadir}/%{name}-rules/* %attr(644,root,root) %{_mandir}/man8/auditctl.8.gz %attr(644,root,root) %{_mandir}/man8/augenrules.8.gz %attr(644,root,root) %{_mandir}/man7/audit.rules.7.gz %attr(755,root,root) %{_sbindir}/auditctl %attr(755,root,root) %{_sbindir}/augenrules %attr(644,root,root) %{_unitdir}/audit-rules.service %attr(750,root,root) %dir /etc/audit %attr(750,root,root) %dir /etc/audit/rules.d %ghost %config(noreplace) %attr(640,root,root) /etc/audit/rules.d/audit.rules %ghost %config(noreplace) %attr(640,root,root) /etc/audit/audit.rules %config(noreplace) %attr(640,root,root) /etc/audit/audit-stop.rules %files -n audispd-plugins %config(noreplace) %attr(640,root,root) /etc/audit/audisp-remote.conf %config(noreplace) %attr(640,root,root) /etc/audit/plugins.d/au-remote.conf %config(noreplace) %attr(640,root,root) /etc/audit/plugins.d/syslog.conf %config(noreplace) %attr(640,root,root) /etc/audit/audisp-statsd.conf %config(noreplace) %attr(640,root,root) /etc/audit/plugins.d/au-statsd.conf %config(noreplace) %attr(640,root,root) /etc/audit/plugins.d/af_unix.conf %config(noreplace) %attr(640,root,root) /etc/audit/ids.conf %config(noreplace) %attr(640,root,root) /etc/audit/plugins.d/audisp-ids.conf %config(noreplace) %attr(640,root,root) /etc/audit/audisp-filter.conf %config(noreplace) %attr(640,root,root) /etc/audit/plugins.d/filter.conf %attr(644,root,root) %{_datadir}/%{name}-rules/ids-rules/* %attr(750,root,root) %{_sbindir}/audisp-remote %attr(750,root,root) %{_sbindir}/audisp-syslog %attr(750,root,root) %{_sbindir}/audisp-af_unix %attr(750,root,root) %{_sbindir}/audisp-ids %attr(750,root,root) %{_sbindir}/audisp-statsd %attr(750,root,root) %{_sbindir}/audisp-filter %attr(700,root,root) %dir %{_var}/spool/audit %attr(644,root,root) %{_mandir}/man5/audisp-remote.conf.5.gz %attr(644,root,root) %{_mandir}/man8/audisp-remote.8.gz %attr(644,root,root) %{_mandir}/man8/audisp-syslog.8.gz %attr(644,root,root) %{_mandir}/man8/audisp-af_unix.8.gz %attr(644,root,root) %{_mandir}/man8/audisp-statsd.8.gz %attr(644,root,root) %{_mandir}/man8/audisp-filter.8.gz %files -n audispd-plugins-zos %attr(644,root,root) %{_mandir}/man8/audispd-zos-remote.8.gz %attr(644,root,root) %{_mandir}/man5/zos-remote.conf.5.gz %config(noreplace) %attr(640,root,root) /etc/audit/plugins.d/audispd-zos-remote.conf %config(noreplace) %attr(640,root,root) /etc/audit/zos-remote.conf %attr(750,root,root) %{_sbindir}/audispd-zos-remote %changelog * Mon Mar 11 2024 Steve Grubb 4.0.2-1 - New upstream release audit-4.0.2/README.md0000644001034500103450000003576314655201403007601 Linux Audit =========== The Linux Audit System is designed to make Linux compliant with the requirements from Common Criteria, PCI-DSS, and other security standards by intercepting system calls and serializing audit log entries from privileged user space applications. The framework allows the configured events to be recorded to disk and distributed to plugins in realtime. Each audit event contains the date and time of event, type of event, subject identity, object acted upon, and result (success/fail) of the action if applicable. RUNTIME DEPENDENCIES -------------------- * coreutils * initscripts-service (Recommended - soft requirement) * kernel >= 5.0 * systemd NOTE: While this repository provides support for systemd to start the audit daemon, other init systems can be used as well. For example, [Alpine Linux](https://git.alpinelinux.org/aports/tree/main/audit/auditd.initd) provides an init script for OpenRC. BUILD-TIME DEPENDENCIES (for tar file) -------------------------------------- * gcc (or clang) * make * kernel-headers >= 5.0 * systemd ADDITIONAL BUILD-TIME DEPENDENCIES (if using github sources) ------------------------------------------------------------ * autoconf * automake * libtool OPTIONAL DEPENDENCIES --------------------- * libcap-ng-devel (dropping capabilities) * krb5-devel (remote logging) * python3-devel (python bindings) * swig (python bindings) * openldap-devel (zos-remote logging) * golang (golang bindings) SUPPORTED ARCHITECTURES ----------------------- * AARCH64 * ARM (some versions) * PPC & PPCLE * s390 & s390x * x86_64 & i386 NOTE: **There is a moratorium on adding support for any new platforms.** Syscalls and other lookup tables get updated frequently. Without an active community maintaining the code, it is not sustainable to add more. If you would like to see more platforms supported, please consider working on bugs and code cleanups and then maybe we can add more. Any submitted pull requests adding a new platform with be marked with a 'wont_fix' label. It will be left available in case anyone wants to use it. But it is unsupported. MAIL LIST --------- The audit community has a [mail list](https://lists.linux-audit.osci.io/archives/list/linux-audit@lists.linux-audit.osci.io/). It is the best place to ask questions because the mail archive is searchable and therefore discoverable. CONFIGURING AND COMPILING ------------------------- To build from the repo after cloning and installing dependencies: ``` cd audit ./autogen.sh ./configure --with-python3=yes --enable-gssapi-krb5=yes --with-arm \ --with-aarch64 --with-libcap-ng=yes --without-golang --with-io_uring make make install ``` If you are packaging this, you probably want to do "make dist" instead and use the resulting tar file with your package building framework. A spec file is included in the git repo as an example of packaging it using rpm. This spec file is not known to be the official spec file used by any distribution. It's just an example. CROSS COMPILING --------------- Cross compiling is not officially supported. There have been people that have submitted patches to make it work. But it is not documented how to make it work. It is likely that you have to somehow override CC, CXX, RANLIB, AR, LD, and NM when running configure to pickup the cross compiler, linker, archive, etc. If you have patches that fix any problems, they will be merged. If you have suggestions for how to improve cross compiling documentation, file an issue stating how to improve instructions. OVERVIEW -------- The following image illustrates the architecture and relationship of the components in this project: ![audit-components](https://github.com/linux-audit/audit-userspace/blob/assets/audit-components.png) In the above diagram, auditd is in the middle. It interfaces with the kernel to receive events. It writes them to the audit logs. It also distributes events in realtime to audisp plugins. To load rules on 3.x audit system, you use the augenrules program. As of audit-4.0, you would use the audit-rules.service with systemctl. They in turn uses auditctl to load rules into the kernel. Auditctl is used to create, load, and delete rules; configure the kernel's backlog and other parameters; and to gather status about the audit system. The kernel does the heavy lifting to generates the events. In the case of a trusted application such as shadow-utils, the kernel receives the event, adds origin information, timestamps, and queues the event for delivery to the audit daemon. DAEMON CONSIDERATIONS --------------------- Almost all Security Standards are concerned about what happens when logging space fills up. Because of this, the audit daemon keeps careful track of free space and emits warnings at admin defined levels called "space left" and "admin space left". The former is considered a low disk space warning which should give the admin time to do something. The latter is more serious because you are just about out. To get an accurate reading, the audit daemon should log to a disk partition that is reserved only for the audit daemon. This way someone using the logger command can't suddenly fill up the audit space and trigger an admin defined action. It is recommended to set aside a partition, /var/log/audit, for exclusive use by the audit daemon. The size of which depends on your audit retention policy. The audit daemon is started by systemd. Some people run the "systemd-analyze security" command. It tells you all sorts of things to do to protect your system from auditd. However, doing the things it suggests places auditd in namespaces. When that happens, the audit rules may not trigger correctly and auditd may not be able to access trusted databases. The auditd.service file is the result of trial and error based on well intentioned patches gone wrong. You can lock auditd down more, but it likely will not work as intended. RULES ----- The audit package comes with pre-written rules. For audit-3.x, they should be located in /usr/share/audit/sample-rules. For audit-4.x, they should be located in /usr/share/audit-rules. These rules should be close enough most of the time. To use them, copy select rules to /etc/auditd/rules.d. If you look at the rules, you will notice that the filenames begin with a number. This number has the following suggested meaning: ``` 10 - Kernel and auditctl configuration 20 - Rules that could match general rules - but we want a different match (override) 30 - Main rules 40 - Optional rules 50 - Server Specific rules 70 - System local rules 90 - Finalize (immutable) ``` The rules are meant to be used by the augenrules program. The augenrules program expects rules to be located in /etc/audit/rules.d. The rules will get processed in a specific order based on their natural sort order. The kernel's rule engine uses a first match wins strategy. So, the order of the rules matters. The sample rules are not meant to be used all at the same time. They are pieces of a policy that should be thought out and individual files copied to /etc/audit/rules.d/ For example, if you wanted to set a system up in the STIG configuration, copy rules 10-base-config, 30-stig, 31-privileged, and 99-finalize. You can add more if you like. But these 4 files are a baseline policy. If you want to learn more about writing custom rules, look for the audit.rules and auditctl man pages. EVENTS ------ The audit events come in two flavors: simple and compound. A simple event is sent from a trusted application such as sshd. It has only one record in the event. A compound event has multiple records in the same event. These multiple records are considered to be in the same event because they have the same timestamp and serial number. Audit events all start with the following preamble: ``` type= msg=audit(1679598373.352:1256072): ``` The first item is the record type. This tells you what kind of information and the meaning of the record is. Next there is a msg=audit field which has parenthesis. Inside it is the time since the epoch in seconds, a millisecond time, and a serial number. The millisecond is used to separate events within the same second. The serial number is used to separate events within the same millisecond. After the time stamp comes fields that are in key=value format. What these field are varies by record type. But the overall event should have the following: - Login ID (auid): the user ID that the user originally logged in with regardless of changing the real or effective user ID afterwards. - Session ID (ses): an identifier unique to the specific login in case the same user has multiple logins. - User ID (uid): the real user ID of the process at the time the audit event was generated. - Process ID (pid): the process ID of the subject that caused the event. - Results (res): Whether the subject's action was a success or failure. There can be optional information, depending on the kind of the event, which may include, but is not limited to: - The system call that a process made that caused the event - The group ID of the subject - Hostname or terminal the subject used for performing the action - File being accessed - Process being executed with arguments - Network address - Keystrokes - Netfilter packet decisions SEARCHING AND REPORTING FROM LOGS --------------------------------- The intended way to view audit events is by using the ausearch program. Audit events are not serialized in the kernel and could be interlaced and out of order. To straighten this out, ausearch/aureport/auparse all put the records on a holding list until the event is complete. It then emits them in sequential order so they are presented in numeric order. Some fields are searchable. Typically you will search for a specific kind of event, a specific process, a specific file, or a specific user. The ausearch man page details all the different options. Here are some example searches: ``` Searching for bad logins: ausearch -m USER_LOGIN --success no -i Searching for events on shadow file today: ausearch --start today -f shadow -i Searching for failed file opens for user acct 1000: ausearch -m PATH --success no --syscall open --loginuid 1000 -i ``` Sometimes you want summary information. In this case you would want to use the aureport program. It can summarize all of the searchable kinds of fields. It can also pick out all of a kind of data without summary so that you can later use ausearch to see the full event. Below are some examples of using aureport: ``` Monthly summary report: aureport --start this-month --summary Files accessed today summary: aureport --start today --file --summary Syscall events summarized by key: aureport --start today --key --summary All account modifications this month: aureport --start this-month --mods -i Report all log files and their time range: aureport -t ``` Sometimes aureport provides too much information. You might want a summary of files accessed by a specific user. In this case, you can combine ausearch and aureport to get the information you need. The main trick to remember is that the output of ausearch has to be in the "raw" format. For example: ``` Summary of files accessed by uid 1000 ausearch --start today --auid 1000 --raw | aureport --file --summary Summary of files accessed by vi ausearch --start this-week -x vi --raw | aureport --file --summary Summary of programs with files access associated with the unsuccessful-access key ausearch --start this-month --key unsuccessful-access --raw | aureport -x --summary -i Hosts user logged in from ausearch --start this-week -m user_login --raw | aureport --host --summary ``` The ausearch program also has a couple more tricks worth knowing about. It has an option, --format, which can take "csv" or "text" as options. In the case of csv, it will emit a condensed audit event normalized to be suitable as a Comma Separated Value file. In this format, you can take the audit logs and do data science queries using Excel/Sheets, python/pandas, or the R programming language. The other option, text, can be used to turn the audit events into simple sentences that describe what the event means. There are times when it doesn't have a mapping because the event is new. In those cases, the event may not make sense until the software is updated. PERFORMANCE AND MONITORING -------------------------- The audit system can output two sets of data to let you know how it's doing. The first method is to use: ``` auditctl -s ``` This outputs some basic information such as the kernel backlog size, the current backlog, and how many events have been lost. The backlog size is the size of the queue in records that the kernel can hold waiting for auditd to collect them. This should be around 8k or larger for a system that really does auditing. If you use the audit system to casually collect SELinux AVC's, then you can go lower to something like 256. The current backlog tells you how many events are awaiting delivery to auditd at that instant. This number should normally be low - less than 10. If this is getting bigger and approaching the backlog limit in size, then you have a problem to look into. Either you are generating too many events (rules need adjusting) or an auditd plugin is taking too long to dequeue records. The auditd daemon is very fast at writing records to disk and can handle thousands per second. Another way to check performance is to use ``` auditctl --signal state cat /var/run/auditd.state audit version = 3.1.2 current time = 08/24/23 20:21:31 process priority = -4 writing to logs = yes current log size = 2423 KB max log size = 8192 KB logs detected last rotate/shift = 0 space left on partition = yes Logging partition free space 45565 MB space_left setting 75 MB admin_space_left setting 50 MB logging suspended = no file system space action performed = no admin space action performed = no disk error detected = no Number of active plugins = 1 current plugin queue depth = 0 max plugin queue depth used = 4 plugin queue size = 2000 plugin queue overflow detected = no plugin queueing suspended = no listening for network connections = no ``` This command causes auditd to dump its internal metrics to /var/run/auditd.state. This can tell you if auditd is healthy. AUPARSE ------- The auparse library is available to allow one to create custom reporting applications. The library is patterned after a dbase or foxpro database library and has the following categories of functions: - General functions that affect operation of the library - Functions that traverse events - Accessors to event data - Functions that traverse records in the same event - Accessors to record data - Functions that traverse fields in the same record - Accessors to field data You can write programs in one of two ways: iterate across events, records, and fields; or use the feed API to which a callback function is presented with a single, complete event that can be iterated across the records and fields. The former is best for working with files, while the latter is more appropriate for realtime data for a plugin. Audit Standards --------------- You can find the standards to which the audit system conforms to in the ![Audit Documentation Project](https://github.com/linux-audit/audit-documentation). audit-4.0.2/bindings/0000755001034500103450000000000014655201460010164 5audit-4.0.2/bindings/swig/0000755001034500103450000000000014655201460011135 5audit-4.0.2/bindings/swig/python3/0000755001034500103450000000000014655201460012541 5audit-4.0.2/bindings/swig/python3/Makefile.in0000644001034500103450000006371214655201422014535 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = bindings/swig/python3 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prog_cc_for_build.m4 \ $(top_srcdir)/m4/cap-ng.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/src/libev/libev.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(pyexec_PYTHON) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(pyexecdir)" "$(DESTDIR)$(pyexecdir)" LTLIBRARIES = $(pyexec_LTLIBRARIES) nodist__audit_la_OBJECTS = _audit_la-audit_wrap.lo _audit_la_OBJECTS = $(nodist__audit_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = _audit_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(_audit_la_CFLAGS) \ $(CFLAGS) $(_audit_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/_audit_la-audit_wrap.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(nodist__audit_la_SOURCES) DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__py_compile = PYTHON=$(PYTHON) $(SHELL) $(py_compile) am__pep3147_tweak = \ sed -e 's|\.py$$||' -e 's|[^/]*$$|__pycache__/&.*.pyc __pycache__/&.*.pyo|' py_compile = $(top_srcdir)/py-compile am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ $(top_srcdir)/py-compile DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILD_EXEEXT = @BUILD_EXEEXT@ BUILD_OBJEXT = @BUILD_OBJEXT@ CAPNG_LDADD = @CAPNG_LDADD@ CAPNG_PKG = @CAPNG_PKG@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_FOR_BUILD = @CC_FOR_BUILD@ CFLAGS = @CFLAGS@ CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ CPP_FOR_BUILD = @CPP_FOR_BUILD@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG = @DEBUG@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GOLANG = @GOLANG@ GOROOT = @GOROOT@ 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@ LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ LIBOBJS = @LIBOBJS@ LIBS = $(top_builddir)/lib/libaudit.la LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBWRAP_LIBS = @LIBWRAP_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PYTHON = @PYTHON@ PYTHON3_CFLAGS = @PYTHON3_CFLAGS@ PYTHON3_INCLUDES = @PYTHON3_INCLUDES@ PYTHON3_LIBS = @PYTHON3_LIBS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ VERSION = @VERSION@ WFLAGS = @WFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CC_FOR_BUILD = @ac_ct_CC_FOR_BUILD@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gss_libs = @gss_libs@ 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@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ use_python3 = @use_python3@ # Makefile.am -- # Copyright 2015 Red Hat Inc. # All Rights Reserved. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this program; see the file COPYING.lib. If not, write to # the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor # Boston, MA 02110-1335, USA. # # Authors: # Steve Grubb # CONFIG_CLEAN_FILES = *.loT *.rej *.orig AM_CFLAGS = -fPIC -DPIC -fno-strict-aliasing $(PYTHON3_CFLAGS) AM_CPPFLAGS = -I. -I$(top_builddir) -I${top_srcdir}/lib $(PYTHON3_INCLUDES) SWIG_FLAGS = -python SWIG_INCLUDES = -I. -I$(top_builddir) -I${top_srcdir}/lib $(PYTHON3_INCLUDES) pyexec_PYTHON = audit.py pyexec_LTLIBRARIES = _audit.la pyexec_SOLIBRARIES = _audit.so _audit_la_CFLAGS = -shared _audit_la_LDFLAGS = -module -avoid-version -Wl,-z,relro _audit_la_DEPENDENCIES = ${top_srcdir}/lib/audit_logging.h ${top_builddir}/lib/libaudit.la _audit_la_LIBADD = ${top_builddir}/lib/libaudit.la nodist__audit_la_SOURCES = audit_wrap.c CLEANFILES = audit.py* audit_wrap.c *~ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu bindings/swig/python3/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu bindings/swig/python3/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-pyexecLTLIBRARIES: $(pyexec_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(pyexec_LTLIBRARIES)'; test -n "$(pyexecdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(pyexecdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pyexecdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pyexecdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pyexecdir)"; \ } uninstall-pyexecLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pyexec_LTLIBRARIES)'; test -n "$(pyexecdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pyexecdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pyexecdir)/$$f"; \ done clean-pyexecLTLIBRARIES: -test -z "$(pyexec_LTLIBRARIES)" || rm -f $(pyexec_LTLIBRARIES) @list='$(pyexec_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } _audit.la: $(_audit_la_OBJECTS) $(_audit_la_DEPENDENCIES) $(EXTRA__audit_la_DEPENDENCIES) $(AM_V_CCLD)$(_audit_la_LINK) -rpath $(pyexecdir) $(_audit_la_OBJECTS) $(_audit_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_audit_la-audit_wrap.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< _audit_la-audit_wrap.lo: audit_wrap.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_audit_la_CFLAGS) $(CFLAGS) -MT _audit_la-audit_wrap.lo -MD -MP -MF $(DEPDIR)/_audit_la-audit_wrap.Tpo -c -o _audit_la-audit_wrap.lo `test -f 'audit_wrap.c' || echo '$(srcdir)/'`audit_wrap.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/_audit_la-audit_wrap.Tpo $(DEPDIR)/_audit_la-audit_wrap.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='audit_wrap.c' object='_audit_la-audit_wrap.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(_audit_la_CFLAGS) $(CFLAGS) -c -o _audit_la-audit_wrap.lo `test -f 'audit_wrap.c' || echo '$(srcdir)/'`audit_wrap.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-pyexecPYTHON: $(pyexec_PYTHON) @$(NORMAL_INSTALL) @list='$(pyexec_PYTHON)'; dlist=; list2=; test -n "$(pyexecdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pyexecdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pyexecdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then b=; else b="$(srcdir)/"; fi; \ if test -f $$b$$p; then \ $(am__strip_dir) \ dlist="$$dlist $$f"; \ list2="$$list2 $$b$$p"; \ else :; fi; \ done; \ for file in $$list2; do echo $$file; done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pyexecdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pyexecdir)" || exit $$?; \ done || exit $$?; \ if test -n "$$dlist"; then \ $(am__py_compile) --destdir "$(DESTDIR)" \ --basedir "$(pyexecdir)" $$dlist; \ else :; fi uninstall-pyexecPYTHON: @$(NORMAL_UNINSTALL) @list='$(pyexec_PYTHON)'; test -n "$(pyexecdir)" || list=; \ py_files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$py_files" || exit 0; \ dir='$(DESTDIR)$(pyexecdir)'; \ pyc_files=`echo "$$py_files" | sed 's|$$|c|'`; \ pyo_files=`echo "$$py_files" | sed 's|$$|o|'`; \ st=0; \ for files in "$$py_files" "$$pyc_files" "$$pyo_files"; do \ $(am__uninstall_files_from_dir) || st=$$?; \ done; \ dir='$(DESTDIR)$(pyexecdir)'; \ echo "$$py_files" | $(am__pep3147_tweak) | $(am__base_list) | \ while read files; do \ $(am__uninstall_files_from_dir) || st=$$?; \ done || exit $$?; \ exit $$st ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pyexecdir)" "$(DESTDIR)$(pyexecdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-pyexecLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/_audit_la-audit_wrap.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pyexecLTLIBRARIES install-pyexecPYTHON install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/_audit_la-audit_wrap.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pyexecLTLIBRARIES uninstall-pyexecPYTHON .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-pyexecLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am \ install-pyexecLTLIBRARIES install-pyexecPYTHON install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am \ uninstall-pyexecLTLIBRARIES uninstall-pyexecPYTHON .PRECIOUS: Makefile _audit_la_HEADERS: $(top_builddir)/config.h audit.py audit_wrap.c: ${srcdir}/../src/auditswig.i swig -o audit_wrap.c ${SWIG_FLAGS} ${SWIG_INCLUDES} ${srcdir}/../src/auditswig.i # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: audit-4.0.2/bindings/swig/python3/Makefile.am0000644001034500103450000000335614655201403014521 # Makefile.am -- # Copyright 2015 Red Hat Inc. # All Rights Reserved. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this program; see the file COPYING.lib. If not, write to # the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor # Boston, MA 02110-1335, USA. # # Authors: # Steve Grubb # CONFIG_CLEAN_FILES = *.loT *.rej *.orig AM_CFLAGS = -fPIC -DPIC -fno-strict-aliasing $(PYTHON3_CFLAGS) AM_CPPFLAGS = -I. -I$(top_builddir) -I${top_srcdir}/lib $(PYTHON3_INCLUDES) LIBS = $(top_builddir)/lib/libaudit.la SWIG_FLAGS = -python SWIG_INCLUDES = -I. -I$(top_builddir) -I${top_srcdir}/lib $(PYTHON3_INCLUDES) pyexec_PYTHON = audit.py pyexec_LTLIBRARIES = _audit.la pyexec_SOLIBRARIES = _audit.so _audit_la_CFLAGS = -shared _audit_la_LDFLAGS = -module -avoid-version -Wl,-z,relro _audit_la_HEADERS: $(top_builddir)/config.h _audit_la_DEPENDENCIES =${top_srcdir}/lib/audit_logging.h ${top_builddir}/lib/libaudit.la _audit_la_LIBADD = ${top_builddir}/lib/libaudit.la nodist__audit_la_SOURCES = audit_wrap.c audit.py audit_wrap.c: ${srcdir}/../src/auditswig.i swig -o audit_wrap.c ${SWIG_FLAGS} ${SWIG_INCLUDES} ${srcdir}/../src/auditswig.i CLEANFILES = audit.py* audit_wrap.c *~ audit-4.0.2/bindings/swig/python3/audit.py0000644001034500103450000006541214655201460014151 # This file was automatically generated by SWIG (https://www.swig.org). # Version 4.1.1 # # Do not make changes to this file unless you know what you are doing - modify # the SWIG interface file instead. from sys import version_info as _swig_python_version_info # Import the low-level C/C++ module if __package__ or "." in __name__: from . import _audit else: import _audit try: import builtins as __builtin__ except ImportError: import __builtin__ def _swig_repr(self): try: strthis = "proxy of " + self.this.__repr__() except __builtin__.Exception: strthis = "" return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) def _swig_setattr_nondynamic_instance_variable(set): def set_instance_attr(self, name, value): if name == "this": set(self, name, value) elif name == "thisown": self.this.own(value) elif hasattr(self, name) and isinstance(getattr(type(self), name), property): set(self, name, value) else: raise AttributeError("You cannot add instance attributes to %s" % self) return set_instance_attr def _swig_setattr_nondynamic_class_variable(set): def set_class_attr(cls, name, value): if hasattr(cls, name) and not isinstance(getattr(cls, name), property): set(cls, name, value) else: raise AttributeError("You cannot add class attributes to %s" % cls) return set_class_attr def _swig_add_metaclass(metaclass): """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass""" def wrapper(cls): return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy()) return wrapper class _SwigNonDynamicMeta(type): """Meta class to enforce nondynamic attributes (no new attributes) for a class""" __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__) AUDIT_GET = _audit.AUDIT_GET AUDIT_SET = _audit.AUDIT_SET AUDIT_LIST = _audit.AUDIT_LIST AUDIT_ADD = _audit.AUDIT_ADD AUDIT_DEL = _audit.AUDIT_DEL AUDIT_USER = _audit.AUDIT_USER AUDIT_LOGIN = _audit.AUDIT_LOGIN AUDIT_WATCH_INS = _audit.AUDIT_WATCH_INS AUDIT_WATCH_REM = _audit.AUDIT_WATCH_REM AUDIT_WATCH_LIST = _audit.AUDIT_WATCH_LIST AUDIT_SIGNAL_INFO = _audit.AUDIT_SIGNAL_INFO AUDIT_ADD_RULE = _audit.AUDIT_ADD_RULE AUDIT_DEL_RULE = _audit.AUDIT_DEL_RULE AUDIT_LIST_RULES = _audit.AUDIT_LIST_RULES AUDIT_TRIM = _audit.AUDIT_TRIM AUDIT_MAKE_EQUIV = _audit.AUDIT_MAKE_EQUIV AUDIT_TTY_GET = _audit.AUDIT_TTY_GET AUDIT_TTY_SET = _audit.AUDIT_TTY_SET AUDIT_SET_FEATURE = _audit.AUDIT_SET_FEATURE AUDIT_GET_FEATURE = _audit.AUDIT_GET_FEATURE AUDIT_FIRST_USER_MSG = _audit.AUDIT_FIRST_USER_MSG AUDIT_USER_AVC = _audit.AUDIT_USER_AVC AUDIT_USER_TTY = _audit.AUDIT_USER_TTY AUDIT_LAST_USER_MSG = _audit.AUDIT_LAST_USER_MSG AUDIT_FIRST_USER_MSG2 = _audit.AUDIT_FIRST_USER_MSG2 AUDIT_LAST_USER_MSG2 = _audit.AUDIT_LAST_USER_MSG2 AUDIT_DAEMON_START = _audit.AUDIT_DAEMON_START AUDIT_DAEMON_END = _audit.AUDIT_DAEMON_END AUDIT_DAEMON_ABORT = _audit.AUDIT_DAEMON_ABORT AUDIT_DAEMON_CONFIG = _audit.AUDIT_DAEMON_CONFIG AUDIT_SYSCALL = _audit.AUDIT_SYSCALL AUDIT_PATH = _audit.AUDIT_PATH AUDIT_IPC = _audit.AUDIT_IPC AUDIT_SOCKETCALL = _audit.AUDIT_SOCKETCALL AUDIT_CONFIG_CHANGE = _audit.AUDIT_CONFIG_CHANGE AUDIT_SOCKADDR = _audit.AUDIT_SOCKADDR AUDIT_CWD = _audit.AUDIT_CWD AUDIT_EXECVE = _audit.AUDIT_EXECVE AUDIT_IPC_SET_PERM = _audit.AUDIT_IPC_SET_PERM AUDIT_MQ_OPEN = _audit.AUDIT_MQ_OPEN AUDIT_MQ_SENDRECV = _audit.AUDIT_MQ_SENDRECV AUDIT_MQ_NOTIFY = _audit.AUDIT_MQ_NOTIFY AUDIT_MQ_GETSETATTR = _audit.AUDIT_MQ_GETSETATTR AUDIT_KERNEL_OTHER = _audit.AUDIT_KERNEL_OTHER AUDIT_FD_PAIR = _audit.AUDIT_FD_PAIR AUDIT_OBJ_PID = _audit.AUDIT_OBJ_PID AUDIT_TTY = _audit.AUDIT_TTY AUDIT_EOE = _audit.AUDIT_EOE AUDIT_BPRM_FCAPS = _audit.AUDIT_BPRM_FCAPS AUDIT_CAPSET = _audit.AUDIT_CAPSET AUDIT_MMAP = _audit.AUDIT_MMAP AUDIT_NETFILTER_PKT = _audit.AUDIT_NETFILTER_PKT AUDIT_NETFILTER_CFG = _audit.AUDIT_NETFILTER_CFG AUDIT_SECCOMP = _audit.AUDIT_SECCOMP AUDIT_PROCTITLE = _audit.AUDIT_PROCTITLE AUDIT_FEATURE_CHANGE = _audit.AUDIT_FEATURE_CHANGE AUDIT_REPLACE = _audit.AUDIT_REPLACE AUDIT_KERN_MODULE = _audit.AUDIT_KERN_MODULE AUDIT_FANOTIFY = _audit.AUDIT_FANOTIFY AUDIT_TIME_INJOFFSET = _audit.AUDIT_TIME_INJOFFSET AUDIT_TIME_ADJNTPVAL = _audit.AUDIT_TIME_ADJNTPVAL AUDIT_BPF = _audit.AUDIT_BPF AUDIT_EVENT_LISTENER = _audit.AUDIT_EVENT_LISTENER AUDIT_URINGOP = _audit.AUDIT_URINGOP AUDIT_OPENAT2 = _audit.AUDIT_OPENAT2 AUDIT_DM_CTRL = _audit.AUDIT_DM_CTRL AUDIT_DM_EVENT = _audit.AUDIT_DM_EVENT AUDIT_AVC = _audit.AUDIT_AVC AUDIT_SELINUX_ERR = _audit.AUDIT_SELINUX_ERR AUDIT_AVC_PATH = _audit.AUDIT_AVC_PATH AUDIT_MAC_POLICY_LOAD = _audit.AUDIT_MAC_POLICY_LOAD AUDIT_MAC_STATUS = _audit.AUDIT_MAC_STATUS AUDIT_MAC_CONFIG_CHANGE = _audit.AUDIT_MAC_CONFIG_CHANGE AUDIT_MAC_UNLBL_ALLOW = _audit.AUDIT_MAC_UNLBL_ALLOW AUDIT_MAC_CIPSOV4_ADD = _audit.AUDIT_MAC_CIPSOV4_ADD AUDIT_MAC_CIPSOV4_DEL = _audit.AUDIT_MAC_CIPSOV4_DEL AUDIT_MAC_MAP_ADD = _audit.AUDIT_MAC_MAP_ADD AUDIT_MAC_MAP_DEL = _audit.AUDIT_MAC_MAP_DEL AUDIT_MAC_IPSEC_ADDSA = _audit.AUDIT_MAC_IPSEC_ADDSA AUDIT_MAC_IPSEC_DELSA = _audit.AUDIT_MAC_IPSEC_DELSA AUDIT_MAC_IPSEC_ADDSPD = _audit.AUDIT_MAC_IPSEC_ADDSPD AUDIT_MAC_IPSEC_DELSPD = _audit.AUDIT_MAC_IPSEC_DELSPD AUDIT_MAC_IPSEC_EVENT = _audit.AUDIT_MAC_IPSEC_EVENT AUDIT_MAC_UNLBL_STCADD = _audit.AUDIT_MAC_UNLBL_STCADD AUDIT_MAC_UNLBL_STCDEL = _audit.AUDIT_MAC_UNLBL_STCDEL AUDIT_MAC_CALIPSO_ADD = _audit.AUDIT_MAC_CALIPSO_ADD AUDIT_MAC_CALIPSO_DEL = _audit.AUDIT_MAC_CALIPSO_DEL AUDIT_FIRST_KERN_ANOM_MSG = _audit.AUDIT_FIRST_KERN_ANOM_MSG AUDIT_LAST_KERN_ANOM_MSG = _audit.AUDIT_LAST_KERN_ANOM_MSG AUDIT_ANOM_PROMISCUOUS = _audit.AUDIT_ANOM_PROMISCUOUS AUDIT_ANOM_ABEND = _audit.AUDIT_ANOM_ABEND AUDIT_ANOM_LINK = _audit.AUDIT_ANOM_LINK AUDIT_ANOM_CREAT = _audit.AUDIT_ANOM_CREAT AUDIT_INTEGRITY_DATA = _audit.AUDIT_INTEGRITY_DATA AUDIT_INTEGRITY_METADATA = _audit.AUDIT_INTEGRITY_METADATA AUDIT_INTEGRITY_STATUS = _audit.AUDIT_INTEGRITY_STATUS AUDIT_INTEGRITY_HASH = _audit.AUDIT_INTEGRITY_HASH AUDIT_INTEGRITY_PCR = _audit.AUDIT_INTEGRITY_PCR AUDIT_INTEGRITY_RULE = _audit.AUDIT_INTEGRITY_RULE AUDIT_INTEGRITY_EVM_XATTR = _audit.AUDIT_INTEGRITY_EVM_XATTR AUDIT_INTEGRITY_POLICY_RULE = _audit.AUDIT_INTEGRITY_POLICY_RULE AUDIT_KERNEL = _audit.AUDIT_KERNEL AUDIT_FILTER_USER = _audit.AUDIT_FILTER_USER AUDIT_FILTER_TASK = _audit.AUDIT_FILTER_TASK AUDIT_FILTER_ENTRY = _audit.AUDIT_FILTER_ENTRY AUDIT_FILTER_WATCH = _audit.AUDIT_FILTER_WATCH AUDIT_FILTER_EXIT = _audit.AUDIT_FILTER_EXIT AUDIT_FILTER_EXCLUDE = _audit.AUDIT_FILTER_EXCLUDE AUDIT_FILTER_TYPE = _audit.AUDIT_FILTER_TYPE AUDIT_FILTER_FS = _audit.AUDIT_FILTER_FS AUDIT_FILTER_URING_EXIT = _audit.AUDIT_FILTER_URING_EXIT AUDIT_NR_FILTERS = _audit.AUDIT_NR_FILTERS AUDIT_FILTER_PREPEND = _audit.AUDIT_FILTER_PREPEND AUDIT_NEVER = _audit.AUDIT_NEVER AUDIT_POSSIBLE = _audit.AUDIT_POSSIBLE AUDIT_ALWAYS = _audit.AUDIT_ALWAYS AUDIT_MAX_FIELDS = _audit.AUDIT_MAX_FIELDS AUDIT_MAX_KEY_LEN = _audit.AUDIT_MAX_KEY_LEN AUDIT_BITMASK_SIZE = _audit.AUDIT_BITMASK_SIZE AUDIT_SYSCALL_CLASSES = _audit.AUDIT_SYSCALL_CLASSES AUDIT_CLASS_DIR_WRITE = _audit.AUDIT_CLASS_DIR_WRITE AUDIT_CLASS_DIR_WRITE_32 = _audit.AUDIT_CLASS_DIR_WRITE_32 AUDIT_CLASS_CHATTR = _audit.AUDIT_CLASS_CHATTR AUDIT_CLASS_CHATTR_32 = _audit.AUDIT_CLASS_CHATTR_32 AUDIT_CLASS_READ = _audit.AUDIT_CLASS_READ AUDIT_CLASS_READ_32 = _audit.AUDIT_CLASS_READ_32 AUDIT_CLASS_WRITE = _audit.AUDIT_CLASS_WRITE AUDIT_CLASS_WRITE_32 = _audit.AUDIT_CLASS_WRITE_32 AUDIT_CLASS_SIGNAL = _audit.AUDIT_CLASS_SIGNAL AUDIT_CLASS_SIGNAL_32 = _audit.AUDIT_CLASS_SIGNAL_32 AUDIT_UNUSED_BITS = _audit.AUDIT_UNUSED_BITS AUDIT_COMPARE_UID_TO_OBJ_UID = _audit.AUDIT_COMPARE_UID_TO_OBJ_UID AUDIT_COMPARE_GID_TO_OBJ_GID = _audit.AUDIT_COMPARE_GID_TO_OBJ_GID AUDIT_COMPARE_EUID_TO_OBJ_UID = _audit.AUDIT_COMPARE_EUID_TO_OBJ_UID AUDIT_COMPARE_EGID_TO_OBJ_GID = _audit.AUDIT_COMPARE_EGID_TO_OBJ_GID AUDIT_COMPARE_AUID_TO_OBJ_UID = _audit.AUDIT_COMPARE_AUID_TO_OBJ_UID AUDIT_COMPARE_SUID_TO_OBJ_UID = _audit.AUDIT_COMPARE_SUID_TO_OBJ_UID AUDIT_COMPARE_SGID_TO_OBJ_GID = _audit.AUDIT_COMPARE_SGID_TO_OBJ_GID AUDIT_COMPARE_FSUID_TO_OBJ_UID = _audit.AUDIT_COMPARE_FSUID_TO_OBJ_UID AUDIT_COMPARE_FSGID_TO_OBJ_GID = _audit.AUDIT_COMPARE_FSGID_TO_OBJ_GID AUDIT_COMPARE_UID_TO_AUID = _audit.AUDIT_COMPARE_UID_TO_AUID AUDIT_COMPARE_UID_TO_EUID = _audit.AUDIT_COMPARE_UID_TO_EUID AUDIT_COMPARE_UID_TO_FSUID = _audit.AUDIT_COMPARE_UID_TO_FSUID AUDIT_COMPARE_UID_TO_SUID = _audit.AUDIT_COMPARE_UID_TO_SUID AUDIT_COMPARE_AUID_TO_FSUID = _audit.AUDIT_COMPARE_AUID_TO_FSUID AUDIT_COMPARE_AUID_TO_SUID = _audit.AUDIT_COMPARE_AUID_TO_SUID AUDIT_COMPARE_AUID_TO_EUID = _audit.AUDIT_COMPARE_AUID_TO_EUID AUDIT_COMPARE_EUID_TO_SUID = _audit.AUDIT_COMPARE_EUID_TO_SUID AUDIT_COMPARE_EUID_TO_FSUID = _audit.AUDIT_COMPARE_EUID_TO_FSUID AUDIT_COMPARE_SUID_TO_FSUID = _audit.AUDIT_COMPARE_SUID_TO_FSUID AUDIT_COMPARE_GID_TO_EGID = _audit.AUDIT_COMPARE_GID_TO_EGID AUDIT_COMPARE_GID_TO_FSGID = _audit.AUDIT_COMPARE_GID_TO_FSGID AUDIT_COMPARE_GID_TO_SGID = _audit.AUDIT_COMPARE_GID_TO_SGID AUDIT_COMPARE_EGID_TO_FSGID = _audit.AUDIT_COMPARE_EGID_TO_FSGID AUDIT_COMPARE_EGID_TO_SGID = _audit.AUDIT_COMPARE_EGID_TO_SGID AUDIT_COMPARE_SGID_TO_FSGID = _audit.AUDIT_COMPARE_SGID_TO_FSGID AUDIT_MAX_FIELD_COMPARE = _audit.AUDIT_MAX_FIELD_COMPARE AUDIT_PID = _audit.AUDIT_PID AUDIT_UID = _audit.AUDIT_UID AUDIT_EUID = _audit.AUDIT_EUID AUDIT_SUID = _audit.AUDIT_SUID AUDIT_FSUID = _audit.AUDIT_FSUID AUDIT_GID = _audit.AUDIT_GID AUDIT_EGID = _audit.AUDIT_EGID AUDIT_SGID = _audit.AUDIT_SGID AUDIT_FSGID = _audit.AUDIT_FSGID AUDIT_LOGINUID = _audit.AUDIT_LOGINUID AUDIT_PERS = _audit.AUDIT_PERS AUDIT_ARCH = _audit.AUDIT_ARCH AUDIT_MSGTYPE = _audit.AUDIT_MSGTYPE AUDIT_SUBJ_USER = _audit.AUDIT_SUBJ_USER AUDIT_SUBJ_ROLE = _audit.AUDIT_SUBJ_ROLE AUDIT_SUBJ_TYPE = _audit.AUDIT_SUBJ_TYPE AUDIT_SUBJ_SEN = _audit.AUDIT_SUBJ_SEN AUDIT_SUBJ_CLR = _audit.AUDIT_SUBJ_CLR AUDIT_PPID = _audit.AUDIT_PPID AUDIT_OBJ_USER = _audit.AUDIT_OBJ_USER AUDIT_OBJ_ROLE = _audit.AUDIT_OBJ_ROLE AUDIT_OBJ_TYPE = _audit.AUDIT_OBJ_TYPE AUDIT_OBJ_LEV_LOW = _audit.AUDIT_OBJ_LEV_LOW AUDIT_OBJ_LEV_HIGH = _audit.AUDIT_OBJ_LEV_HIGH AUDIT_LOGINUID_SET = _audit.AUDIT_LOGINUID_SET AUDIT_SESSIONID = _audit.AUDIT_SESSIONID AUDIT_FSTYPE = _audit.AUDIT_FSTYPE AUDIT_DEVMAJOR = _audit.AUDIT_DEVMAJOR AUDIT_DEVMINOR = _audit.AUDIT_DEVMINOR AUDIT_INODE = _audit.AUDIT_INODE AUDIT_EXIT = _audit.AUDIT_EXIT AUDIT_SUCCESS = _audit.AUDIT_SUCCESS AUDIT_WATCH = _audit.AUDIT_WATCH AUDIT_PERM = _audit.AUDIT_PERM AUDIT_DIR = _audit.AUDIT_DIR AUDIT_FILETYPE = _audit.AUDIT_FILETYPE AUDIT_OBJ_UID = _audit.AUDIT_OBJ_UID AUDIT_OBJ_GID = _audit.AUDIT_OBJ_GID AUDIT_FIELD_COMPARE = _audit.AUDIT_FIELD_COMPARE AUDIT_EXE = _audit.AUDIT_EXE AUDIT_SADDR_FAM = _audit.AUDIT_SADDR_FAM AUDIT_ARG0 = _audit.AUDIT_ARG0 AUDIT_ARG1 = _audit.AUDIT_ARG1 AUDIT_ARG2 = _audit.AUDIT_ARG2 AUDIT_ARG3 = _audit.AUDIT_ARG3 AUDIT_FILTERKEY = _audit.AUDIT_FILTERKEY AUDIT_NEGATE = _audit.AUDIT_NEGATE AUDIT_BIT_MASK = _audit.AUDIT_BIT_MASK AUDIT_LESS_THAN = _audit.AUDIT_LESS_THAN AUDIT_GREATER_THAN = _audit.AUDIT_GREATER_THAN AUDIT_NOT_EQUAL = _audit.AUDIT_NOT_EQUAL AUDIT_EQUAL = _audit.AUDIT_EQUAL AUDIT_BIT_TEST = _audit.AUDIT_BIT_TEST AUDIT_LESS_THAN_OR_EQUAL = _audit.AUDIT_LESS_THAN_OR_EQUAL AUDIT_GREATER_THAN_OR_EQUAL = _audit.AUDIT_GREATER_THAN_OR_EQUAL AUDIT_OPERATORS = _audit.AUDIT_OPERATORS Audit_equal = _audit.Audit_equal Audit_not_equal = _audit.Audit_not_equal Audit_bitmask = _audit.Audit_bitmask Audit_bittest = _audit.Audit_bittest Audit_lt = _audit.Audit_lt Audit_gt = _audit.Audit_gt Audit_le = _audit.Audit_le Audit_ge = _audit.Audit_ge Audit_bad = _audit.Audit_bad AUDIT_STATUS_ENABLED = _audit.AUDIT_STATUS_ENABLED AUDIT_STATUS_FAILURE = _audit.AUDIT_STATUS_FAILURE AUDIT_STATUS_PID = _audit.AUDIT_STATUS_PID AUDIT_STATUS_RATE_LIMIT = _audit.AUDIT_STATUS_RATE_LIMIT AUDIT_STATUS_BACKLOG_LIMIT = _audit.AUDIT_STATUS_BACKLOG_LIMIT AUDIT_STATUS_BACKLOG_WAIT_TIME = _audit.AUDIT_STATUS_BACKLOG_WAIT_TIME AUDIT_STATUS_LOST = _audit.AUDIT_STATUS_LOST AUDIT_STATUS_BACKLOG_WAIT_TIME_ACTUAL = _audit.AUDIT_STATUS_BACKLOG_WAIT_TIME_ACTUAL AUDIT_FEATURE_BITMAP_BACKLOG_LIMIT = _audit.AUDIT_FEATURE_BITMAP_BACKLOG_LIMIT AUDIT_FEATURE_BITMAP_BACKLOG_WAIT_TIME = _audit.AUDIT_FEATURE_BITMAP_BACKLOG_WAIT_TIME AUDIT_FEATURE_BITMAP_EXECUTABLE_PATH = _audit.AUDIT_FEATURE_BITMAP_EXECUTABLE_PATH AUDIT_FEATURE_BITMAP_EXCLUDE_EXTEND = _audit.AUDIT_FEATURE_BITMAP_EXCLUDE_EXTEND AUDIT_FEATURE_BITMAP_SESSIONID_FILTER = _audit.AUDIT_FEATURE_BITMAP_SESSIONID_FILTER AUDIT_FEATURE_BITMAP_LOST_RESET = _audit.AUDIT_FEATURE_BITMAP_LOST_RESET AUDIT_FEATURE_BITMAP_FILTER_FS = _audit.AUDIT_FEATURE_BITMAP_FILTER_FS AUDIT_FEATURE_BITMAP_ALL = _audit.AUDIT_FEATURE_BITMAP_ALL AUDIT_VERSION_LATEST = _audit.AUDIT_VERSION_LATEST AUDIT_VERSION_BACKLOG_LIMIT = _audit.AUDIT_VERSION_BACKLOG_LIMIT AUDIT_VERSION_BACKLOG_WAIT_TIME = _audit.AUDIT_VERSION_BACKLOG_WAIT_TIME AUDIT_FAIL_SILENT = _audit.AUDIT_FAIL_SILENT AUDIT_FAIL_PRINTK = _audit.AUDIT_FAIL_PRINTK AUDIT_FAIL_PANIC = _audit.AUDIT_FAIL_PANIC __AUDIT_ARCH_CONVENTION_MASK = _audit.__AUDIT_ARCH_CONVENTION_MASK __AUDIT_ARCH_CONVENTION_MIPS64_N32 = _audit.__AUDIT_ARCH_CONVENTION_MIPS64_N32 __AUDIT_ARCH_64BIT = _audit.__AUDIT_ARCH_64BIT __AUDIT_ARCH_LE = _audit.__AUDIT_ARCH_LE AUDIT_PERM_EXEC = _audit.AUDIT_PERM_EXEC AUDIT_PERM_WRITE = _audit.AUDIT_PERM_WRITE AUDIT_PERM_READ = _audit.AUDIT_PERM_READ AUDIT_PERM_ATTR = _audit.AUDIT_PERM_ATTR AUDIT_MESSAGE_TEXT_MAX = _audit.AUDIT_MESSAGE_TEXT_MAX AUDIT_NLGRP_NONE = _audit.AUDIT_NLGRP_NONE AUDIT_NLGRP_READLOG = _audit.AUDIT_NLGRP_READLOG __AUDIT_NLGRP_MAX = _audit.__AUDIT_NLGRP_MAX class audit_status(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr mask = property(_audit.audit_status_mask_get, _audit.audit_status_mask_set) enabled = property(_audit.audit_status_enabled_get, _audit.audit_status_enabled_set) failure = property(_audit.audit_status_failure_get, _audit.audit_status_failure_set) pid = property(_audit.audit_status_pid_get, _audit.audit_status_pid_set) rate_limit = property(_audit.audit_status_rate_limit_get, _audit.audit_status_rate_limit_set) backlog_limit = property(_audit.audit_status_backlog_limit_get, _audit.audit_status_backlog_limit_set) lost = property(_audit.audit_status_lost_get, _audit.audit_status_lost_set) backlog = property(_audit.audit_status_backlog_get, _audit.audit_status_backlog_set) version = property(_audit.audit_status_version_get, _audit.audit_status_version_set) feature_bitmap = property(_audit.audit_status_feature_bitmap_get, _audit.audit_status_feature_bitmap_set) backlog_wait_time = property(_audit.audit_status_backlog_wait_time_get, _audit.audit_status_backlog_wait_time_set) backlog_wait_time_actual = property(_audit.audit_status_backlog_wait_time_actual_get, _audit.audit_status_backlog_wait_time_actual_set) def __init__(self): _audit.audit_status_swiginit(self, _audit.new_audit_status()) __swig_destroy__ = _audit.delete_audit_status # Register audit_status in _audit: _audit.audit_status_swigregister(audit_status) class audit_features(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr vers = property(_audit.audit_features_vers_get, _audit.audit_features_vers_set) mask = property(_audit.audit_features_mask_get, _audit.audit_features_mask_set) features = property(_audit.audit_features_features_get, _audit.audit_features_features_set) lock = property(_audit.audit_features_lock_get, _audit.audit_features_lock_set) def __init__(self): _audit.audit_features_swiginit(self, _audit.new_audit_features()) __swig_destroy__ = _audit.delete_audit_features # Register audit_features in _audit: _audit.audit_features_swigregister(audit_features) AUDIT_FEATURE_VERSION = _audit.AUDIT_FEATURE_VERSION AUDIT_FEATURE_ONLY_UNSET_LOGINUID = _audit.AUDIT_FEATURE_ONLY_UNSET_LOGINUID AUDIT_FEATURE_LOGINUID_IMMUTABLE = _audit.AUDIT_FEATURE_LOGINUID_IMMUTABLE AUDIT_LAST_FEATURE = _audit.AUDIT_LAST_FEATURE class audit_tty_status(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr enabled = property(_audit.audit_tty_status_enabled_get, _audit.audit_tty_status_enabled_set) log_passwd = property(_audit.audit_tty_status_log_passwd_get, _audit.audit_tty_status_log_passwd_set) def __init__(self): _audit.audit_tty_status_swiginit(self, _audit.new_audit_tty_status()) __swig_destroy__ = _audit.delete_audit_tty_status # Register audit_tty_status in _audit: _audit.audit_tty_status_swigregister(audit_tty_status) class audit_rule_data(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr flags = property(_audit.audit_rule_data_flags_get, _audit.audit_rule_data_flags_set) action = property(_audit.audit_rule_data_action_get, _audit.audit_rule_data_action_set) field_count = property(_audit.audit_rule_data_field_count_get, _audit.audit_rule_data_field_count_set) mask = property(_audit.audit_rule_data_mask_get, _audit.audit_rule_data_mask_set) fields = property(_audit.audit_rule_data_fields_get, _audit.audit_rule_data_fields_set) values = property(_audit.audit_rule_data_values_get, _audit.audit_rule_data_values_set) fieldflags = property(_audit.audit_rule_data_fieldflags_get, _audit.audit_rule_data_fieldflags_set) buflen = property(_audit.audit_rule_data_buflen_get, _audit.audit_rule_data_buflen_set) def __init__(self): _audit.audit_rule_data_swiginit(self, _audit.new_audit_rule_data()) __swig_destroy__ = _audit.delete_audit_rule_data # Register audit_rule_data in _audit: _audit.audit_rule_data_swigregister(audit_rule_data) AUDIT_USER_AUTH = _audit.AUDIT_USER_AUTH AUDIT_USER_ACCT = _audit.AUDIT_USER_ACCT AUDIT_USER_MGMT = _audit.AUDIT_USER_MGMT AUDIT_CRED_ACQ = _audit.AUDIT_CRED_ACQ AUDIT_CRED_DISP = _audit.AUDIT_CRED_DISP AUDIT_USER_START = _audit.AUDIT_USER_START AUDIT_USER_END = _audit.AUDIT_USER_END AUDIT_USER_CHAUTHTOK = _audit.AUDIT_USER_CHAUTHTOK AUDIT_USER_ERR = _audit.AUDIT_USER_ERR AUDIT_CRED_REFR = _audit.AUDIT_CRED_REFR AUDIT_USYS_CONFIG = _audit.AUDIT_USYS_CONFIG AUDIT_USER_LOGIN = _audit.AUDIT_USER_LOGIN AUDIT_USER_LOGOUT = _audit.AUDIT_USER_LOGOUT AUDIT_ADD_USER = _audit.AUDIT_ADD_USER AUDIT_DEL_USER = _audit.AUDIT_DEL_USER AUDIT_ADD_GROUP = _audit.AUDIT_ADD_GROUP AUDIT_DEL_GROUP = _audit.AUDIT_DEL_GROUP AUDIT_DAC_CHECK = _audit.AUDIT_DAC_CHECK AUDIT_CHGRP_ID = _audit.AUDIT_CHGRP_ID AUDIT_TEST = _audit.AUDIT_TEST AUDIT_TRUSTED_APP = _audit.AUDIT_TRUSTED_APP AUDIT_USER_SELINUX_ERR = _audit.AUDIT_USER_SELINUX_ERR AUDIT_USER_CMD = _audit.AUDIT_USER_CMD AUDIT_CHUSER_ID = _audit.AUDIT_CHUSER_ID AUDIT_GRP_AUTH = _audit.AUDIT_GRP_AUTH AUDIT_SYSTEM_BOOT = _audit.AUDIT_SYSTEM_BOOT AUDIT_SYSTEM_SHUTDOWN = _audit.AUDIT_SYSTEM_SHUTDOWN AUDIT_SYSTEM_RUNLEVEL = _audit.AUDIT_SYSTEM_RUNLEVEL AUDIT_SERVICE_START = _audit.AUDIT_SERVICE_START AUDIT_SERVICE_STOP = _audit.AUDIT_SERVICE_STOP AUDIT_GRP_MGMT = _audit.AUDIT_GRP_MGMT AUDIT_GRP_CHAUTHTOK = _audit.AUDIT_GRP_CHAUTHTOK AUDIT_MAC_CHECK = _audit.AUDIT_MAC_CHECK AUDIT_ACCT_LOCK = _audit.AUDIT_ACCT_LOCK AUDIT_ACCT_UNLOCK = _audit.AUDIT_ACCT_UNLOCK AUDIT_USER_DEVICE = _audit.AUDIT_USER_DEVICE AUDIT_SOFTWARE_UPDATE = _audit.AUDIT_SOFTWARE_UPDATE AUDIT_FIRST_DAEMON = _audit.AUDIT_FIRST_DAEMON AUDIT_LAST_DAEMON = _audit.AUDIT_LAST_DAEMON AUDIT_DAEMON_RECONFIG = _audit.AUDIT_DAEMON_RECONFIG AUDIT_DAEMON_ROTATE = _audit.AUDIT_DAEMON_ROTATE AUDIT_DAEMON_RESUME = _audit.AUDIT_DAEMON_RESUME AUDIT_DAEMON_ACCEPT = _audit.AUDIT_DAEMON_ACCEPT AUDIT_DAEMON_CLOSE = _audit.AUDIT_DAEMON_CLOSE AUDIT_DAEMON_ERR = _audit.AUDIT_DAEMON_ERR AUDIT_FIRST_EVENT = _audit.AUDIT_FIRST_EVENT AUDIT_LAST_EVENT = _audit.AUDIT_LAST_EVENT AUDIT_FIRST_SELINUX = _audit.AUDIT_FIRST_SELINUX AUDIT_LAST_SELINUX = _audit.AUDIT_LAST_SELINUX AUDIT_FIRST_APPARMOR = _audit.AUDIT_FIRST_APPARMOR AUDIT_LAST_APPARMOR = _audit.AUDIT_LAST_APPARMOR AUDIT_AA = _audit.AUDIT_AA AUDIT_APPARMOR_AUDIT = _audit.AUDIT_APPARMOR_AUDIT AUDIT_APPARMOR_ALLOWED = _audit.AUDIT_APPARMOR_ALLOWED AUDIT_APPARMOR_DENIED = _audit.AUDIT_APPARMOR_DENIED AUDIT_APPARMOR_HINT = _audit.AUDIT_APPARMOR_HINT AUDIT_APPARMOR_STATUS = _audit.AUDIT_APPARMOR_STATUS AUDIT_APPARMOR_ERROR = _audit.AUDIT_APPARMOR_ERROR AUDIT_APPARMOR_KILL = _audit.AUDIT_APPARMOR_KILL AUDIT_FIRST_KERN_CRYPTO_MSG = _audit.AUDIT_FIRST_KERN_CRYPTO_MSG AUDIT_LAST_KERN_CRYPTO_MSG = _audit.AUDIT_LAST_KERN_CRYPTO_MSG AUDIT_INTEGRITY_FIRST_MSG = _audit.AUDIT_INTEGRITY_FIRST_MSG AUDIT_INTEGRITY_LAST_MSG = _audit.AUDIT_INTEGRITY_LAST_MSG AUDIT_FIRST_ANOM_MSG = _audit.AUDIT_FIRST_ANOM_MSG AUDIT_LAST_ANOM_MSG = _audit.AUDIT_LAST_ANOM_MSG AUDIT_ANOM_LOGIN_FAILURES = _audit.AUDIT_ANOM_LOGIN_FAILURES AUDIT_ANOM_LOGIN_TIME = _audit.AUDIT_ANOM_LOGIN_TIME AUDIT_ANOM_LOGIN_SESSIONS = _audit.AUDIT_ANOM_LOGIN_SESSIONS AUDIT_ANOM_LOGIN_ACCT = _audit.AUDIT_ANOM_LOGIN_ACCT AUDIT_ANOM_LOGIN_LOCATION = _audit.AUDIT_ANOM_LOGIN_LOCATION AUDIT_ANOM_MAX_DAC = _audit.AUDIT_ANOM_MAX_DAC AUDIT_ANOM_MAX_MAC = _audit.AUDIT_ANOM_MAX_MAC AUDIT_ANOM_AMTU_FAIL = _audit.AUDIT_ANOM_AMTU_FAIL AUDIT_ANOM_RBAC_FAIL = _audit.AUDIT_ANOM_RBAC_FAIL AUDIT_ANOM_RBAC_INTEGRITY_FAIL = _audit.AUDIT_ANOM_RBAC_INTEGRITY_FAIL AUDIT_ANOM_CRYPTO_FAIL = _audit.AUDIT_ANOM_CRYPTO_FAIL AUDIT_ANOM_ACCESS_FS = _audit.AUDIT_ANOM_ACCESS_FS AUDIT_ANOM_EXEC = _audit.AUDIT_ANOM_EXEC AUDIT_ANOM_MK_EXEC = _audit.AUDIT_ANOM_MK_EXEC AUDIT_ANOM_ADD_ACCT = _audit.AUDIT_ANOM_ADD_ACCT AUDIT_ANOM_DEL_ACCT = _audit.AUDIT_ANOM_DEL_ACCT AUDIT_ANOM_MOD_ACCT = _audit.AUDIT_ANOM_MOD_ACCT AUDIT_ANOM_ROOT_TRANS = _audit.AUDIT_ANOM_ROOT_TRANS AUDIT_ANOM_LOGIN_SERVICE = _audit.AUDIT_ANOM_LOGIN_SERVICE AUDIT_ANOM_LOGIN_ROOT = _audit.AUDIT_ANOM_LOGIN_ROOT AUDIT_ANOM_ORIGIN_FAILURES = _audit.AUDIT_ANOM_ORIGIN_FAILURES AUDIT_ANOM_SESSION = _audit.AUDIT_ANOM_SESSION AUDIT_FIRST_ANOM_RESP = _audit.AUDIT_FIRST_ANOM_RESP AUDIT_LAST_ANOM_RESP = _audit.AUDIT_LAST_ANOM_RESP AUDIT_RESP_ANOMALY = _audit.AUDIT_RESP_ANOMALY AUDIT_RESP_ALERT = _audit.AUDIT_RESP_ALERT AUDIT_RESP_KILL_PROC = _audit.AUDIT_RESP_KILL_PROC AUDIT_RESP_TERM_ACCESS = _audit.AUDIT_RESP_TERM_ACCESS AUDIT_RESP_ACCT_REMOTE = _audit.AUDIT_RESP_ACCT_REMOTE AUDIT_RESP_ACCT_LOCK_TIMED = _audit.AUDIT_RESP_ACCT_LOCK_TIMED AUDIT_RESP_ACCT_UNLOCK_TIMED = _audit.AUDIT_RESP_ACCT_UNLOCK_TIMED AUDIT_RESP_ACCT_LOCK = _audit.AUDIT_RESP_ACCT_LOCK AUDIT_RESP_TERM_LOCK = _audit.AUDIT_RESP_TERM_LOCK AUDIT_RESP_SEBOOL = _audit.AUDIT_RESP_SEBOOL AUDIT_RESP_EXEC = _audit.AUDIT_RESP_EXEC AUDIT_RESP_SINGLE = _audit.AUDIT_RESP_SINGLE AUDIT_RESP_HALT = _audit.AUDIT_RESP_HALT AUDIT_RESP_ORIGIN_BLOCK = _audit.AUDIT_RESP_ORIGIN_BLOCK AUDIT_RESP_ORIGIN_BLOCK_TIMED = _audit.AUDIT_RESP_ORIGIN_BLOCK_TIMED AUDIT_RESP_ORIGIN_UNBLOCK_TIMED = _audit.AUDIT_RESP_ORIGIN_UNBLOCK_TIMED AUDIT_FIRST_USER_LSPP_MSG = _audit.AUDIT_FIRST_USER_LSPP_MSG AUDIT_LAST_USER_LSPP_MSG = _audit.AUDIT_LAST_USER_LSPP_MSG AUDIT_USER_ROLE_CHANGE = _audit.AUDIT_USER_ROLE_CHANGE AUDIT_ROLE_ASSIGN = _audit.AUDIT_ROLE_ASSIGN AUDIT_ROLE_REMOVE = _audit.AUDIT_ROLE_REMOVE AUDIT_LABEL_OVERRIDE = _audit.AUDIT_LABEL_OVERRIDE AUDIT_LABEL_LEVEL_CHANGE = _audit.AUDIT_LABEL_LEVEL_CHANGE AUDIT_USER_LABELED_EXPORT = _audit.AUDIT_USER_LABELED_EXPORT AUDIT_USER_UNLABELED_EXPORT = _audit.AUDIT_USER_UNLABELED_EXPORT AUDIT_DEV_ALLOC = _audit.AUDIT_DEV_ALLOC AUDIT_DEV_DEALLOC = _audit.AUDIT_DEV_DEALLOC AUDIT_FS_RELABEL = _audit.AUDIT_FS_RELABEL AUDIT_USER_MAC_POLICY_LOAD = _audit.AUDIT_USER_MAC_POLICY_LOAD AUDIT_ROLE_MODIFY = _audit.AUDIT_ROLE_MODIFY AUDIT_USER_MAC_CONFIG_CHANGE = _audit.AUDIT_USER_MAC_CONFIG_CHANGE AUDIT_USER_MAC_STATUS = _audit.AUDIT_USER_MAC_STATUS AUDIT_FIRST_CRYPTO_MSG = _audit.AUDIT_FIRST_CRYPTO_MSG AUDIT_CRYPTO_TEST_USER = _audit.AUDIT_CRYPTO_TEST_USER AUDIT_CRYPTO_PARAM_CHANGE_USER = _audit.AUDIT_CRYPTO_PARAM_CHANGE_USER AUDIT_CRYPTO_LOGIN = _audit.AUDIT_CRYPTO_LOGIN AUDIT_CRYPTO_LOGOUT = _audit.AUDIT_CRYPTO_LOGOUT AUDIT_CRYPTO_KEY_USER = _audit.AUDIT_CRYPTO_KEY_USER AUDIT_CRYPTO_FAILURE_USER = _audit.AUDIT_CRYPTO_FAILURE_USER AUDIT_CRYPTO_REPLAY_USER = _audit.AUDIT_CRYPTO_REPLAY_USER AUDIT_CRYPTO_SESSION = _audit.AUDIT_CRYPTO_SESSION AUDIT_CRYPTO_IKE_SA = _audit.AUDIT_CRYPTO_IKE_SA AUDIT_CRYPTO_IPSEC_SA = _audit.AUDIT_CRYPTO_IPSEC_SA AUDIT_LAST_CRYPTO_MSG = _audit.AUDIT_LAST_CRYPTO_MSG AUDIT_FIRST_VIRT_MSG = _audit.AUDIT_FIRST_VIRT_MSG AUDIT_VIRT_CONTROL = _audit.AUDIT_VIRT_CONTROL AUDIT_VIRT_RESOURCE = _audit.AUDIT_VIRT_RESOURCE AUDIT_VIRT_MACHINE_ID = _audit.AUDIT_VIRT_MACHINE_ID AUDIT_VIRT_INTEGRITY_CHECK = _audit.AUDIT_VIRT_INTEGRITY_CHECK AUDIT_VIRT_CREATE = _audit.AUDIT_VIRT_CREATE AUDIT_VIRT_DESTROY = _audit.AUDIT_VIRT_DESTROY AUDIT_VIRT_MIGRATE_IN = _audit.AUDIT_VIRT_MIGRATE_IN AUDIT_VIRT_MIGRATE_OUT = _audit.AUDIT_VIRT_MIGRATE_OUT AUDIT_LAST_VIRT_MSG = _audit.AUDIT_LAST_VIRT_MSG def audit_open(): return _audit.audit_open() def audit_close(fd): return _audit.audit_close(fd) def audit_value_needs_encoding(str, size): return _audit.audit_value_needs_encoding(str, size) def audit_encode_value(final, buf, size): return _audit.audit_encode_value(final, buf, size) def audit_encode_nv_string(name, value, vlen): return _audit.audit_encode_nv_string(name, value, vlen) def audit_log_user_message(audit_fd, type, message, hostname, addr, tty, result): return _audit.audit_log_user_message(audit_fd, type, message, hostname, addr, tty, result) def audit_log_user_comm_message(audit_fd, type, message, comm, hostname, addr, tty, result): return _audit.audit_log_user_comm_message(audit_fd, type, message, comm, hostname, addr, tty, result) def audit_log_acct_message(audit_fd, type, pgname, op, name, id, host, addr, tty, result): return _audit.audit_log_acct_message(audit_fd, type, pgname, op, name, id, host, addr, tty, result) def audit_log_user_avc_message(audit_fd, type, message, hostname, addr, tty, auid): return _audit.audit_log_user_avc_message(audit_fd, type, message, hostname, addr, tty, auid) def audit_log_semanage_message(audit_fd, type, pgname, op, name, id, new_seuser, new_role, new_range, old_seuser, old_role, old_range, host, addr, tty, result): return _audit.audit_log_semanage_message(audit_fd, type, pgname, op, name, id, new_seuser, new_role, new_range, old_seuser, old_role, old_range, host, addr, tty, result) def audit_log_user_command(audit_fd, type, command, tty, result): return _audit.audit_log_user_command(audit_fd, type, command, tty, result) def audit_elf_to_machine(elf): return _audit.audit_elf_to_machine(elf) def audit_machine_to_name(machine): return _audit.audit_machine_to_name(machine) def audit_syscall_to_name(sc, machine): return _audit.audit_syscall_to_name(sc, machine) def audit_detect_machine(): return _audit.audit_detect_machine() def audit_msg_type_to_name(msg_type): return _audit.audit_msg_type_to_name(msg_type) audit-4.0.2/bindings/swig/Makefile.in0000644001034500103450000005014314655201422013123 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am -- # Copyright 2023 Red Hat Inc. # All Rights Reserved. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this program; see the file COPYING.lib. If not, write to # the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor # Boston, MA 02110-1335, USA. # # Authors: # Steve Grubb # 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@ @USE_PYTHON3_TRUE@am__append_1 = python3 subdir = bindings/swig ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prog_cc_for_build.m4 \ $(top_srcdir)/m4/cap-ng.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/src/libev/libev.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` DIST_SUBDIRS = src python3 am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILD_EXEEXT = @BUILD_EXEEXT@ BUILD_OBJEXT = @BUILD_OBJEXT@ CAPNG_LDADD = @CAPNG_LDADD@ CAPNG_PKG = @CAPNG_PKG@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_FOR_BUILD = @CC_FOR_BUILD@ CFLAGS = @CFLAGS@ CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ CPP_FOR_BUILD = @CPP_FOR_BUILD@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG = @DEBUG@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GOLANG = @GOLANG@ GOROOT = @GOROOT@ 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@ LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBWRAP_LIBS = @LIBWRAP_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PYTHON = @PYTHON@ PYTHON3_CFLAGS = @PYTHON3_CFLAGS@ PYTHON3_INCLUDES = @PYTHON3_INCLUDES@ PYTHON3_LIBS = @PYTHON3_LIBS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ VERSION = @VERSION@ WFLAGS = @WFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CC_FOR_BUILD = @ac_ct_CC_FOR_BUILD@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gss_libs = @gss_libs@ 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@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ use_python3 = @use_python3@ CONFIG_CLEAN_FILES = *.loT *.rej *.orig EXTRA_DIST = src/auditswig.i SUBDIRS = src $(am__append_1) all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu bindings/swig/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu bindings/swig/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: audit-4.0.2/bindings/swig/Makefile.am0000644001034500103450000000175514655201403013116 # Makefile.am -- # Copyright 2023 Red Hat Inc. # All Rights Reserved. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this program; see the file COPYING.lib. If not, write to # the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor # Boston, MA 02110-1335, USA. # # Authors: # Steve Grubb # CONFIG_CLEAN_FILES = *.loT *.rej *.orig EXTRA_DIST = src/auditswig.i SUBDIRS = src if USE_PYTHON3 SUBDIRS += python3 endif audit-4.0.2/bindings/swig/src/0000755001034500103450000000000014655201460011724 5audit-4.0.2/bindings/swig/src/Makefile.in0000644001034500103450000003354214655201422013716 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am -- # Copyright 2015 Red Hat Inc. # All Rights Reserved. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this program; see the file COPYING.lib. If not, write to # the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor # Boston, MA 02110-1335, USA. # # Authors: # Steve Grubb # 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@ subdir = bindings/swig/src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prog_cc_for_build.m4 \ $(top_srcdir)/m4/cap-ng.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/src/libev/libev.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILD_EXEEXT = @BUILD_EXEEXT@ BUILD_OBJEXT = @BUILD_OBJEXT@ CAPNG_LDADD = @CAPNG_LDADD@ CAPNG_PKG = @CAPNG_PKG@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_FOR_BUILD = @CC_FOR_BUILD@ CFLAGS = @CFLAGS@ CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ CPP_FOR_BUILD = @CPP_FOR_BUILD@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG = @DEBUG@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GOLANG = @GOLANG@ GOROOT = @GOROOT@ 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@ LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBWRAP_LIBS = @LIBWRAP_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PYTHON = @PYTHON@ PYTHON3_CFLAGS = @PYTHON3_CFLAGS@ PYTHON3_INCLUDES = @PYTHON3_INCLUDES@ PYTHON3_LIBS = @PYTHON3_LIBS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ VERSION = @VERSION@ WFLAGS = @WFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CC_FOR_BUILD = @ac_ct_CC_FOR_BUILD@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gss_libs = @gss_libs@ 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@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ use_python3 = @use_python3@ EXTRA_DIST = auditswig.i SWIG_SOURCES = auditswig.i CONFIG_CLEAN_FILES = *.loT *.rej *.orig all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu bindings/swig/src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu bindings/swig/src/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: audit-4.0.2/bindings/swig/src/Makefile.am0000644001034500103450000000171514655201403013701 # Makefile.am -- # Copyright 2015 Red Hat Inc. # All Rights Reserved. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this program; see the file COPYING.lib. If not, write to # the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor # Boston, MA 02110-1335, USA. # # Authors: # Steve Grubb # EXTRA_DIST = auditswig.i SWIG_SOURCES = auditswig.i CONFIG_CLEAN_FILES = *.loT *.rej *.orig audit-4.0.2/bindings/swig/src/auditswig.i0000644001034500103450000000410414655201403014012 /* Author: Dan Walsh * * Copyright (C) 2005,2006,2009,2023 Red Hat * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ %module audit %{ #include "../lib/audit_logging.h" // Have to declare these so they can be wrapped later extern int audit_elf_to_machine(unsigned int elf); extern const char *audit_machine_to_name(int machine); extern const char *audit_syscall_to_name(int sc, int machine); extern int audit_detect_machine(void); extern const char *audit_msg_type_to_name(int msg_type); %} #if defined(SWIGPYTHON) %exception audit_open { $action if (result < 0) { PyErr_SetFromErrno(PyExc_OSError); return NULL; } } #endif %define __signed__ signed %enddef #define __attribute(X) /*nothing*/ typedef unsigned __u32; typedef unsigned uid_t; /* Sidestep SWIG's limitation of handling c99 Flexible arrays by not: * generating setters against them: https://github.com/swig/swig/issues/1699 */ %ignore audit_rule_data::buf; %include "/usr/include/linux/audit.h" #define __extension__ /*nothing*/ %include %include "../lib/audit-records.h" %include "../lib/audit_logging.h" /* * These are provided especially for setroubleshooter support */ int audit_elf_to_machine(unsigned int elf); const char *audit_machine_to_name(int machine); const char *audit_syscall_to_name(int sc, int machine); int audit_detect_machine(void); const char *audit_msg_type_to_name(int msg_type); audit-4.0.2/bindings/golang/0000755001034500103450000000000014655201460011433 5audit-4.0.2/bindings/golang/audit.go0000644001034500103450000000315114655201403013005 package audit /* The audit package is a go bindings to libaudit that only allows for logging audit events. Author Steve Grubb */ // #cgo pkg-config: audit // #include "libaudit.h" // #include // #include // #include // #include import "C" import ( "unsafe" ) const ( AUDIT_VIRT_CONTROL = 2500 AUDIT_VIRT_RESOURCE = 2501 AUDIT_VIRT_MACHINE_ID = 2502 ) // type=VIRT_CONTROL msg=audit(08/05/2014 17:01:05.891:6471) : pid=1265 uid=root auid=unset ses=unset subj=system_u:system_r:virtd_t:s0-s0:c0.c1023 msg='virt=kvm op=start reason=booted vm=vm1 uuid=462dcd6d-fb68-4a26-a96f-56eb024515b9 vm-pid=22527 exe=/usr/sbin/libvirtd hostname=? addr=? terminal=? res=success' func AuditValueNeedsEncoding(str string) bool { cstr := C.CString(str) defer C.free(unsafe.Pointer(cstr)) len := C.strlen(cstr) res, _ := C.audit_value_needs_encoding(cstr, C.uint(len)) if res != 0 { return true } return false } func AuditEncodeNVString(name string, value string) string { cname := C.CString(name) cval := C.CString(value) cres := C.audit_encode_nv_string(cname, cval, 0) C.free(unsafe.Pointer(cname)) C.free(unsafe.Pointer(cval)) defer C.free(unsafe.Pointer(cres)) return C.GoString(cres) } func AuditLogUserEvent(event_type int, message string, result bool) error { var r int fd := C.audit_open() if result { r = 1 } else { r = 0 } if fd != -1 { cmsg := C.CString(message) _, err := C.audit_log_user_message(fd, C.int(event_type), cmsg, nil, nil, nil, C.int(r)) C.free(unsafe.Pointer(cmsg)) C.close(fd) return err } return nil } audit-4.0.2/bindings/golang/Makefile.in0000644001034500103450000003514314655201422013424 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am -- # Copyright 2014,16 Red Hat Inc., Durham, North Carolina. # All Rights Reserved. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this program; see the file COPYING.lib. If not, write to # the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor # Boston, MA 02110-1335, USA. # # Authors: # Steve Grubb # 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@ subdir = bindings/golang ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prog_cc_for_build.m4 \ $(top_srcdir)/m4/cap-ng.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/src/libev/libev.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(dist_check_SCRIPTS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILD_EXEEXT = @BUILD_EXEEXT@ BUILD_OBJEXT = @BUILD_OBJEXT@ CAPNG_LDADD = @CAPNG_LDADD@ CAPNG_PKG = @CAPNG_PKG@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_FOR_BUILD = @CC_FOR_BUILD@ CFLAGS = @CFLAGS@ CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ CPP_FOR_BUILD = @CPP_FOR_BUILD@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG = @DEBUG@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GOLANG = @GOLANG@ GOROOT = @GOROOT@ 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@ LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBWRAP_LIBS = @LIBWRAP_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PYTHON = @PYTHON@ PYTHON3_CFLAGS = @PYTHON3_CFLAGS@ PYTHON3_INCLUDES = @PYTHON3_INCLUDES@ PYTHON3_LIBS = @PYTHON3_LIBS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ VERSION = @VERSION@ WFLAGS = @WFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CC_FOR_BUILD = @ac_ct_CC_FOR_BUILD@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gss_libs = @gss_libs@ 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@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ use_python3 = @use_python3@ CONFIG_CLEAN_FILES = *.loT *.rej *.orig EXTRA_DIST = audit.go dist_check_SCRIPTS = test.go @HAVE_GOLANG_TRUE@LIBDIR = lib @HAVE_GOLANG_TRUE@GODIR = $(LIBDIR)/golang/src/pkg/redhat.com/audit all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu bindings/golang/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu bindings/golang/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(dist_check_SCRIPTS) check: check-am all-am: Makefile installdirs: @HAVE_GOLANG_FALSE@install: install-am install-exec: install-exec-am install-data: install-data-am @HAVE_GOLANG_FALSE@uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am .PRECIOUS: Makefile @HAVE_GOLANG_TRUE@install: @HAVE_GOLANG_TRUE@ [ -d $(DESTDIR)${prefix}/$(GODIR) ] || mkdir -p $(DESTDIR)${prefix}/$(GODIR) @HAVE_GOLANG_TRUE@ install -m 644 ${top_srcdir}/bindings/golang/audit.go $(DESTDIR)${prefix}/$(GODIR) @HAVE_GOLANG_TRUE@uninstall: @HAVE_GOLANG_TRUE@ @rm -f $(DESTDIR)${prefix}/$(GODIR)/* @HAVE_GOLANG_TRUE@check: @HAVE_GOLANG_TRUE@ @mkdir audit @HAVE_GOLANG_TRUE@ @cp ${top_srcdir}/bindings/golang/audit.go audit @HAVE_GOLANG_TRUE@ @cp ${top_srcdir}/lib/libaudit.h audit @HAVE_GOLANG_TRUE@ @rm -rf audit # 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: audit-4.0.2/bindings/golang/Makefile.am0000644001034500103450000000323414655201403013406 # Makefile.am -- # Copyright 2014,16 Red Hat Inc., Durham, North Carolina. # All Rights Reserved. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this program; see the file COPYING.lib. If not, write to # the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor # Boston, MA 02110-1335, USA. # # Authors: # Steve Grubb # CONFIG_CLEAN_FILES = *.loT *.rej *.orig EXTRA_DIST = audit.go dist_check_SCRIPTS = test.go if HAVE_GOLANG LIBDIR = lib GODIR = $(LIBDIR)/golang/src/pkg/redhat.com/audit install: [ -d $(DESTDIR)${prefix}/$(GODIR) ] || mkdir -p $(DESTDIR)${prefix}/$(GODIR) install -m 644 ${top_srcdir}/bindings/golang/audit.go $(DESTDIR)${prefix}/$(GODIR) uninstall: @rm -f $(DESTDIR)${prefix}/$(GODIR)/* check: @mkdir audit @cp ${top_srcdir}/bindings/golang/audit.go audit @cp ${top_srcdir}/lib/libaudit.h audit ## Disable for now. Golang doesn't allow overriding search ## paths from the command line. ##[ -f test.go ] || cp ${top_srcdir}/bindings/golang/test.go . ##PKG_CONFIG_PATH=${abs_top_builddir}/lib/:$(PKG_CONFIG_PATH) GOPATH=$(pwd) $(GOLANG) run test.go @rm -rf audit endif audit-4.0.2/bindings/golang/test.go0000644001034500103450000000041314655201403012654 package main import ( "./audit" "fmt" ) func main() { if audit.AuditValueNeedsEncoding("test") { fmt.Printf("Failed test 1\n") return } if !audit.AuditValueNeedsEncoding("test test") { fmt.Printf("Failed test 2\n") return } fmt.Printf("Success\n") } audit-4.0.2/bindings/Makefile.in0000644001034500103450000005005514655201422012154 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am -- # Copyright 2007,2014-16 Red Hat Inc., Durham, North Carolina. # All Rights Reserved. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this program; see the file COPYING.lib. If not, write to # the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor # Boston, MA 02110-1335, USA. # # Authors: # Steve Grubb # 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@ subdir = bindings ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prog_cc_for_build.m4 \ $(top_srcdir)/m4/cap-ng.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/src/libev/libev.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILD_EXEEXT = @BUILD_EXEEXT@ BUILD_OBJEXT = @BUILD_OBJEXT@ CAPNG_LDADD = @CAPNG_LDADD@ CAPNG_PKG = @CAPNG_PKG@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_FOR_BUILD = @CC_FOR_BUILD@ CFLAGS = @CFLAGS@ CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ CPP_FOR_BUILD = @CPP_FOR_BUILD@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG = @DEBUG@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GOLANG = @GOLANG@ GOROOT = @GOROOT@ 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@ LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBWRAP_LIBS = @LIBWRAP_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PYTHON = @PYTHON@ PYTHON3_CFLAGS = @PYTHON3_CFLAGS@ PYTHON3_INCLUDES = @PYTHON3_INCLUDES@ PYTHON3_LIBS = @PYTHON3_LIBS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ VERSION = @VERSION@ WFLAGS = @WFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CC_FOR_BUILD = @ac_ct_CC_FOR_BUILD@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gss_libs = @gss_libs@ 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@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ use_python3 = @use_python3@ CONFIG_CLEAN_FILES = *.loT *.rej *.orig SUBDIRS = python golang swig all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu bindings/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu bindings/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: audit-4.0.2/bindings/python/0000755001034500103450000000000014655201457011513 5audit-4.0.2/bindings/python/python3/0000755001034500103450000000000014655201460013111 5audit-4.0.2/bindings/python/python3/Makefile.in0000644001034500103450000006263514655201422015110 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am -- # Copyright 2015,2024 Red Hat Inc. # All Rights Reserved. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this program; see the file COPYING.lib. If not, write to # the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor # Boston, MA 02110-1335, USA. # # Authors: # Steve Grubb # 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@ subdir = bindings/python/python3 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prog_cc_for_build.m4 \ $(top_srcdir)/m4/cap-ng.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/src/libev/libev.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(pyexecdir)" LTLIBRARIES = $(pyexec_LTLIBRARIES) auparse_la_DEPENDENCIES = ${top_builddir}/auparse/libauparse.la \ ${top_builddir}/lib/libaudit.la am__dirstamp = $(am__leading_dot)dirstamp am_auparse_la_OBJECTS = \ $(top_builddir)/bindings/python/auparse_la-auparse_python.lo auparse_la_OBJECTS = $(am_auparse_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = auparse_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(auparse_la_CFLAGS) \ $(CFLAGS) $(auparse_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = $(top_builddir)/bindings/python/$(DEPDIR)/auparse_la-auparse_python.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(auparse_la_SOURCES) DIST_SOURCES = $(auparse_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILD_EXEEXT = @BUILD_EXEEXT@ BUILD_OBJEXT = @BUILD_OBJEXT@ CAPNG_LDADD = @CAPNG_LDADD@ CAPNG_PKG = @CAPNG_PKG@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_FOR_BUILD = @CC_FOR_BUILD@ CFLAGS = @CFLAGS@ CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ CPP_FOR_BUILD = @CPP_FOR_BUILD@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG = @DEBUG@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GOLANG = @GOLANG@ GOROOT = @GOROOT@ 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@ LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBWRAP_LIBS = @LIBWRAP_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PYTHON = @PYTHON@ PYTHON3_CFLAGS = @PYTHON3_CFLAGS@ PYTHON3_INCLUDES = @PYTHON3_INCLUDES@ PYTHON3_LIBS = @PYTHON3_LIBS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ VERSION = @VERSION@ WFLAGS = @WFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CC_FOR_BUILD = @ac_ct_CC_FOR_BUILD@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gss_libs = @gss_libs@ 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@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ use_python3 = @use_python3@ CONFIG_CLEAN_FILES = *.loT *.rej *.orig AM_CFLAGS = -fPIC -DPIC -fno-strict-aliasing $(PYTHON3_CFLAGS) AM_CPPFLAGS = -I$(top_builddir) $(PYTHON3_INCLUDES) pyexec_LTLIBRARIES = auparse.la auparse_la_SOURCES = $(top_srcdir)/bindings/python/auparse_python.c auparse_la_CPPFLAGS = -I$(top_srcdir)/auparse $(AM_CPPFLAGS) auparse_la_CFLAGS = -shared auparse_la_LDFLAGS = -module -avoid-version -Wl,-z,relro auparse_la_LIBADD = ${top_builddir}/auparse/libauparse.la ${top_builddir}/lib/libaudit.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu bindings/python/python3/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu bindings/python/python3/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-pyexecLTLIBRARIES: $(pyexec_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(pyexec_LTLIBRARIES)'; test -n "$(pyexecdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(pyexecdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pyexecdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pyexecdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pyexecdir)"; \ } uninstall-pyexecLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pyexec_LTLIBRARIES)'; test -n "$(pyexecdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pyexecdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pyexecdir)/$$f"; \ done clean-pyexecLTLIBRARIES: -test -z "$(pyexec_LTLIBRARIES)" || rm -f $(pyexec_LTLIBRARIES) @list='$(pyexec_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } $(top_builddir)/bindings/python/$(am__dirstamp): @$(MKDIR_P) $(top_builddir)/bindings/python @: > $(top_builddir)/bindings/python/$(am__dirstamp) $(top_builddir)/bindings/python/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) $(top_builddir)/bindings/python/$(DEPDIR) @: > $(top_builddir)/bindings/python/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/bindings/python/auparse_la-auparse_python.lo: \ $(top_builddir)/bindings/python/$(am__dirstamp) \ $(top_builddir)/bindings/python/$(DEPDIR)/$(am__dirstamp) auparse.la: $(auparse_la_OBJECTS) $(auparse_la_DEPENDENCIES) $(EXTRA_auparse_la_DEPENDENCIES) $(AM_V_CCLD)$(auparse_la_LINK) -rpath $(pyexecdir) $(auparse_la_OBJECTS) $(auparse_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f $(top_builddir)/bindings/python/*.$(OBJEXT) -rm -f $(top_builddir)/bindings/python/*.lo distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/bindings/python/$(DEPDIR)/auparse_la-auparse_python.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< $(top_builddir)/bindings/python/auparse_la-auparse_python.lo: $(top_builddir)/bindings/python/auparse_python.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(auparse_la_CPPFLAGS) $(CPPFLAGS) $(auparse_la_CFLAGS) $(CFLAGS) -MT $(top_builddir)/bindings/python/auparse_la-auparse_python.lo -MD -MP -MF $(top_builddir)/bindings/python/$(DEPDIR)/auparse_la-auparse_python.Tpo -c -o $(top_builddir)/bindings/python/auparse_la-auparse_python.lo `test -f '$(top_builddir)/bindings/python/auparse_python.c' || echo '$(srcdir)/'`$(top_builddir)/bindings/python/auparse_python.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/bindings/python/$(DEPDIR)/auparse_la-auparse_python.Tpo $(top_builddir)/bindings/python/$(DEPDIR)/auparse_la-auparse_python.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/bindings/python/auparse_python.c' object='$(top_builddir)/bindings/python/auparse_la-auparse_python.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(auparse_la_CPPFLAGS) $(CPPFLAGS) $(auparse_la_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/bindings/python/auparse_la-auparse_python.lo `test -f '$(top_builddir)/bindings/python/auparse_python.c' || echo '$(srcdir)/'`$(top_builddir)/bindings/python/auparse_python.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf $(top_builddir)/bindings/python/.libs $(top_builddir)/bindings/python/_libs -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pyexecdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(top_builddir)/bindings/python/$(DEPDIR)/$(am__dirstamp)" || rm -f $(top_builddir)/bindings/python/$(DEPDIR)/$(am__dirstamp) -test -z "$(top_builddir)/bindings/python/$(am__dirstamp)" || rm -f $(top_builddir)/bindings/python/$(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." clean: clean-am clean-am: clean-generic clean-libtool clean-pyexecLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f $(top_builddir)/bindings/python/$(DEPDIR)/auparse_la-auparse_python.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pyexecLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f $(top_builddir)/bindings/python/$(DEPDIR)/auparse_la-auparse_python.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pyexecLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-pyexecLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am \ install-pyexecLTLIBRARIES install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am \ uninstall-pyexecLTLIBRARIES .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: audit-4.0.2/bindings/python/python3/Makefile.am0000644001034500103450000000254314655201403015066 # Makefile.am -- # Copyright 2015,2024 Red Hat Inc. # All Rights Reserved. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this program; see the file COPYING.lib. If not, write to # the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor # Boston, MA 02110-1335, USA. # # Authors: # Steve Grubb # CONFIG_CLEAN_FILES = *.loT *.rej *.orig AM_CFLAGS = -fPIC -DPIC -fno-strict-aliasing $(PYTHON3_CFLAGS) AM_CPPFLAGS = -I$(top_builddir) $(PYTHON3_INCLUDES) pyexec_LTLIBRARIES = auparse.la auparse_la_SOURCES = $(top_srcdir)/bindings/python/auparse_python.c auparse_la_CPPFLAGS = -I$(top_srcdir)/auparse $(AM_CPPFLAGS) auparse_la_CFLAGS = -shared auparse_la_LDFLAGS = -module -avoid-version -Wl,-z,relro auparse_la_LIBADD = ${top_builddir}/auparse/libauparse.la ${top_builddir}/lib/libaudit.la audit-4.0.2/bindings/python/Makefile.in0000644001034500103450000004636214655201422013503 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ @USE_PYTHON3_TRUE@am__append_1 = python3 subdir = bindings/python ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prog_cc_for_build.m4 \ $(top_srcdir)/m4/cap-ng.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/src/libev/libev.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` DIST_SUBDIRS = python3 am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILD_EXEEXT = @BUILD_EXEEXT@ BUILD_OBJEXT = @BUILD_OBJEXT@ CAPNG_LDADD = @CAPNG_LDADD@ CAPNG_PKG = @CAPNG_PKG@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_FOR_BUILD = @CC_FOR_BUILD@ CFLAGS = @CFLAGS@ CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ CPP_FOR_BUILD = @CPP_FOR_BUILD@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG = @DEBUG@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GOLANG = @GOLANG@ GOROOT = @GOROOT@ 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@ LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBWRAP_LIBS = @LIBWRAP_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PYTHON = @PYTHON@ PYTHON3_CFLAGS = @PYTHON3_CFLAGS@ PYTHON3_INCLUDES = @PYTHON3_INCLUDES@ PYTHON3_LIBS = @PYTHON3_LIBS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ VERSION = @VERSION@ WFLAGS = @WFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CC_FOR_BUILD = @ac_ct_CC_FOR_BUILD@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gss_libs = @gss_libs@ 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@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ use_python3 = @use_python3@ CONFIG_CLEAN_FILES = *.loT *.rej *.orig EXTRA_DIST = auparse_python.c SUBDIRS = $(am__append_1) all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu bindings/python/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu bindings/python/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: audit-4.0.2/bindings/python/auparse_python.c0000644001034500103450000023770514655201403014645 #define PY_SSIZE_T_CLEAN #include #include "structmember.h" #include #include #include "auparse.h" /* auparse functions explicitly not exported in this binding and why: auparse_destroy: because this is handled by python object management auparse_get_time: because AuEvent provides this as an attribute auparse_get_milli: because AuEvent provides this as an attribute auparse_get_serial: because AuEvent provides this as an attribute auparse_get_node: because AuEvent provides this as an attribute auparse_timestamp_compare: because AuEvent calls this via the cmp operator */ /* * Note about function return codes. If a C function returns: * * -1 and 0, then we return exception and none respectively * -1, 0, 1, then we return exception, false, true respectively * */ #if PY_MINOR_VERSION >= 5 #define USE_RICH_COMPARISON #endif #define MODINITERROR return NULL #define PYNUM_FROMLONG PyLong_FromLong #define PYSTR_CHECK PyUnicode_Check #define PYSTR_FROMSTRING PyUnicode_FromString #define PYSTR_ASSTRING PyUnicode_AsUTF8 #define PYFILE_ASFILE(f) fdopen(PyObject_AsFileDescriptor(f), "r") int PyFile_Check(PyObject *f) { PyObject *io, *base; if (!(io = PyImport_ImportModule("io"))) { return 0; } else { if (!(base = PyObject_GetAttrString(io, "TextIOBase"))) { return 0; } else { return PyObject_IsInstance(f, base); } } } static int debug = 0; static PyObject *NoParserError = NULL; /*=========================================================================== * AuEvent *===========================================================================*/ typedef struct { PyObject_HEAD PyObject *sec; PyObject *milli; PyObject *serial; PyObject *host; au_event_t event; } AuEvent; static void AuEvent_dealloc(AuEvent* self) { Py_XDECREF(self->sec); Py_XDECREF(self->milli); Py_XDECREF(self->serial); Py_XDECREF(self->host); Py_TYPE(self)->tp_free((PyObject*)self); } #ifdef USE_RICH_COMPARISON static PyObject * AuEvent_rich_compare(PyObject *obj1, PyObject *obj2, int op) { PyObject *result = Py_False; AuEvent *au_event1 = (AuEvent *)obj1; AuEvent *au_event2 = (AuEvent *)obj2; int res = auparse_timestamp_compare(&au_event1->event, &au_event2->event); switch (op) { case Py_LT: if (res < 0) result = Py_True; break; case Py_EQ: if (res == 0) result = Py_True; break; case Py_GT: if (res > 0) result = Py_True; break; default: result = Py_NotImplemented; break; } Py_INCREF(result); return result; } #else static int AuEvent_compare(PyObject *obj1, PyObject *obj2) { AuEvent *au_event1 = (AuEvent *) obj1; AuEvent *au_event2 = (AuEvent *) obj2; return auparse_timestamp_compare(&au_event1->event, &au_event2->event); } #endif static PyObject * AuEvent_get_sec(AuEvent *self, void *closure) { if (self->sec == NULL) { if ((self->sec = PYNUM_FROMLONG(self->event.sec)) == NULL) return NULL; } Py_INCREF(self->sec); return self->sec; } static PyObject * AuEvent_get_milli(AuEvent *self, void *closure) { if (self->milli == NULL) { if ((self->milli = PYNUM_FROMLONG(self->event.milli)) == NULL) return NULL; } Py_INCREF(self->milli); return self->milli; } static PyObject * AuEvent_get_serial(AuEvent *self, void *closure) { if (self->serial == NULL) { if ((self->serial = PYNUM_FROMLONG(self->event.serial)) == NULL) return NULL; } Py_INCREF(self->serial); return self->serial; } static PyObject * AuEvent_get_host(AuEvent *self, void *closure) { if (self->event.host == NULL) { Py_RETURN_NONE; } else { if (self->host == NULL) { if ((self->host = PYSTR_FROMSTRING(self->event.host)) == NULL) return NULL; } Py_INCREF(self->host); return self->host; } } static PyGetSetDef AuEvent_getsetters[] = { {"sec", (getter)AuEvent_get_sec, (setter)NULL, "Event seconds", NULL}, {"milli", (getter)AuEvent_get_milli, (setter)NULL, "millisecond of the timestamp", NULL}, {"serial", (getter)AuEvent_get_serial, (setter)NULL, "Serial number of the event", NULL}, {"host", (getter)AuEvent_get_host, (setter)NULL, "Machine's name", NULL}, {NULL} /* Sentinel */ }; static PyMemberDef AuEvent_members[] = { {NULL} /* Sentinel */ }; static char * fmt_event(time_t seconds, unsigned int milli, unsigned long serial, const char *host) { static char buf1[200], buf2[200]; char fmt[] = "%a %b %d %H:%M:%S.%%ld %Y serial=%%ld host=%%s"; struct tm *tmp; tmp = localtime(&seconds); if (tmp == NULL) { sprintf(buf2, "localtime error"); return buf2; } if (strftime(buf1, sizeof(buf1), fmt, tmp) == 0) { sprintf(buf2, "strftime returned 0"); return buf2; } snprintf(buf2, sizeof(buf2), buf1, milli, serial, host, sizeof(buf2)); return buf2; } static PyObject * AuEvent_str(PyObject * obj) { AuEvent *event = (AuEvent *) obj; return PYSTR_FROMSTRING(fmt_event(event->event.sec, event->event.milli, event->event.serial, event->event.host)); } static PyMethodDef AuEvent_methods[] = { {NULL} /* Sentinel */ }; PyDoc_STRVAR(AuEvent_doc, "An internal object which encapsulates the timestamp, serial number\n\ and host information of an audit event. The object cannot be\n\ instantiated from python code, rather it is returned from the\n\ audit parsing API."); static PyTypeObject AuEventType = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "auparse.AuEvent", .tp_basicsize = sizeof(AuEvent), .tp_dealloc = (destructor)AuEvent_dealloc, #ifdef USE_RICH_COMPARISON .tp_richcompare = AuEvent_rich_compare, #else .tp_compare = AuEvent_compare, #endif .tp_str = AuEvent_str, .tp_flags = Py_TPFLAGS_DEFAULT, .tp_doc = AuEvent_doc, .tp_methods = AuEvent_methods, .tp_members = AuEvent_members, .tp_getset = AuEvent_getsetters, }; static PyObject * AuEvent_new_from_struct(au_event_t const *event_ptr) { AuEvent *self; self = (AuEvent *)AuEventType.tp_alloc(&AuEventType, 0); if (self != NULL) { self->event = *event_ptr; } return (PyObject *)self; } /*=========================================================================== * AuParser *===========================================================================*/ #define PARSER_CHECK \ if (self->au == NULL) { \ PyErr_SetString(NoParserError, "object has no parser associated with it"); \ return NULL; \ } typedef struct { PyObject_HEAD auparse_state_t *au; } AuParser; typedef struct { AuParser *py_AuParser; PyObject *func; PyObject *user_data; } CallbackData; void callback_data_destroy(void *user_data) { CallbackData *cb = (CallbackData *)user_data; if (debug) printf("<< callback_data_destroy\n"); if (cb) { Py_DECREF(cb->func); Py_XDECREF(cb->user_data); PyMem_Del(cb); } } /* * This function is hard coded into the python bindings for the * AuParser_add_callback function as the receiver of any callbacks. It * gets the data from auparse and builds up a python function call based * on the saved data set during the add callback. */ static void auparse_callback(auparse_state_t *au, auparse_cb_event_t cb_event_type, void *user_data) { CallbackData *cb = (CallbackData *)user_data; PyObject *arglist; PyObject *result; if (debug) printf("<< auparse_callback\n"); arglist = Py_BuildValue("OiO", cb->py_AuParser, cb_event_type, cb->user_data); #if PY_MINOR_VERSION >= 12 result = PyObject_CallObject(cb->func, arglist); #else result = PyEval_CallObject(cb->func, arglist); #endif Py_DECREF(arglist); Py_XDECREF(result); } static void AuParser_dealloc(AuParser* self) { if (debug) printf("<< AuParser_dealloc: self=%p au=%p\n", self, self->au); if (self->au != NULL) { auparse_destroy(self->au); } Py_TYPE(self)->tp_free((PyObject*)self); } static PyObject * AuParser_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { AuParser *self; self = (AuParser *)type->tp_alloc(type, 0); if (self != NULL) { self->au = NULL; } return (PyObject *)self; } /******************************** * auparse_init ********************************/ static int AuParser_init(AuParser *self, PyObject *args, PyObject *kwds) { static char *kwlist[] = {"source_type", "source", NULL}; int source_type = -1; PyObject *source=Py_None; if (self->au != NULL) { auparse_destroy(self->au); self->au = NULL; } if (! PyArg_ParseTupleAndKeywords(args, kwds, "|iO", kwlist, &source_type, &source)) return -1; switch (source_type) { case AUSOURCE_LOGS: { if (source != Py_None) { PyErr_SetString(PyExc_ValueError, "source must be None or not passed as a parameter when source_type is AUSOURCE_LOGS"); return -1; } if ((self->au = auparse_init(source_type, NULL)) == NULL) { PyErr_SetFromErrno(PyExc_IOError); return -1; } } break; case AUSOURCE_FILE: { const char *filename = NULL; if (!PYSTR_CHECK(source)) { PyErr_SetString(PyExc_ValueError, "source must be a string when source_type is AUSOURCE_FILE"); return -1; } if ((filename = PYSTR_ASSTRING(source)) == NULL) return -1; if ((self->au = auparse_init(source_type, filename)) == NULL) { PyErr_SetFromErrnoWithFilename(PyExc_IOError, filename); return -1; } } break; case AUSOURCE_FILE_ARRAY: { int i, n; PyObject *item = NULL; const char **files = NULL; if (PySequence_Check(source)) { n = PySequence_Size(source); if ((files = (const char **)PyMem_New(char *, n+1)) == NULL) { PyErr_NoMemory(); return -1; } for (i = 0; i < n; i++) { item = PySequence_GetItem(source, i); if ((files[i] = PYSTR_ASSTRING(item)) == NULL) { PyErr_SetString(PyExc_ValueError, "members of source sequence must be a string when source_type is AUSOURCE_FILE_ARRAY"); Py_DECREF(item); PyMem_Del(files); return -1; } else { Py_DECREF(item); } } files[i] = NULL; } else { PyErr_SetString(PyExc_ValueError, "source must be a sequence when source_type is AUSOURCE_FILE_ARRAY"); return -1; } if ((self->au = auparse_init(source_type, files)) == NULL) { PyErr_SetFromErrno(PyExc_IOError); PyMem_Del(files); return -1; } PyMem_Del(files); } break; case AUSOURCE_BUFFER: { const char *buf; if ((buf = PYSTR_ASSTRING(source)) == NULL) return -1; if ((self->au = auparse_init(source_type, buf)) == NULL) { PyErr_SetFromErrno(PyExc_EnvironmentError); return -1; } } break; case AUSOURCE_BUFFER_ARRAY: { int i, n; PyObject *item = NULL; const char **buffers = NULL; if (PySequence_Check(source)) { n = PySequence_Size(source); if ((buffers = (const char **)PyMem_New(char *, n+1)) == NULL) { PyErr_NoMemory(); return -1; } for (i = 0; i < n; i++) { item = PySequence_GetItem(source, i); if ((buffers[i] = PYSTR_ASSTRING(item)) == NULL) { PyErr_SetString(PyExc_ValueError, "members of source sequence must be a string when source_type is AUSOURCE_BUFFER_ARRAY"); Py_DECREF(item); PyMem_Del(buffers); return -1; } else { Py_DECREF(item); } } buffers[i] = NULL; } else { PyErr_SetString(PyExc_ValueError, "source must be a sequence when source_type is AUSOURCE_FILE_ARRAY"); return -1; } if ((self->au = auparse_init(source_type, buffers)) == NULL) { PyErr_SetFromErrno(PyExc_EnvironmentError); PyMem_Del(buffers); return -1; } PyMem_Del(buffers); } break; case AUSOURCE_DESCRIPTOR: { long fd; fd = PyObject_AsFileDescriptor(source); if (fd < 0) { PyErr_SetString(PyExc_ValueError, "source must be resolvable to a file descriptor when source_type is AUSOURCE_DESCRIPTOR"); return -1; } if ((self->au = auparse_init(source_type, (const void *)fd)) == NULL) { PyErr_SetFromErrno(PyExc_EnvironmentError); return -1; } } break; case AUSOURCE_FILE_POINTER: { FILE* fp; if (!PyFile_Check(source)) { PyErr_SetString(PyExc_ValueError, "source must be a file object when source_type is AUSOURCE_FILE_POINTER"); return -1; } if ((fp = PYFILE_ASFILE(source)) == NULL) { PyErr_SetString(PyExc_TypeError, "source must be open file when source_type is AUSOURCE_FILE_POINTER"); return -1; } #if PY_MAJOR_VERSION < 3 int fd = fileno(fp); fp = fdopen(fd, "r"); #endif if ((self->au = auparse_init(source_type, fp)) == NULL) { //char *filename = PYSTR_ASSTRING(PyFile_Name(source)); char *filename = "TODO"; PyErr_SetFromErrnoWithFilename(PyExc_IOError, filename); return -1; } } break; case AUSOURCE_FEED: { if (source != Py_None) { PyErr_SetString(PyExc_ValueError, "source must be None when source_type is AUSOURCE_FEED"); return -1; } if ((self->au = auparse_init(source_type, NULL)) == NULL) { PyErr_SetFromErrno(PyExc_EnvironmentError); return -1; } } break; default: { PyErr_SetString(PyExc_ValueError, "Invalid source type"); return -1; } break; } if (debug) printf(">> AuParser_init: self=%p au=%p\n", self, self->au); return 0; } /******************************** * auparse_feed ********************************/ PyDoc_STRVAR(feed_doc, "feed(data) supplies new data for the parser to consume.\n\ \n\ AuParser() must have been called with a source type of AUSOURCE_FEED.\n\ The parser consumes as much data as it can invoking a user supplied\n\ callback specified with add_callback() with a cb_event_type of\n\ AUPARSE_CB_EVENT_READY each time the parser recognizes a complete event\n\ in the data stream. Data not fully parsed will persist and be prepended\n\ to the next feed data. After all data has been feed to the parser flush_feed()\n\ should be called to signal the end of input data and flush any pending\n\ parse data through the parsing system.\n\ \n\ Returns None.\n\ Raises exception (EnvironmentError) on error\n\ "); static PyObject * AuParser_feed(AuParser *self, PyObject *args) { char *data; Py_ssize_t data_len; int result; if (!PyArg_ParseTuple(args, "s#:feed", &data, &data_len)) return NULL; PARSER_CHECK; if (debug) printf("<< AuParser_feed\n"); result = auparse_feed(self->au, data, data_len); if (result == 0) Py_RETURN_NONE; PyErr_SetFromErrno(PyExc_EnvironmentError); return NULL; } /******************************** * auparse_feed_age_events ********************************/ PyDoc_STRVAR(feed_age_events_doc, "feed_age_events() age events by the clock\n\ \n\ feed_age_events() should be called to timeout events by the clock.\n\ Any newly complete events will be sent to the callback function.\n\ \n\ Returns None.\n\ "); static PyObject * AuParser_feed_age_events(AuParser *self) { PARSER_CHECK; auparse_feed_age_events(self->au); Py_RETURN_NONE; } /******************************** * auparse_flush_feed ********************************/ PyDoc_STRVAR(flush_feed_doc, "flush_feed() flush any unconsumed feed data through parser\n\ \n\ flush_feed() should be called to signal the end of feed input data\n\ and flush any pending parse data through the parsing system.\n\ \n\ Returns None.\n\ Raises exception (EnvironmentError) on error\n\ "); static PyObject * AuParser_flush_feed(AuParser *self) { int result; PARSER_CHECK; result = auparse_flush_feed(self->au); if (result == 0) Py_RETURN_NONE; PyErr_SetFromErrno(PyExc_EnvironmentError); return NULL; } /******************************** * auparse_feed_has_data ********************************/ PyDoc_STRVAR(feed_has_data_doc, "feed_has_data() determines if there are any records that\n\ are accumulating but not yet ready to emit.\n\ \n\ Returns True if data left and false otherwise.\n\ "); static PyObject * AuParser_feed_has_data(AuParser *self) { PARSER_CHECK; if (auparse_feed_has_data(self->au) == 0) Py_RETURN_FALSE; Py_RETURN_TRUE; } /******************************** * auparse_feed_has_data ********************************/ PyDoc_STRVAR(feed_has_ready_event_doc, "feed_has_ready_event() determines if there are any events that are\n\ ready to emit.\n\ \n\ Returns True if event is ready and false otherwise.\n\ "); static PyObject * AuParser_feed_has_ready_event(AuParser *self) { PARSER_CHECK; if (auparse_feed_has_ready_event(self->au) == 0) Py_RETURN_FALSE; Py_RETURN_TRUE; } /******************************** * auparse_add_callback ********************************/ PyDoc_STRVAR(add_callback_doc, "add_callback(callback, user_data) add a callback handler for notifications.\n\ \n\ auparse_add_callback adds a callback function to the parse state which\n\ is invoked to notify the application of parsing events.\n\ \n\ The signature of the callback is:\n\ \n\ callback(au, cb_event_type,user_data)\n\ \n\ When the callback is invoked it is passed:\n\ au: the AuParser object\n\ cb_event_type: enumerated value indicating the reason why the callback was invoked\n\ user_data: user supplied private data\n\ \n\ The cb_event_type argument indicates why the callback was invoked.\n\ It's possible values are:\n\ \n\ AUPARSE_CB_EVENT_READY\n\ A complete event has been parsed and is ready to be examined.\n\ This is logically equivalent to the parse state immediately following\n\ auparse_next_event()\n\ \n\ Returns None.\n\ Raises exception (EnvironmentError) on error\n\ "); static PyObject * AuParser_add_callback(AuParser *self, PyObject *args) { PyObject *func; PyObject *user_data = NULL; if (!PyArg_ParseTuple(args, "O|O:add_callback", &func, &user_data)) return NULL; if (!PyFunction_Check(func)) { PyErr_SetString(PyExc_ValueError, "callback must be a function"); return NULL; } PARSER_CHECK; { /* * The way this works is that we gather up all of the pieces that * were passed to the bindings and bundle them up in a callback data * structure and register _that_ with the auparse library. This user * supplied data is then used in the callback to rebuild a python * function call which is then called. */ CallbackData *cb; cb = PyMem_New(CallbackData, 1); if (cb == NULL) return PyErr_NoMemory(); cb->py_AuParser = self; cb->func = func; /* * The second parameter to this function is optional. If it were not * passed, convert it to the None object for the python function * call later. */ if (user_data == NULL) user_data = Py_None; cb->user_data = user_data; Py_INCREF(cb->func); Py_XINCREF(cb->user_data); auparse_add_callback(self->au, auparse_callback, cb, callback_data_destroy); } Py_RETURN_NONE; } /******************************** * auparse_set_escape_mode ********************************/ PyDoc_STRVAR(set_escape_mode_doc, "set_escape_mode(mode) Set audit parser escaping\n\ \n\ This function sets the character escaping applied to value fields in the audit record.\n\ Returns None.\n\ "); static PyObject * AuParser_set_escape_mode(AuParser *self, PyObject *args) { int mode; if (!PyArg_ParseTuple(args, "i", &mode)) return NULL; auparse_set_escape_mode(self->au, mode); Py_RETURN_NONE; } /******************************** * auparse_set_eoe_timeout ********************************/ PyDoc_STRVAR(set_eoe_timeout_doc, "set_eoe_timeout(tmo) Set audit parser end of event timeout\n\ \n\ This function sets the timeout used to determine if an event is complete.\n\ Returns None.\n\ "); static PyObject * AuParser_set_eoe_timeout(AuParser *self, PyObject *args) { int tmo; if (!PyArg_ParseTuple(args, "i", &tmo)) return NULL; auparse_set_eoe_timeout(tmo); Py_RETURN_NONE; } /******************************** * auparse_reset ********************************/ PyDoc_STRVAR(reset_doc, "reset() Reset audit parser instance\n\ \n\ reset resets all internal cursors to the beginning.\n\ It closes files and descriptors.\n\ \n\ Returns None.\n\ Raises exception (EnvironmentError) on error\n\ "); static PyObject * AuParser_reset(AuParser *self) { int result; PARSER_CHECK; result = auparse_reset(self->au); if (result == 0) Py_RETURN_NONE; PyErr_SetFromErrno(PyExc_EnvironmentError); return NULL; } /******************************** * auparse_metrics ********************************/ PyDoc_STRVAR(metrics_doc, "metrics() Returns gets some basic information about auparse's internalstate.\n\ \n\ Returns a string holding metrics\n\ Raises exception (RuntimeError) on error\n\ "); static PyObject * AuParser_metrics(AuParser *self) { char *value = NULL; PARSER_CHECK; value = auparse_metrics(self->au); if (value == NULL) { PyErr_SetString(PyExc_RuntimeError, "metrics returned NULL"); return NULL; } PyObject *obj = Py_BuildValue("s", value); free(value); return obj; } /******************************** * ausearch_add_expression ********************************/ PyDoc_STRVAR(search_add_expression_doc, "search_add_expression(expression, how) Build up search expression\n\ \n\ \n\ ausearch_add_item adds an expression to the current audit search\n\ expression. The search conditions can then be used to scan logs,\n\ files, or buffers for something of interest. The expression parameter\n\ contains an expression, as specified in ausearch-expression(5).\n\ \n\ The how parameter determines how this search expression will affect the\n\ existing search expression, if one is already defined. The possible\n\ values are:\n\ \n\ AUSEARCH_RULE_CLEAR:\n\ Clear the current search expression, if any, and use only this search\n\ expression.\n\ \n\ AUSEARCH_RULE_OR:\n\ \n\ If a search expression E is already configured, replace it by\n\ (E || this_search_expression).\n\ \n\ AUSEARCH_RULE_AND:\n\ If a search expression E is already configured, replace it by\n\ (E && this_search_expression).\n\ \n\ No Return value, raises exception (EnvironmentError) on error.\n\ "); static PyObject * AuParser_search_add_expression(AuParser *self, PyObject *args) { const char *expression; char *error; int how; int result; if (!PyArg_ParseTuple(args, "si", &expression, &how)) return NULL; PARSER_CHECK; result = ausearch_add_expression(self->au, expression, &error, how); if (result == 0) Py_RETURN_NONE; if (error == NULL) PyErr_SetFromErrno(PyExc_EnvironmentError); else { PyErr_SetString(PyExc_EnvironmentError, error); free(error); } return NULL; } /******************************** * ausearch_add_item ********************************/ PyDoc_STRVAR(search_add_item_doc, "search_add_item(field, op, value, how) Build up search rule\n\ \n\ \n\ search_add_item() adds one search condition to the current audit search\n\ expression. The search conditions can then be used to scan logs, files, or\n\ buffers for something of interest. The field value is the field name\n\ that the value will be checked for. The op variable describes what\n\ kind of check is to be done. Legal op values are:\n\ \n\ 'exists':\n\ Just check that a field name exists\n\ \n\ '=':\n\ locate the field name and check that the value associated with it\n\ is equal to the value given in this rule.\n\ \n\ '!=':\n\ locate the field name and check that the value associated with\n\ it is NOT equal to the value given in this rule.\n\ \n\ The value parameter is compared to the uninterpreted field value.\n\ \n\ The how parameter determines how this search expression will affect the\n\ existing search expression, if one is already defined. The possible\n\ values are:\n\ \n\ AUSEARCH_RULE_CLEAR:\n\ Clear the current search expression, if any, and use only this search\n\ expression.\n\ \n\ AUSEARCH_RULE_OR:\n\ \n\ If a search expression E is already configured, replace it by\n\ (E || this_search_expression).\n\ \n\ AUSEARCH_RULE_AND:\n\ If a search expression E is already configured, replace it by\n\ (E && this_search_expression).\n\ \n\ No Return value, raises exception (EnvironmentError) on error.\n\ "); static PyObject * AuParser_search_add_item(AuParser *self, PyObject *args) { const char *field; const char *op; const char *value; int how; int result; if (!PyArg_ParseTuple(args, "sssi", &field, &op, &value, &how)) return NULL; PARSER_CHECK; result = ausearch_add_item(self->au, field, op, value, how); if (result == 0) Py_RETURN_NONE; PyErr_SetFromErrno(PyExc_EnvironmentError); return NULL; } /******************************** * ausearch_add_interpreted_item ********************************/ PyDoc_STRVAR(search_add_interpreted_item_doc, "search_add_interpreted_item(field, op, value, how) Build up search rule\n\ \n\ \n\ search_add_interpreted_item() adds one search condition to the current audit\n\ search expression. The search conditions can then be used to scan logs,\n\ files, or buffers for something of interest. The field value is the field\n\ name that the value will be checked for. The op variable describes what\n\ kind of check is to be done. Legal op values are:\n\ \n\ 'exists':\n\ Just check that a field name exists\n\ \n\ '=':\n\ locate the field name and check that the value associated with it\n\ is equal to the value given in this rule.\n\ \n\ '!=':\n\ locate the field name and check that the value associated with\n\ it is NOT equal to the value given in this rule.\n\ \n\ The value parameter is compared to the interpreted field value (the value\n\ that would be returned by AuParser.interpret_field).\n\ \n\ The how parameter determines how this search expression will affect the\n\ existing search expression, if one is already defined. The possible\n\ values are:\n\ \n\ AUSEARCH_RULE_CLEAR:\n\ Clear the current search expression, if any, and use only this search\n\ expression.\n\ \n\ AUSEARCH_RULE_OR:\n\ \n\ If a search expression E is already configured, replace it by\n\ (E || this_search_expression).\n\ \n\ AUSEARCH_RULE_AND:\n\ If a search expression E is already configured, replace it by\n\ (E && this_search_expression).\n\ \n\ No Return value, raises exception (EnvironmentError) on error.\n\ "); static PyObject * AuParser_search_add_interpreted_item(AuParser *self, PyObject *args) { const char *field; const char *op; const char *value; int how; int result; if (!PyArg_ParseTuple(args, "sssi", &field, &op, &value, &how)) return NULL; PARSER_CHECK; result = ausearch_add_interpreted_item(self->au, field, op, value, how); if (result == 0) Py_RETURN_NONE; PyErr_SetFromErrno(PyExc_EnvironmentError); return NULL; } /******************************** * ausearch_add_timestamp_item ********************************/ PyDoc_STRVAR(search_add_timestamp_item_doc, "search_add_timestamp_item(op, sec, milli, how) Build up search rule\n\ \n\ \n\ search_add_timestamp_item adds an event time condition to the current audit\n\ search expression. The search conditions can then be used to scan logs,\n\ files, or buffers for something of interest. The op parameter specifies the\n\ desired comparison. Legal op values are \"<\", \"<=\", \">=\", \">\" and\n\ \"=\". The left operand of the comparison operator is the timestamp of the\n\ examined event, the right operand is specified by the sec and milli\n\ parameters.\n\ \n\ The how parameter determines how this search expression will affect the\n\ existing search expression, if one is already defined. The possible\n\ values are:\n\ \n\ AUSEARCH_RULE_CLEAR:\n\ Clear the current search expression, if any, and use only this search\n\ expression.\n\ \n\ AUSEARCH_RULE_OR:\n\ \n\ If a search expression E is already configured, replace it by\n\ (E || this_search_expression).\n\ \n\ AUSEARCH_RULE_AND:\n\ If a search expression E is already configured, replace it by\n\ (E && this_search_expression).\n\ \n\ No Return value, raises exception (EnvironmentError) on error.\n\ "); static PyObject * AuParser_search_add_timestamp_item(AuParser *self, PyObject *args) { const char *op; PY_LONG_LONG sec; int milli; int how; int result; /* There's no completely portable way to handle time_t values from Python; note that time_t might even be a floating-point type! PY_LONG_LONG is at least enough not to worry about year 2038. milli is int because Python's 'I' format does no overflow checking. Negative milli values will wrap to values > 1000 and ausearch_add_timestamp_item will reject them. */ if (!PyArg_ParseTuple(args, "sLii", &op, &sec, &milli, &how)) return NULL; PARSER_CHECK; result = ausearch_add_timestamp_item(self->au, op, sec, (unsigned)milli, how); if (result == 0) Py_RETURN_NONE; PyErr_SetFromErrno(PyExc_EnvironmentError); return NULL; } /******************************** * ausearch_add_timestamp_item_ex ********************************/ PyDoc_STRVAR(search_add_timestamp_item_ex_doc, "search_add_timestamp_item_ex(op, sec, milli, serial, how) Build up search rule\n\ search_add_timestamp_item_ex adds an event time condition to the current audit\n\ search expression. Its similar to search_add_timestamp_item except it adds\n\ the event serial number.\n\ "); static PyObject * AuParser_search_add_timestamp_item_ex(AuParser *self, PyObject *args) { const char *op; PY_LONG_LONG sec; int milli; int serial; int how; int result; /* There's no completely portable way to handle time_t values from Python; note that time_t might even be a floating-point type! PY_LONG_LONG is at least enough not to worry about year 2038. milli is int because Python's 'I' format does no overflow checking. Negative milli values will wrap to values > 1000 and ausearch_add_timestamp_item will reject them. */ if (!PyArg_ParseTuple(args, "sLiiii", &op, &sec, &milli, &serial, &how)) return NULL; PARSER_CHECK; result = ausearch_add_timestamp_item_ex(self->au, op, sec, (unsigned)milli, (unsigned)serial, how); if (result == 0) Py_RETURN_NONE; PyErr_SetFromErrno(PyExc_EnvironmentError); return NULL; } /******************************** * ausearch_add_regex ********************************/ PyDoc_STRVAR(search_add_regex_doc, "search_add_regex(regexp) Add a regular expression to the search criteria.\n\ \n\ No Return value, raises exception (EnvironmentError) on error.\n\ "); static PyObject * AuParser_search_add_regex(AuParser *self, PyObject *args) { const char *regexp; int result; if (!PyArg_ParseTuple(args, "s", ®exp)) return NULL; PARSER_CHECK; result = ausearch_add_regex(self->au, regexp); if (result == 0) Py_RETURN_NONE; PyErr_SetFromErrno(PyExc_EnvironmentError); return NULL; } /******************************** * ausearch_set_stop ********************************/ PyDoc_STRVAR(search_set_stop_doc, "search_set_stop(where) Set where cursor is positioned on search match.\n\ \n\ search_set_stop() determines where the internal cursor will stop when\n\ a search condition is met. The possible values are:\n\ \n\ AUSEARCH_STOP_EVENT:\n\ This one repositions the cursors to the first field of the first\n\ record of the event containing the items searched for.\n\ \n\ AUSEARCH_STOP_RECORD:\n\ This one repositions the cursors to the first field of the record\n\ containing the items searched for.\n\ \n\ AUSEARCH_STOP_FIELD:\n\ This one simply stops on the current field when the evaluation of the\n\ rules becomes true.\n\ \n\ No Return value, raises exception (ValueError) on error.\n\ "); static PyObject * AuParser_search_set_stop(AuParser *self, PyObject *args) { int where; int result; if (!PyArg_ParseTuple(args, "i", &where)) return NULL; PARSER_CHECK; result = ausearch_set_stop(self->au, where); if (result == 0) Py_RETURN_NONE; PyErr_SetFromErrno(PyExc_ValueError); return NULL; } /******************************** * ausearch_clear ********************************/ PyDoc_STRVAR(search_clear_doc, "search_clear() Clear search parameters.\n\ \n\ ausearch_clear clears any search parameters stored in the parser\n\ instance and frees memory associated with it.\n\ \n\ No Return value.\n\ "); static PyObject * AuParser_search_clear(AuParser *self) { PARSER_CHECK; ausearch_clear(self->au); Py_RETURN_NONE; } /******************************** * ausearch_next_event ********************************/ PyDoc_STRVAR(search_next_event_doc, "search_next_event() Find the next event that meets search criteria.\n\ \n\ search_next_event() will scan the input source and evaluate whether\n\ any record in an event contains the data being searched\n\ for. Evaluation is done at the record level.\n\ \n\ Returns True if a match was found\n\ Returns False if a match was not found.\n\ \n\ Raises exception (EnvironmentError) on error\n\ "); static PyObject * AuParser_search_next_event(AuParser *self) { int result; PARSER_CHECK; result = ausearch_next_event(self->au); if (result > 0) Py_RETURN_TRUE; if (result == 0) Py_RETURN_FALSE; PyErr_SetFromErrno(PyExc_EnvironmentError); return NULL; } /******************************** * auparse_next_event ********************************/ PyDoc_STRVAR(parse_next_event_doc, "parse_next_event() Advance the parser to the next event.\n\ \n\ parse_next_event() will position the cursors at the first field of the first\n\ record of the next event in a file or buffer. It does not skip events\n\ or honor any search criteria that may be stored.\n\ \n\ Returns True if parser advances to next event.\n\ Returns False if there are no more events to parse\n\ \n\ Raises exception (EnvironmentError) on error\n\ "); static PyObject * AuParser_parse_next_event(AuParser *self) { int result; PARSER_CHECK; result = auparse_next_event(self->au); if (result > 0) Py_RETURN_TRUE; if (result == 0) Py_RETURN_FALSE; PyErr_SetFromErrno(PyExc_EnvironmentError); return NULL; } /******************************** * aup_normalize ********************************/ PyDoc_STRVAR(aup_normalize_doc, "aup_normalize(opt) Normalize the audit event for uniform access to fields.\n\ \n\ aup_normalize() takes an argument to decide if it should also gather subject\n\ and object attributes. The possible values are:\n\ \n\ NORM_OPT_ALL:\n\ This means include subject and object attributes\n\ \n\ NORM_OPT_NO_ATTRS:\n\ This means do not gather subject and object attributes\n\ \n\ Returns True on success\n\ Returns False if uninitialized\n\ \n\ Raises exception (ValueError) on error\n\ "); static PyObject * AuParser_aup_normalize(AuParser *self, PyObject *args) { int opt; int result; if (!PyArg_ParseTuple(args, "i", &opt)) return NULL; PARSER_CHECK; result = auparse_normalize(self->au, opt); if (result > 0) Py_RETURN_TRUE; if (result == 0) Py_RETURN_FALSE; PyErr_SetFromErrno(PyExc_ValueError); return NULL; } /******************************** * aup_normalize_get_event_kind ********************************/ PyDoc_STRVAR(aup_normalize_get_event_kind_doc, "aup_normalize_get_event_kind() This returns a string that indicates what\n\ kind of event this is.\n\ \n\ Raises exception (RuntimeError) on error\n\ "); static PyObject * AuParser_aup_normalize_get_event_kind(AuParser *self) { const char *kind = NULL; PARSER_CHECK; kind = auparse_normalize_get_event_kind(self->au); if (kind == NULL) { PyErr_SetString(PyExc_RuntimeError, "'event_kind' has no value"); return NULL; } return Py_BuildValue("s", kind); } /******************************** * aup_normalize_session ********************************/ PyDoc_STRVAR(aup_normalize_session_doc, "aup_normalize_session() This function positions the internal cursor on\n\ the session's field of the event.\n\ \n\ Returns True on success\n\ Returns False if uninitialized\n\ \n\ Raises exception (ValueError) on error\n\ "); static PyObject * AuParser_aup_normalize_session(AuParser *self) { int result; PARSER_CHECK; result = auparse_normalize_session(self->au); if (result > 0) Py_RETURN_TRUE; if (result == 0) Py_RETURN_FALSE; PyErr_SetFromErrno(PyExc_ValueError); return NULL; } /******************************** * aup_normalize_subject_primary ********************************/ PyDoc_STRVAR(aup_normalize_subject_primary_doc, "aup_normalize_subject_primary() This function positions the internal\n\ cursor on the subject's field of the event.\n\ \n\ Returns True on success\n\ Returns False if uninitialized\n\ \n\ Raises exception (ValueError) on error\n\ "); static PyObject * AuParser_aup_normalize_subject_primary(AuParser *self) { int result; PARSER_CHECK; result = auparse_normalize_subject_primary(self->au); if (result > 0) Py_RETURN_TRUE; if (result == 0) Py_RETURN_FALSE; PyErr_SetFromErrno(PyExc_ValueError); return NULL; } /******************************** * aup_normalize_subject_secondary ********************************/ PyDoc_STRVAR(aup_normalize_subject_secondary_doc, "aup_normalize_subject_secondary() This function positions the internal\n\ cursor on the subject's secondary field of the event.\n\ \n\ Returns True on success\n\ Returns False if uninitialized\n\ \n\ Raises exception (ValueError) on error\n\ "); static PyObject * AuParser_aup_normalize_subject_secondary(AuParser *self) { int result; PARSER_CHECK; result = auparse_normalize_subject_secondary(self->au); if (result > 0) Py_RETURN_TRUE; if (result == 0) Py_RETURN_FALSE; PyErr_SetFromErrno(PyExc_ValueError); return NULL; } /******************************** * aup_normalize_subject_first_attribute ********************************/ PyDoc_STRVAR(aup_normalize_subject_first_attribute_doc, "aup_normalize_subject_first_attribute() This function positions the internal\n\ cursor on the subject's first attribute field of the event.\n\ \n\ Returns True on success\n\ Returns False if uninitialized\n\ \n\ Raises exception (ValueError) on error\n\ "); static PyObject * AuParser_aup_normalize_subject_first_attribute(AuParser *self) { int result; PARSER_CHECK; result = auparse_normalize_subject_first_attribute(self->au); if (result > 0) Py_RETURN_TRUE; if (result == 0) Py_RETURN_FALSE; PyErr_SetFromErrno(PyExc_ValueError); return NULL; } /******************************** * aup_normalize_subject_next_attribute ********************************/ PyDoc_STRVAR(aup_normalize_subject_next_attribute_doc, "aup_normalize_subject_next_attribute() This function positions the internal\n\ cursor on the next subject's attribute field of the event.\n\ \n\ Returns True on success\n\ Returns False if uninitialized\n\ \n\ Raises exception (ValueError) on error\n\ "); static PyObject * AuParser_aup_normalize_subject_next_attribute(AuParser *self) { int result; PARSER_CHECK; result = auparse_normalize_subject_next_attribute(self->au); if (result > 0) Py_RETURN_TRUE; if (result == 0) Py_RETURN_FALSE; PyErr_SetFromErrno(PyExc_ValueError); return NULL; } /******************************** * aup_normalize_subject_kind ********************************/ PyDoc_STRVAR(aup_normalize_subject_kind_doc, "aup_normalize_subject_kind() This returns a string that indicates the\n\ kind of account the subject is.\n\ \n\ Raises exception (RuntimeError) on error\n\ "); static PyObject * AuParser_aup_normalize_subject_kind(AuParser *self) { const char *kind = NULL; PARSER_CHECK; kind = auparse_normalize_subject_kind(self->au); if (kind == NULL) { PyErr_SetString(PyExc_RuntimeError, "'subject_kind' has no value"); return NULL; } return Py_BuildValue("s", kind); } /******************************** * aup_normalize_get_action ********************************/ PyDoc_STRVAR(aup_normalize_get_action_doc, "aup_normalize_get_action() This returns a string that indicates the\n\ subject's action.\n\ \n\ Raises exception (RuntimeError) on error\n\ "); static PyObject * AuParser_aup_normalize_get_action(AuParser *self) { const char *action = NULL; PARSER_CHECK; action = auparse_normalize_get_action(self->au); if (action == NULL) { PyErr_SetString(PyExc_RuntimeError, "'action' has no value"); return NULL; } return Py_BuildValue("s", action); } /******************************** * aup_normalize_object_primary ********************************/ PyDoc_STRVAR(aup_normalize_object_primary_doc, "aup_normalize_object_primary() This function positions the internal\n\ cursor on the object's field of the event.\n\ \n\ Returns True on success\n\ Returns False if uninitialized\n\ \n\ Raises exception (ValueError) on error\n\ "); static PyObject * AuParser_aup_normalize_object_primary(AuParser *self) { int result; PARSER_CHECK; result = auparse_normalize_object_primary(self->au); if (result > 0) Py_RETURN_TRUE; if (result == 0) Py_RETURN_FALSE; PyErr_SetFromErrno(PyExc_ValueError); return NULL; } /******************************** * aup_normalize_object_secondary ********************************/ PyDoc_STRVAR(aup_normalize_object_secondary_doc, "aup_normalize_object_secondary() This function positions the internal\n\ cursor on the object's secondary field of the event.\n\ \n\ Returns True on success\n\ Returns False if uninitialized\n\ \n\ Raises exception (ValueError) on error\n\ "); static PyObject * AuParser_aup_normalize_object_secondary(AuParser *self) { int result; PARSER_CHECK; result = auparse_normalize_object_secondary(self->au); if (result > 0) Py_RETURN_TRUE; if (result == 0) Py_RETURN_FALSE; PyErr_SetFromErrno(PyExc_ValueError); return NULL; } /******************************** * aup_normalize_object_first_attribute ********************************/ PyDoc_STRVAR(aup_normalize_object_first_attribute_doc, "aup_normalize_object_first_attribute() This function positions the internal\n\ cursor on the object's first attribute field of the event.\n\ \n\ Returns True on success\n\ Returns False if uninitialized\n\ \n\ Raises exception (ValueError) on error\n\ "); static PyObject * AuParser_aup_normalize_object_first_attribute(AuParser *self) { int result; PARSER_CHECK; result = auparse_normalize_object_first_attribute(self->au); if (result > 0) Py_RETURN_TRUE; if (result == 0) Py_RETURN_FALSE; PyErr_SetFromErrno(PyExc_ValueError); return NULL; } /******************************** * aup_normalize_object_next_attribute ********************************/ PyDoc_STRVAR(aup_normalize_object_next_attribute_doc, "aup_normalize_object_next_attribute() This function positions the internal\n\ cursor on the next object's attribute field of the event.\n\ \n\ Returns True on success\n\ Returns False if uninitialized\n\ \n\ Raises exception (ValueError) on error\n\ "); static PyObject * AuParser_aup_normalize_object_next_attribute(AuParser *self) { int result; PARSER_CHECK; result = auparse_normalize_object_next_attribute(self->au); if (result > 0) Py_RETURN_TRUE; if (result == 0) Py_RETURN_FALSE; PyErr_SetFromErrno(PyExc_ValueError); return NULL; } /******************************** * aup_normalize_object_kind ********************************/ PyDoc_STRVAR(aup_normalize_object_kind_doc, "aup_normalize_object_kind() This returns a string that indicates the\n\ kind of thing the object is.\n\ \n\ Raises exception (RuntimeError) on error\n\ "); static PyObject * AuParser_aup_normalize_object_kind(AuParser *self) { const char *kind = NULL; PARSER_CHECK; kind = auparse_normalize_object_kind(self->au); if (kind == NULL) { PyErr_SetString(PyExc_RuntimeError, "'object_kind' has no value"); return NULL; } return Py_BuildValue("s", kind); } /******************************** * aup_normalize_get_results ********************************/ PyDoc_STRVAR(aup_normalize_get_results_doc, "aup_normalize_subject_primary() This function positions the internal\n\ cursor on the results field of the event.\n\ \n\ Returns True on success\n\ Returns False if uninitialized\n\ \n\ Raises exception (ValueError) on error\n\ "); static PyObject * AuParser_aup_normalize_get_results(AuParser *self) { int result; PARSER_CHECK; result = auparse_normalize_get_results(self->au); if (result > 0) Py_RETURN_TRUE; if (result == 0) Py_RETURN_FALSE; PyErr_SetFromErrno(PyExc_ValueError); return NULL; } /******************************** * aup_normalize_how ********************************/ PyDoc_STRVAR(aup_normalize_how_doc, "aup_normalize_how() This returns a string that indicates the\n\ how the object is being accessed. This is usually a program.\n\ \n\ Raises exception (RuntimeError) on error\n\ "); static PyObject * AuParser_aup_normalize_how(AuParser *self) { const char *how = NULL; PARSER_CHECK; how = auparse_normalize_how(self->au); if (how == NULL) { PyErr_SetString(PyExc_RuntimeError, "'how' has no value"); return NULL; } return Py_BuildValue("s", how); } /******************************** * aup_normalize_key ********************************/ PyDoc_STRVAR(aup_normalize_key_doc, "aup_normalize_key() This function positions the internal\n\ cursor on the key field of the event.\n\ \n\ Returns True on success\n\ Returns False if uninitialized\n\ \n\ Raises exception (ValueError) on error\n\ "); static PyObject * AuParser_aup_normalize_key(AuParser *self) { int result; PARSER_CHECK; result = auparse_normalize_key(self->au); if (result > 0) Py_RETURN_TRUE; if (result == 0) Py_RETURN_FALSE; PyErr_SetFromErrno(PyExc_ValueError); return NULL; } /******************************** * auparse_get_timestamp ********************************/ PyDoc_STRVAR(get_timestamp_doc, "get_timestamp() Return current event's timestamp.\n\ \n\ Returns the current event's timestamp info as an AuEvent object.\n\ No Return value, raises exception (EnvironmentError) on error.\n\ "); static PyObject * AuParser_get_timestamp(AuParser *self) { const au_event_t *event_ptr; PyObject *py_event; PARSER_CHECK; event_ptr = auparse_get_timestamp(self->au); if (event_ptr == NULL) { if (errno) { PyErr_SetFromErrno(PyExc_EnvironmentError); return NULL; } else { Py_RETURN_NONE; } } py_event = AuEvent_new_from_struct(event_ptr); return py_event; } /******************************** * auparse_get_num_records * ********************************/ PyDoc_STRVAR(get_num_records_doc, "get_num_records() Get the number of records.\n\ \n\ Returns the number of records in the current event.\n\ Raises exception (RuntimeError) on error.\n\ "); static PyObject * AuParser_get_num_records(AuParser *self) { int num_records; PARSER_CHECK; num_records = auparse_get_num_records(self->au); if (num_records == 0) { PyErr_SetString(PyExc_RuntimeError, "No records"); return NULL; } return Py_BuildValue("i", num_records); } /******************************** * auparse_first_record ********************************/ PyDoc_STRVAR(first_record_doc, "first_record() Reposition record cursor.\n\ \n\ first_record() repositions the internal cursors of the parsing library\n\ to point to the first record in the current event.\n\ \n\ Return True for success, False if there is no event data.\n\ Raises exception (EnvironmentError) on error.\n\ "); static PyObject * AuParser_first_record(AuParser *self) { int result; PARSER_CHECK; result = auparse_first_record(self->au); if (result > 0) Py_RETURN_TRUE; if (result == 0) Py_RETURN_FALSE; PyErr_SetFromErrno(PyExc_EnvironmentError); return NULL; } /******************************** * auparse_next_record ********************************/ PyDoc_STRVAR(next_record_doc, "next_record() Advance record cursor.\n\ \n\ next_record() will move the internal library cursors to point to the\n\ next record of the current event.\n\ \n\ Returns True on success, False if no more records in current event\n\ Raises exception (EnvironmentError) on error.\n\ "); static PyObject * AuParser_next_record(AuParser *self) { int result; PARSER_CHECK; result = auparse_next_record(self->au); if (result > 0) Py_RETURN_TRUE; if (result == 0) Py_RETURN_FALSE; PyErr_SetFromErrno(PyExc_EnvironmentError); return NULL; } /******************************** * auparse_get_record_num ********************************/ PyDoc_STRVAR(get_record_num_doc, "get_record_num() get one based record number where auparse is currently at\n\ The record numbering will reset back to 1 each time a new event is processed.\n\ Raises exception (RuntimeError) on error.\n\ "); static PyObject * AuParser_get_record_num(AuParser *self) { unsigned int value; PARSER_CHECK; value = auparse_get_record_num(self->au); if (value == 0) { PyErr_SetString(PyExc_RuntimeError, "No record number"); return NULL; } return Py_BuildValue("I", value); } /******************************** * auparse_goto_record_num ********************************/ PyDoc_STRVAR(goto_record_num_doc, "goto_record_num() Move record cursor to specific position.\n\ \n\ goto_record_num() will move the internal library cursors to point\n\ to a specific physical record number. Records within the same event are\n\ numbered starting from 0. This is generally not needed but there are\n\ some cases where one may want precise control over the exact record\n\ being looked at.\n\ \n\ Returns True on success, False if no more records in current event\n\ Raises exception (EnvironmentError) on error.\n\ "); static PyObject * AuParser_goto_record_num(AuParser *self, PyObject *args) { int result; unsigned int num; if (!PyArg_ParseTuple(args, "i", &num)) return NULL; PARSER_CHECK; result = auparse_goto_record_num(self->au, num); if (result > 0) Py_RETURN_TRUE; if (result == 0) Py_RETURN_FALSE; PyErr_SetFromErrno(PyExc_EnvironmentError); return NULL; } /******************************** * auparse_get_type ********************************/ PyDoc_STRVAR(get_type_doc, "get_type() Get record’s type.\n\ \n\ get_type() will return the integer value for the current record of the\n\ current event.\n\ \n\ Returns record type.\n\ Raises exception (LookupError) on error.\n\ "); static PyObject * AuParser_get_type(AuParser *self) { int value; PARSER_CHECK; value = auparse_get_type(self->au); if (value == 0) { PyErr_SetString(PyExc_LookupError, "Not found"); return NULL; } return Py_BuildValue("i", value); } /******************************** * auparse_get_type_name ********************************/ PyDoc_STRVAR(get_type_name_doc, "get_type_name() Get current record’s type name.\n\ \n\ get_type_name() allows access to the current record type name in the\n\ current event.\n\ \n\ Raises exception (LookupError) on error.\n\ "); static PyObject * AuParser_get_type_name(AuParser *self) { const char *name = NULL; PARSER_CHECK; name = auparse_get_type_name(self->au); if (name == NULL) { PyErr_SetString(PyExc_LookupError, "Not found"); return NULL; } return Py_BuildValue("s", name); } /******************************** * auparse_get_line_number ********************************/ PyDoc_STRVAR(get_line_number_doc, "auparse_get_line_number() get line number where record was found\n\ \n\ get_line_number will return the source input line number for\n\ the current record of the current event. Line numbers start at 1. If\n\ the source input type is AUSOURCE_FILE_ARRAY the line numbering will\n\ reset back to 1 each time a new life in the file array is opened.\n\ Raises exception (RuntimeError) on error.\n\ "); static PyObject * AuParser_get_line_number(AuParser *self) { unsigned int value; PARSER_CHECK; value = auparse_get_line_number(self->au); if (value == 0) { PyErr_SetString(PyExc_RuntimeError, "No line number"); return NULL; } return Py_BuildValue("I", value); } /******************************** * auparse_get_filename ********************************/ PyDoc_STRVAR(get_filename_doc, "auparse_get_filename() get the filename where record was found\n\ get_filename() will return the name of the source file where the\n\ record was found if the source type is AUSOURCE_FILE or\n\ AUSOURCE_FILE_ARRAY. For other source types the return value will be\n\ None.\n\ "); static PyObject * AuParser_get_filename(AuParser *self) { const char *value; PARSER_CHECK; value = auparse_get_filename(self->au); if (value == NULL) Py_RETURN_NONE; return Py_BuildValue("s", value); } /******************************** * auparse_first_field ********************************/ PyDoc_STRVAR(first_field_doc, "first_field() Reposition field cursor.\n\ \n\ Returns True on success, False if there is no event data\n\ "); static PyObject * AuParser_first_field(AuParser *self) { int result; PARSER_CHECK; result = auparse_first_field(self->au); if (result == 0) Py_RETURN_FALSE; Py_RETURN_TRUE; } /******************************** * auparse_next_field ********************************/ PyDoc_STRVAR(next_field_doc, "next_field() Advance the field cursor.\n\ \n\ next_field() moves the library’s internal cursor to point to the next\n\ field in the current record of the current event.\n\ \n\ Returns True on success, False if there is no more fields exist\n\ "); static PyObject * AuParser_next_field(AuParser *self) { int result; PARSER_CHECK; result = auparse_next_field(self->au); if (result == 0) Py_RETURN_FALSE; Py_RETURN_TRUE; } /******************************** * auparse_get_num_fields ********************************/ PyDoc_STRVAR(get_num_fields_doc, "get_num_fields() Get the number of fields.\n\ \n\ Returns the number of fields in the current event.\n\ Raises exception (EnvironmentError) on error.\n\ "); static PyObject * AuParser_get_num_fields(AuParser *self) { int num_fields; PARSER_CHECK; num_fields = auparse_get_num_fields(self->au); if (num_fields == 0) { PyErr_SetFromErrno(PyExc_EnvironmentError); return NULL; } return Py_BuildValue("i", num_fields); } /******************************** * auparse_get_record_text ********************************/ PyDoc_STRVAR(get_record_text_doc, "get_record_text() Return unparsed record data\n\ \n\ get_record_text() returns the full unparsed record.\n\ Raises exception (EnvironmentError) on error.\n\ "); static PyObject * AuParser_get_record_text(AuParser *self) { const char *text; PARSER_CHECK; text = auparse_get_record_text(self->au); if (text == NULL) { PyErr_SetFromErrno(PyExc_EnvironmentError); return NULL; } return Py_BuildValue("s", text); } /******************************** * auparse_find_field ********************************/ PyDoc_STRVAR(find_field_doc, "find_field(name) Search for field name.\n\ \n\ find_field() will scan all records in an event to find the first\n\ occurrence of the field name passed to it. Searching begins from the\n\ cursor’s current position. The field name is stored for subsequent\n\ searching.\n\ \n\ Returns value associated with field or None if not found.\n\ "); static PyObject * AuParser_find_field(AuParser *self, PyObject *args) { char *name = NULL; const char *value; if (!PyArg_ParseTuple(args, "s:find_field", &name)) return NULL; PARSER_CHECK; if ((value =auparse_find_field(self->au, name)) == NULL) { if (errno) { PyErr_SetFromErrno(PyExc_EnvironmentError); return NULL; } else { Py_RETURN_NONE; } } return Py_BuildValue("s", value); } /******************************** * auparse_find_field_next ********************************/ PyDoc_STRVAR(find_field_next_doc, "find_field_next() Get next occurrence of field name\n\ \n\ find_field_next() returns the value associated next occurrence of field name.\n\ Returns value associated with field or None if there is no next field.\n\ Raises exception (EnvironmentError) on error.\n\ "); static PyObject * AuParser_find_field_next(AuParser *self) { const char *value; PARSER_CHECK; if ((value = auparse_find_field_next(self->au)) == NULL) { if (errno) { PyErr_SetFromErrno(PyExc_EnvironmentError); return NULL; } else { Py_RETURN_NONE; } } return Py_BuildValue("s", value); } /******************************** * auparse_get_field_num ********************************/ PyDoc_STRVAR(get_field_num_doc, "get_field_num() get one based record number where auparse is currently at\n\ The record numbering will reset back to 1 each time a new event is processed.\n\ Raises exception (RuntimeError) on error.\n\ "); static PyObject * AuParser_get_field_num(AuParser *self) { unsigned int value; PARSER_CHECK; value = auparse_get_field_num(self->au); if (value == 0) { PyErr_SetString(PyExc_RuntimeError, "No field number"); return NULL; } return Py_BuildValue("I", value); } /******************************** * auparse_goto_field_num ********************************/ PyDoc_STRVAR(goto_field_num_doc, "goto_field_num() Move field cursor to specific position.\n\ \n\ goto_field_num() will move the internal library cursors to point\n\ to a specific physical field number. Fields within the same record are\n\ numbered starting from 1. This is generally not needed but there are\n\ some cases where one may want precise control over the exact field\n\ being looked at.\n\ \n\ Returns True on success, False if no more fields in current event\n\ Raises exception (EnvironmentError) on error.\n\ "); static PyObject * AuParser_goto_field_num(AuParser *self, PyObject *args) { int result; unsigned int num; if (!PyArg_ParseTuple(args, "i", &num)) return NULL; PARSER_CHECK; result = auparse_goto_field_num(self->au, num); if (result > 0) Py_RETURN_TRUE; if (result == 0) Py_RETURN_FALSE; PyErr_SetFromErrno(PyExc_EnvironmentError); return NULL; } /******************************** * auparse_get_field_name ********************************/ PyDoc_STRVAR(get_field_name_doc, "get_field_name() Get current field’s name.\n\ \n\ get_field_name() allows access to the current field name of the\n\ current record in the current event.\n\ \n\ Returns None if the field value is unavailable.\n\ Returns String.\n\ Raises exception (RuntimeError) on error\n\ "); static PyObject * AuParser_get_field_name(AuParser *self) { const char *name = NULL; PARSER_CHECK; name = auparse_get_field_name(self->au); if (name == NULL) { PyErr_SetString(PyExc_RuntimeError, "'field name' is NULL"); return NULL; } return Py_BuildValue("s", name); } /******************************** * auparse_get_field_str ********************************/ PyDoc_STRVAR(get_field_str_doc, "get_field_str() get current field’s value\n\ \n\ get_field_str() allows access to the value in the current field of the\n\ current record in the current event.\n\ \n\ Returns String.\n\ Raises exception (RuntimeError) on error\n\ "); static PyObject * AuParser_get_field_str(AuParser *self) { const char *value = NULL; PARSER_CHECK; value = auparse_get_field_str(self->au); if (value == NULL) { PyErr_SetString(PyExc_RuntimeError, "'field str' is NULL"); return NULL; } return Py_BuildValue("s", value); } /******************************** * auparse_get_field_type ********************************/ PyDoc_STRVAR(get_field_type_doc, "get_field_type() Get current field’s data type value.\n\ \n\ get_field_type() returns a value from the auparse_type_t enum that\n\ describes the kind of data in the current field of the current record\n\ in the current event.\n\ \n\ Returns AUPARSE_TYPE_UNCLASSIFIED if the field’s data type has no\n\ known description or is an integer. Otherwise it returns another enum.\n\ Fields with the type AUPARSE_TYPE_ESCAPED must be interpreted to access\n\ their value since those field’s raw value is encoded.\n\ "); static PyObject * AuParser_get_field_type(AuParser *self) { int value; PARSER_CHECK; value = auparse_get_field_type(self->au); return Py_BuildValue("i", value); } /******************************** * auparse_get_field_int ********************************/ PyDoc_STRVAR(get_field_int_doc, "get_field_int() Get current field’s value as an integer.\n\ \n\ get_field_int() allows access to the value as an int of the current\n\ field of the current record in the current event.\n\ \n\ Returns field's numeric value.\n\ Raises exception (EnvironmentError) on error\n\ "); static PyObject * AuParser_get_field_int(AuParser *self) { int value; PARSER_CHECK; value = auparse_get_field_int(self->au); if (errno == 0) return Py_BuildValue("i", value); PyErr_SetFromErrno(PyExc_EnvironmentError); return NULL; } PyDoc_STRVAR(interpret_field_doc, "interpret_field() Return an interpretation of the current field as a string that has the chosen character escaping applied.\n\ \n\ If the field cannot be interpreted the field is returned unmodified.\n\ Raises exception (RuntimeError) on error\n\ "); static PyObject * AuParser_interpret_field(AuParser *self) { const char *value = NULL; PARSER_CHECK; value = auparse_interpret_field(self->au); if (value == NULL) { PyErr_SetString(PyExc_RuntimeError, "'interpretation' is NULL"); return NULL; } return Py_BuildValue("s", value); } PyDoc_STRVAR(interpret_realpath_doc, "interpret_realpath() Return an interpretation of the current field as a realpath string that has the chosen character escaping applied.\n\ \n\ If the field cannot be interpreted the field is returned unmodified.\n\ Raises exception (RuntimeError) on error\n\ "); static PyObject * AuParser_interpret_realpath(AuParser *self) { const char *value = NULL; PARSER_CHECK; value = auparse_interpret_realpath(self->au); if (value == NULL) { PyErr_SetString(PyExc_RuntimeError, "'interpretation' is NULL"); return NULL; } return Py_BuildValue("s", value); } PyDoc_STRVAR(interpret_sock_family_doc, "interpret_sock_family() Return an interpretation of the current field's socket family. Only supported on sockaddr field types.\n\ \n\ If the field cannot be interpreted the field is returned unmodified.\n\ Raises exception (RuntimeError) on error\n\ "); static PyObject * AuParser_interpret_sock_family(AuParser *self) { const char *value = NULL; PARSER_CHECK; value = auparse_interpret_sock_family(self->au); if (value == NULL) { PyErr_SetString(PyExc_RuntimeError, "'interpretation' is NULL"); return NULL; } return Py_BuildValue("s", value); } PyDoc_STRVAR(interpret_sock_port_doc, "interpret_sock_address() Return an interpretation of the current field's socket port. Only supported on sockaddr field types.\n\ \n\ If the field cannot be interpreted the field is returned unmodified.\n\ Raises exception (RuntimeError) on error\n\ "); static PyObject * AuParser_interpret_sock_port(AuParser *self) { const char *value = NULL; PARSER_CHECK; value = auparse_interpret_sock_port(self->au); if (value == NULL) { PyErr_SetString(PyExc_RuntimeError, "'interpretation' is NULL"); return NULL; } return Py_BuildValue("s", value); } PyDoc_STRVAR(interpret_sock_address_doc, "interpret_sock_address() Return an interpretation of the current field's socket address. Only supported on sockaddr field types.\n\ \n\ If the field cannot be interpreted the field is returned unmodified.\n\ Raises exception (RuntimeError) on error\n\ "); static PyObject * AuParser_interpret_sock_address(AuParser *self) { const char *value = NULL; PARSER_CHECK; value = auparse_interpret_sock_address(self->au); if (value == NULL) { PyErr_SetString(PyExc_RuntimeError, "'interpretation' is NULL"); return NULL; } return Py_BuildValue("s", value); } static PyGetSetDef AuParser_getsetters[] = { {NULL} /* Sentinel */ }; static PyMemberDef AuParser_members[] = { {NULL} /* Sentinel */ }; static PyMethodDef AuParser_methods[] = { {"feed", (PyCFunction)AuParser_feed, METH_VARARGS, feed_doc}, {"flush_feed", (PyCFunction)AuParser_flush_feed, METH_NOARGS, flush_feed_doc}, {"feed_has_data", (PyCFunction)AuParser_feed_has_data, METH_NOARGS, feed_has_data_doc}, {"feed_has_ready_event", (PyCFunction)AuParser_feed_has_ready_event, METH_NOARGS, feed_has_ready_event_doc}, {"feed_age_events", (PyCFunction)AuParser_feed_age_events, METH_NOARGS, feed_age_events_doc}, {"add_callback", (PyCFunction)AuParser_add_callback, METH_VARARGS, add_callback_doc}, {"set_escape_mode", (PyCFunction)AuParser_set_escape_mode, METH_VARARGS, set_escape_mode_doc}, {"set_eoe_timeout", (PyCFunction)AuParser_set_eoe_timeout, METH_VARARGS, set_eoe_timeout_doc}, {"reset", (PyCFunction)AuParser_reset, METH_NOARGS, reset_doc}, {"metrics", (PyCFunction)AuParser_metrics, METH_NOARGS, metrics_doc}, {"search_add_expression", (PyCFunction)AuParser_search_add_expression, METH_VARARGS, search_add_expression_doc}, {"search_add_item", (PyCFunction)AuParser_search_add_item, METH_VARARGS, search_add_item_doc}, {"search_add_interpreted_item", (PyCFunction)AuParser_search_add_interpreted_item, METH_VARARGS, search_add_interpreted_item_doc}, {"search_add_timestamp_item", (PyCFunction)AuParser_search_add_timestamp_item, METH_VARARGS, search_add_timestamp_item_doc}, {"search_add_timestamp_item_ex", (PyCFunction)AuParser_search_add_timestamp_item_ex, METH_VARARGS, search_add_timestamp_item_ex_doc}, {"search_add_regex", (PyCFunction)AuParser_search_add_regex, METH_VARARGS, search_add_regex_doc}, {"search_set_stop", (PyCFunction)AuParser_search_set_stop, METH_VARARGS, search_set_stop_doc}, {"search_clear", (PyCFunction)AuParser_search_clear, METH_NOARGS, search_clear_doc}, {"search_next_event", (PyCFunction)AuParser_search_next_event, METH_NOARGS, search_next_event_doc}, {"parse_next_event", (PyCFunction)AuParser_parse_next_event, METH_NOARGS, parse_next_event_doc}, {"aup_normalize", (PyCFunction)AuParser_aup_normalize, METH_VARARGS, aup_normalize_doc}, {"aup_normalize_get_event_kind", (PyCFunction)AuParser_aup_normalize_get_event_kind, METH_NOARGS, aup_normalize_get_event_kind_doc}, {"aup_normalize_session", (PyCFunction)AuParser_aup_normalize_session, METH_NOARGS, aup_normalize_session_doc}, {"aup_normalize_subject_primary", (PyCFunction)AuParser_aup_normalize_subject_primary, METH_NOARGS, aup_normalize_subject_primary_doc}, {"aup_normalize_subject_secondary", (PyCFunction)AuParser_aup_normalize_subject_secondary, METH_NOARGS, aup_normalize_subject_secondary_doc}, {"aup_normalize_subject_first_attribute", (PyCFunction)AuParser_aup_normalize_subject_first_attribute, METH_NOARGS, aup_normalize_subject_first_attribute_doc}, {"aup_normalize_subject_next_attribute", (PyCFunction)AuParser_aup_normalize_subject_next_attribute, METH_NOARGS, aup_normalize_subject_next_attribute_doc}, {"aup_normalize_subject_kind", (PyCFunction)AuParser_aup_normalize_subject_kind, METH_NOARGS, aup_normalize_subject_kind_doc}, {"aup_normalize_get_action", (PyCFunction)AuParser_aup_normalize_get_action, METH_NOARGS, aup_normalize_get_action_doc}, {"aup_normalize_object_primary", (PyCFunction)AuParser_aup_normalize_object_primary, METH_NOARGS, aup_normalize_object_primary_doc}, {"aup_normalize_object_secondary", (PyCFunction)AuParser_aup_normalize_object_secondary, METH_NOARGS, aup_normalize_object_secondary_doc}, {"aup_normalize_object_first_attribute", (PyCFunction)AuParser_aup_normalize_object_first_attribute, METH_NOARGS, aup_normalize_object_first_attribute_doc}, {"aup_normalize_object_next_attribute", (PyCFunction)AuParser_aup_normalize_object_next_attribute, METH_NOARGS, aup_normalize_object_next_attribute_doc}, {"aup_normalize_object_kind", (PyCFunction)AuParser_aup_normalize_object_kind, METH_NOARGS, aup_normalize_object_kind_doc}, {"aup_normalize_get_results", (PyCFunction)AuParser_aup_normalize_get_results, METH_NOARGS, aup_normalize_get_results_doc}, {"aup_normalize_how", (PyCFunction)AuParser_aup_normalize_how, METH_NOARGS, aup_normalize_how_doc}, {"aup_normalize_key", (PyCFunction)AuParser_aup_normalize_key, METH_NOARGS, aup_normalize_key_doc}, {"get_timestamp", (PyCFunction)AuParser_get_timestamp, METH_NOARGS, get_timestamp_doc}, {"get_num_records", (PyCFunction)AuParser_get_num_records, METH_NOARGS, get_num_records_doc}, {"first_record", (PyCFunction)AuParser_first_record, METH_NOARGS, first_record_doc}, {"next_record", (PyCFunction)AuParser_next_record, METH_NOARGS, next_record_doc}, {"get_record_num", (PyCFunction)AuParser_get_record_num, METH_NOARGS, get_record_num_doc}, {"goto_record_num", (PyCFunction)AuParser_goto_record_num, METH_VARARGS, goto_record_num_doc}, {"get_type", (PyCFunction)AuParser_get_type, METH_NOARGS, get_type_doc}, {"get_type_name", (PyCFunction)AuParser_get_type_name, METH_NOARGS, get_type_name_doc}, {"get_line_number", (PyCFunction)AuParser_get_line_number, METH_NOARGS, get_line_number_doc}, {"get_filename", (PyCFunction)AuParser_get_filename, METH_NOARGS, get_filename_doc}, {"first_field", (PyCFunction)AuParser_first_field, METH_NOARGS, first_field_doc}, {"next_field", (PyCFunction)AuParser_next_field, METH_NOARGS, next_field_doc}, {"get_num_fields", (PyCFunction)AuParser_get_num_fields, METH_NOARGS, get_num_fields_doc}, {"get_record_text", (PyCFunction)AuParser_get_record_text, METH_NOARGS, get_record_text_doc}, {"find_field_next", (PyCFunction)AuParser_find_field_next, METH_NOARGS, find_field_next_doc}, {"get_field_num", (PyCFunction)AuParser_get_field_num, METH_NOARGS, get_field_num_doc}, {"goto_field_num", (PyCFunction)AuParser_goto_field_num, METH_VARARGS, goto_field_num_doc}, {"find_field", (PyCFunction)AuParser_find_field, METH_VARARGS, find_field_doc}, {"get_field_name", (PyCFunction)AuParser_get_field_name, METH_NOARGS, get_field_name_doc}, {"get_field_str", (PyCFunction)AuParser_get_field_str, METH_NOARGS, get_field_str_doc}, {"get_field_type", (PyCFunction)AuParser_get_field_type, METH_NOARGS, get_field_type_doc}, {"get_field_int", (PyCFunction)AuParser_get_field_int, METH_NOARGS, get_field_int_doc}, {"interpret_field", (PyCFunction)AuParser_interpret_field, METH_NOARGS, interpret_field_doc}, {"interpret_realpath", (PyCFunction)AuParser_interpret_realpath, METH_NOARGS, interpret_realpath_doc}, {"interpret_sock_family", (PyCFunction)AuParser_interpret_sock_family, METH_NOARGS, interpret_sock_family_doc}, {"interpret_sock_port", (PyCFunction)AuParser_interpret_sock_port, METH_NOARGS, interpret_sock_port_doc}, {"interpret_sock_address", (PyCFunction)AuParser_interpret_sock_address, METH_NOARGS, interpret_sock_address_doc}, {NULL, NULL, 0, NULL} /* Sentinel */ }; PyDoc_STRVAR(AuParser_doc, "AuParser(source_type, source)\n\ \n\ Construct a new audit parser object and bind it to input data.\n\ source_type: one of the AUSOURCE_* constants.\n\ source: the input data, dependent on the source_type as follows:\n\ \n\ AUSOURCE_LOGS: None (system log files will be parsed)\n\ AUSOURCE_FILE: string containing file path name\n\ AUSOURCE_FILE_ARRAY: list or tuple of strings each containing a file path name\n\ AUSOURCE_BUFFER: string containing audit data to parse\n\ AUSOURCE_BUFFER_ARRAY: list or tuple of strings each containing audit data to parse\n\ AUSOURCE_DESCRIPTOR: integer file descriptor (e.g. fileno)\n\ AUSOURCE_FILE_POINTER: file object (e.g. types.FileType)\n\ AUSOURCE_FEED: None (data supplied via feed()\n\ "); static PyTypeObject AuParserType = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "auparse.AuParser", .tp_basicsize = sizeof(AuParser), .tp_dealloc = (destructor)AuParser_dealloc, .tp_flags = Py_TPFLAGS_DEFAULT, .tp_doc = AuParser_doc, .tp_methods = AuParser_methods, .tp_members = AuParser_members, .tp_getset = AuParser_getsetters, .tp_init = (initproc)AuParser_init, .tp_new = AuParser_new, }; /*=========================================================================== * Module *===========================================================================*/ static PyMethodDef module_methods[] = { {NULL} /* Sentinel */ }; static struct PyModuleDef auparse_def = { PyModuleDef_HEAD_INIT, "auparse", NULL, -1, module_methods, NULL, NULL, NULL, NULL }; PyMODINIT_FUNC PyInit_auparse(void) { PyObject* m; if (PyType_Ready(&AuEventType) < 0) MODINITERROR; if (PyType_Ready(&AuParserType) < 0) MODINITERROR; m = PyModule_Create(&auparse_def); if (m == NULL) MODINITERROR; Py_INCREF(&AuParserType); PyModule_AddObject(m, "AuParser", (PyObject *)&AuParserType); Py_INCREF(&AuEventType); PyModule_AddObject(m, "AuEvent", (PyObject *)&AuEventType); /* exceptions */ NoParserError = PyErr_NewException("auparse.NoParser", NULL, NULL); Py_INCREF(NoParserError); PyModule_AddObject(m, "NoParser", NoParserError); /* ausource_t */ PyModule_AddIntConstant(m, "AUSOURCE_LOGS", AUSOURCE_LOGS); PyModule_AddIntConstant(m, "AUSOURCE_FILE", AUSOURCE_FILE); PyModule_AddIntConstant(m, "AUSOURCE_FILE_ARRAY", AUSOURCE_FILE_ARRAY); PyModule_AddIntConstant(m, "AUSOURCE_BUFFER", AUSOURCE_BUFFER); PyModule_AddIntConstant(m, "AUSOURCE_BUFFER_ARRAY", AUSOURCE_BUFFER_ARRAY); PyModule_AddIntConstant(m, "AUSOURCE_DESCRIPTOR", AUSOURCE_DESCRIPTOR); PyModule_AddIntConstant(m, "AUSOURCE_FILE_POINTER", AUSOURCE_FILE_POINTER); PyModule_AddIntConstant(m, "AUSOURCE_FEED", AUSOURCE_FEED); /* ausearch_op_t */ PyModule_AddIntConstant(m, "AUSEARCH_UNSET", AUSEARCH_UNSET); PyModule_AddIntConstant(m, "AUSEARCH_EXISTS", AUSEARCH_EXISTS); PyModule_AddIntConstant(m, "AUSEARCH_EQUAL", AUSEARCH_EQUAL); PyModule_AddIntConstant(m, "AUSEARCH_NOT_EQUAL", AUSEARCH_NOT_EQUAL); PyModule_AddIntConstant(m, "AUSEARCH_TIME_LT", AUSEARCH_TIME_LT); PyModule_AddIntConstant(m, "AUSEARCH_TIME_LE", AUSEARCH_TIME_LE); PyModule_AddIntConstant(m, "AUSEARCH_TIME_GE", AUSEARCH_TIME_GE); PyModule_AddIntConstant(m, "AUSEARCH_TIME_GT", AUSEARCH_TIME_GT); PyModule_AddIntConstant(m, "AUSEARCH_TIME_EQ", AUSEARCH_TIME_EQ); PyModule_AddIntConstant(m, "AUSEARCH_INTERPRETED", 0x40000000); /* austop_t */ PyModule_AddIntConstant(m, "AUSEARCH_STOP_EVENT", AUSEARCH_STOP_EVENT); PyModule_AddIntConstant(m, "AUSEARCH_STOP_RECORD", AUSEARCH_STOP_RECORD); PyModule_AddIntConstant(m, "AUSEARCH_STOP_FIELD", AUSEARCH_STOP_FIELD); /* normalize_option_t */ PyModule_AddIntConstant(m, "NORM_OPT_ALL", NORM_OPT_ALL); PyModule_AddIntConstant(m, "NORM_OPT_NO_ATTRS", NORM_OPT_NO_ATTRS); /* ausearch_rule_t */ PyModule_AddIntConstant(m, "AUSEARCH_RULE_CLEAR", AUSEARCH_RULE_CLEAR); PyModule_AddIntConstant(m, "AUSEARCH_RULE_OR", AUSEARCH_RULE_OR); PyModule_AddIntConstant(m, "AUSEARCH_RULE_AND", AUSEARCH_RULE_AND); PyModule_AddIntConstant(m, "AUSEARCH_RULE_REGEX", AUSEARCH_RULE_REGEX); /* auparse_cb_event_t */ PyModule_AddIntConstant(m, "AUPARSE_CB_EVENT_READY", AUPARSE_CB_EVENT_READY); /* auparse_type_t */ PyModule_AddIntConstant(m, "AUPARSE_TYPE_UNCLASSIFIED", AUPARSE_TYPE_UNCLASSIFIED); PyModule_AddIntConstant(m, "AUPARSE_TYPE_UID", AUPARSE_TYPE_UID); PyModule_AddIntConstant(m, "AUPARSE_TYPE_GID", AUPARSE_TYPE_GID); PyModule_AddIntConstant(m, "AUPARSE_TYPE_SYSCALL", AUPARSE_TYPE_SYSCALL); PyModule_AddIntConstant(m, "AUPARSE_TYPE_ARCH", AUPARSE_TYPE_ARCH); PyModule_AddIntConstant(m, "AUPARSE_TYPE_EXIT", AUPARSE_TYPE_EXIT); PyModule_AddIntConstant(m, "AUPARSE_TYPE_ESCAPED", AUPARSE_TYPE_ESCAPED); PyModule_AddIntConstant(m, "AUPARSE_TYPE_PERM", AUPARSE_TYPE_PERM); PyModule_AddIntConstant(m, "AUPARSE_TYPE_MODE", AUPARSE_TYPE_MODE); PyModule_AddIntConstant(m, "AUPARSE_TYPE_SOCKADDR", AUPARSE_TYPE_SOCKADDR); PyModule_AddIntConstant(m, "AUPARSE_TYPE_FLAGS", AUPARSE_TYPE_FLAGS); PyModule_AddIntConstant(m, "AUPARSE_TYPE_PROMISC", AUPARSE_TYPE_PROMISC); PyModule_AddIntConstant(m, "AUPARSE_TYPE_CAPABILITY", AUPARSE_TYPE_CAPABILITY); PyModule_AddIntConstant(m, "AUPARSE_TYPE_SUCCESS", AUPARSE_TYPE_SUCCESS); PyModule_AddIntConstant(m, "AUPARSE_TYPE_A0", AUPARSE_TYPE_A0); PyModule_AddIntConstant(m, "AUPARSE_TYPE_A1", AUPARSE_TYPE_A1); PyModule_AddIntConstant(m, "AUPARSE_TYPE_A2", AUPARSE_TYPE_A2); PyModule_AddIntConstant(m, "AUPARSE_TYPE_SIGNAL", AUPARSE_TYPE_SIGNAL); PyModule_AddIntConstant(m, "AUPARSE_TYPE_LIST", AUPARSE_TYPE_LIST); PyModule_AddIntConstant(m, "AUPARSE_TYPE_TTY_DATA", AUPARSE_TYPE_TTY_DATA); PyModule_AddIntConstant(m, "AUPARSE_TYPE_SESSION", AUPARSE_TYPE_SESSION); PyModule_AddIntConstant(m, "AUPARSE_TYPE_CAP_BITMAP", AUPARSE_TYPE_CAP_BITMAP); PyModule_AddIntConstant(m, "AUPARSE_TYPE_NFPROTO", AUPARSE_TYPE_NFPROTO); PyModule_AddIntConstant(m, "AUPARSE_TYPE_ICMPTYPE", AUPARSE_TYPE_ICMPTYPE); PyModule_AddIntConstant(m, "AUPARSE_TYPE_PROTOCOL", AUPARSE_TYPE_PROTOCOL); PyModule_AddIntConstant(m, "AUPARSE_TYPE_ADDR", AUPARSE_TYPE_ADDR); PyModule_AddIntConstant(m, "AUPARSE_TYPE_PERSONALITY", AUPARSE_TYPE_PERSONALITY); PyModule_AddIntConstant(m, "AUPARSE_TYPE_SECCOMP", AUPARSE_TYPE_SECCOMP); PyModule_AddIntConstant(m, "AUPARSE_TYPE_OFLAG", AUPARSE_TYPE_OFLAG); PyModule_AddIntConstant(m, "AUPARSE_TYPE_MMAP", AUPARSE_TYPE_MMAP); PyModule_AddIntConstant(m, "AUPARSE_TYPE_MODE_SHORT", AUPARSE_TYPE_MODE_SHORT); PyModule_AddIntConstant(m, "AUPARSE_TYPE_MAC_LABEL", AUPARSE_TYPE_MAC_LABEL); PyModule_AddIntConstant(m, "AUPARSE_TYPE_PROCTITLE", AUPARSE_TYPE_PROCTITLE); PyModule_AddIntConstant(m, "AUPARSE_TYPE_HOOK", AUPARSE_TYPE_HOOK); PyModule_AddIntConstant(m, "AUPARSE_TYPE_NETACTION", AUPARSE_TYPE_NETACTION); PyModule_AddIntConstant(m, "AUPARSE_TYPE_MACPROTO,", AUPARSE_TYPE_MACPROTO); PyModule_AddIntConstant(m, "AUPARSE_TYPE_IOCTL_REQ", AUPARSE_TYPE_IOCTL_REQ); PyModule_AddIntConstant(m, "AUPARSE_TYPE_ESCAPED_KEY", AUPARSE_TYPE_ESCAPED_KEY); PyModule_AddIntConstant(m, "AUPARSE_TYPE_ESCAPED_FILE", AUPARSE_TYPE_ESCAPED_FILE); PyModule_AddIntConstant(m, "AUPARSE_TYPE_FANOTIFY", AUPARSE_TYPE_FANOTIFY); PyModule_AddIntConstant(m, "AUPARSE_TYPE_NLMCGRP", AUPARSE_TYPE_NLMCGRP); PyModule_AddIntConstant(m, "AUPARSE_TYPE_RESOLVE", AUPARSE_TYPE_RESOLVE); /* Escape types */ PyModule_AddIntConstant(m, "AUPARSE_ESC_RAW", AUPARSE_ESC_RAW); PyModule_AddIntConstant(m, "AUPARSE_ESC_TTY", AUPARSE_ESC_TTY); PyModule_AddIntConstant(m, "AUPARSE_ESC_SHELL", AUPARSE_ESC_SHELL); PyModule_AddIntConstant(m, "AUPARSE_ESC_SHELL_QUOTE", AUPARSE_ESC_SHELL_QUOTE); return m; } audit-4.0.2/bindings/python/Makefile.am0000644001034500103450000000017314655201403013457 CONFIG_CLEAN_FILES = *.loT *.rej *.orig EXTRA_DIST = auparse_python.c SUBDIRS = if USE_PYTHON3 SUBDIRS += python3 endif audit-4.0.2/bindings/Makefile.am0000644001034500103450000000172714655201403012144 # Makefile.am -- # Copyright 2007,2014-16 Red Hat Inc., Durham, North Carolina. # All Rights Reserved. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this program; see the file COPYING.lib. If not, write to # the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor # Boston, MA 02110-1335, USA. # # Authors: # Steve Grubb # CONFIG_CLEAN_FILES = *.loT *.rej *.orig SUBDIRS = python golang swig audit-4.0.2/missing0000755001034500103450000001533614655201422007714 #! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1996-2021 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=https://www.perl.org/ flex_URL=https://github.com/westes/flex gnu_software_URL=https://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: audit-4.0.2/auparse/0000755001034500103450000000000014655201457010035 5audit-4.0.2/auparse/expression.h0000644001034500103450000001066414655201403012323 /* * expression.h - Expression parsing and handling * Copyright (C) 2008,2014 Red Hat Inc., Durham, North Carolina. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Miloslav Trmač * Steve Grubb extended timestamp */ #ifndef EXPRESSION_H__ #define EXPRESSION_H__ #include #include #include "internal.h" enum { EO_NOT, /* Uses v.sub[0] */ EO_AND, EO_OR, /* Uses v.sub[0] and v.sub[1] */ /* All of the following use v.p */ EO_RAW_EQ, EO_RAW_NE, EO_INTERPRETED_EQ, EO_INTERPRETED_NE, EO_VALUE_EQ, EO_VALUE_NE, EO_VALUE_LT, EO_VALUE_LE, EO_VALUE_GT, EO_VALUE_GE, /* Uses v.p.field. Cannot be specified by an expression. */ EO_FIELD_EXISTS, EO_REGEXP_MATCHES, /* Uses v.regexp */ NUM_EO_VALUES, }; enum field_id { EF_TIMESTAMP, EF_RECORD_TYPE, EF_TIMESTAMP_EX }; struct expr { unsigned op : 8; /* EO_* */ unsigned virtual_field : 1; /* Can be non-zero only if virtual_field != 0 */ unsigned precomputed_value : 1; /* Decides if >= > < <= applies to field */ unsigned numeric_field : 1; unsigned started : 1; union { struct expr *sub[2]; struct { union { char *name; enum field_id id; /* If virtual_field != 0 */ } field; union { char *string; /* A member from the following is selected implicitly by field.id. */ struct { time_t sec; unsigned int milli; } timestamp; /* EF_TIMESTAMP */ struct { time_t sec; unsigned milli; unsigned serial; } timestamp_ex; /* EF_TIMESTAMP_EX */ int int_value; /* EF_RECORD_TYPE */ } value; uint32_t unsigned_val; /* UID & GID */ } p; regex_t *regexp; } v; }; AUDIT_HIDDEN_START /* Free EXPR and all its subexpressions. */ void expr_free(struct expr *expr); /* Parse STRING. On success, return the parsed expression tree. On error, set *ERROR to an error string (for free()) or NULL, and return NULL. (*ERROR == NULL is allowed to handle out-of-memory errors) */ struct expr *expr_parse(const char *string, char **error); /* Create a comparison-expression for FIELD, OP and VALUE. On success, return the created expression. On error, set errno and return NULL. */ struct expr *expr_create_comparison(const char *field, unsigned op, const char *value); /* Create a timestamp comparison-expression for with OP, SEC, MILLI. On success, return the created expression. On error, set errno and return NULL. */ struct expr *expr_create_timestamp_comparison(unsigned op, time_t sec, unsigned milli); /* Create an extended timestamp comparison-expression for with OP, SEC, MILLI, and SERIAL. On success, return the created expression. On error, set errno and return NULL. */ struct expr *expr_create_timestamp_comparison_ex(unsigned op, time_t sec, unsigned milli, unsigned serial); /* Create an EO_FIELD_EXISTS-expression for FIELD. On success, return the created expression. On error, set errno and return NULL. */ struct expr *expr_create_field_exists(const char *field); /* Create a \regexp expression for regexp comparison. On success, return the created expression. On error, set errno and return NULL. */ struct expr *expr_create_regexp_expression(const char *regexp); /* Create a binary expression for OP and subexpressions E1 and E2. On success, return the created expression. On error, set errno and return NULL. */ struct expr *expr_create_binary(unsigned op, struct expr *e1, struct expr *e2); /* Evaluate EXPR on RECORD in AU->le. Return 1 if EXPR is true, 0 if it false or if it fails. (No error reporting facility is provided; an invalid term is considered to be false; e.g. !invalid is true.) */ int expr_eval(auparse_state_t *au, rnode *record, const struct expr *expr); AUDIT_HIDDEN_END #endif audit-4.0.2/auparse/umounttab.h0000644001034500103450000000205314655201403012133 /* umounttab.h -- * Copyright 2013 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb * Location: include/linux/fs.h */ _S(0x00000001, "MNT_FORCE" ) _S(0x00000002, "MNT_DETACH" ) _S(0x00000004, "MNT_EXPIRE" ) _S(0x00000008, "UMOUNT_NOFOLLOW" ) _S(0x80000000, "UMOUNT_UNUSED" ) audit-4.0.2/auparse/auparse.h0000644001034500103450000001652114655201403011562 /* auparse.h -- * Copyright 2006-08,2012-23 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; see the file COPYING. If not, write to the * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor * Boston, MA 02110-1335, USA. * * Authors: * Steve Grubb */ #ifndef AUPARSE_HEADER #define AUPARSE_HEADER #include "auparse-defs.h" #ifndef __attr_access # define __attr_access(x) #endif #ifndef __attr_dealloc # define __attr_dealloc(dealloc, argno) # define __attr_dealloc_free #endif #ifndef __attribute_malloc__ # define __attribute_malloc__ #endif #ifdef __cplusplus extern "C" { #endif /* Library type definitions */ /* opaque data type used for maintaining library state */ typedef struct opaque auparse_state_t; typedef void (*user_destroy)(void *user_data); typedef void (*auparse_callback_ptr)(auparse_state_t *au, auparse_cb_event_t cb_event_type, void *user_data); /* General functions that affect operation of the library */ void auparse_destroy(auparse_state_t *au); void auparse_destroy_ext(auparse_state_t *au, auparse_destroy_what_t what); auparse_state_t *auparse_init(ausource_t source, const void *b) __attribute_malloc__ __attr_dealloc (auparse_destroy, 1); int auparse_new_buffer(auparse_state_t *au, const char *data, size_t data_len) __attr_access ((__read_only__, 2, 3)); int auparse_feed(auparse_state_t *au, const char *data, size_t data_len) __attr_access ((__read_only__, 2, 3)); void auparse_feed_age_events(auparse_state_t *au); int auparse_flush_feed(auparse_state_t *au); int auparse_feed_has_data(const auparse_state_t *au); int auparse_feed_has_ready_event(auparse_state_t *au); void auparse_add_callback(auparse_state_t *au, auparse_callback_ptr callback, void *user_data, user_destroy user_destroy_func); void auparse_set_escape_mode(auparse_state_t *au, auparse_esc_t mode); int auparse_reset(auparse_state_t *au); char *auparse_metrics(const auparse_state_t *au) __attr_dealloc_free; /* Functions that are part of the search interface */ int ausearch_add_expression(auparse_state_t *au, const char *expression, char **error, ausearch_rule_t how); int ausearch_add_item(auparse_state_t *au, const char *field, const char *op, const char *value, ausearch_rule_t how); int ausearch_add_interpreted_item(auparse_state_t *au, const char *field, const char *op, const char *value, ausearch_rule_t how); int ausearch_add_timestamp_item(auparse_state_t *au, const char *op, time_t sec, unsigned milli, ausearch_rule_t how); int ausearch_add_timestamp_item_ex(auparse_state_t *au, const char *op, time_t sec, unsigned milli, unsigned serial, ausearch_rule_t how); int ausearch_add_regex(auparse_state_t *au, const char *regexp); int ausearch_set_stop(auparse_state_t *au, austop_t where); void ausearch_clear(auparse_state_t *au); /* Function dealing with setting user space configuration items */ int auparse_set_eoe_timeout (time_t new_tmo); /* Functions that are part of the auparse_normalize interface */ // This causes the current event to become normalized. int auparse_normalize(auparse_state_t *au, normalize_option_t opt); // Event kind accessor const char *auparse_normalize_get_event_kind(const auparse_state_t *au); // session accessor int auparse_normalize_session(auparse_state_t *au); // Subject accessing functions int auparse_normalize_subject_primary(auparse_state_t *au); int auparse_normalize_subject_secondary(auparse_state_t *au); const char *auparse_normalize_subject_kind(const auparse_state_t *au); int auparse_normalize_subject_first_attribute(auparse_state_t *au); int auparse_normalize_subject_next_attribute(auparse_state_t *au); // Action string accessor const char *auparse_normalize_get_action(const auparse_state_t *au); // Object accessing functions int auparse_normalize_object_primary(auparse_state_t *au); int auparse_normalize_object_secondary(auparse_state_t *au); int auparse_normalize_object_primary2(auparse_state_t *au); int auparse_normalize_object_first_attribute(auparse_state_t *au); int auparse_normalize_object_next_attribute(auparse_state_t *au); const char *auparse_normalize_object_kind(const auparse_state_t *au); // Results accessor int auparse_normalize_get_results(auparse_state_t *au); // How accessor const char *auparse_normalize_how(const auparse_state_t *au); // Syscall key accessor int auparse_normalize_key(auparse_state_t *au); /* Functions that traverse events */ int ausearch_next_event(auparse_state_t *au); int ausearch_cur_event(auparse_state_t* au); int auparse_next_event(auparse_state_t *au); /* Accessors to event data */ const au_event_t *auparse_get_timestamp(const auparse_state_t *au); time_t auparse_get_time(const auparse_state_t *au); unsigned int auparse_get_milli(const auparse_state_t *au); unsigned long auparse_get_serial(const auparse_state_t *au); const char *auparse_get_node(const auparse_state_t *au) __attr_dealloc_free; int auparse_node_compare(const au_event_t *e1, const au_event_t *e2); int auparse_timestamp_compare(const au_event_t *e1, const au_event_t *e2); unsigned int auparse_get_num_records(const auparse_state_t *au); /* Functions that traverse records in the same event */ int auparse_first_record(auparse_state_t *au); int auparse_next_record(auparse_state_t *au); unsigned int auparse_get_record_num(const auparse_state_t *au); int auparse_goto_record_num(const auparse_state_t *au, unsigned int num); /* Accessors to record data */ int auparse_get_type(const auparse_state_t *au); const char *auparse_get_type_name(const auparse_state_t *au); unsigned int auparse_get_line_number(const auparse_state_t *au); const char *auparse_get_filename(const auparse_state_t *au); int auparse_first_field(const auparse_state_t *au); int auparse_next_field(const auparse_state_t *au); unsigned int auparse_get_num_fields(const auparse_state_t *au); const char *auparse_get_record_text(const auparse_state_t *au); const char *auparse_get_record_interpretations(const auparse_state_t *au); const char *auparse_find_field(auparse_state_t *au, const char *name); const char *auparse_find_field_next(const auparse_state_t *au); unsigned int auparse_get_field_num(const auparse_state_t *au); int auparse_goto_field_num(const auparse_state_t *au, unsigned int num); /* Accessors to field data */ const char *auparse_get_field_name(const auparse_state_t *au); const char *auparse_get_field_str(const auparse_state_t *au); int auparse_get_field_type(const auparse_state_t *au); int auparse_get_field_int(const auparse_state_t *au); const char *auparse_interpret_field(auparse_state_t *au); const char *auparse_interpret_realpath(const auparse_state_t *au); const char *auparse_interpret_sock_family(auparse_state_t *au); const char *auparse_interpret_sock_port(auparse_state_t *au); const char *auparse_interpret_sock_address(auparse_state_t *au); #ifdef __cplusplus } #endif #endif audit-4.0.2/auparse/schedtab.h0000644001034500103450000000202514655201403011671 /* schedtab.h -- * Copyright 2013-14 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb * Location: include/uapi/linux/sched.h */ _S(0, "SCHED_OTHER" ) _S(1, "SCHED_FIFO" ) _S(2, "SCHED_RR" ) _S(3, "SCHED_BATCH" ) _S(5, "SCHED_IDLE" ) _S(6, "SCHED_DEADLINE") audit-4.0.2/auparse/normalize_syscall_map.h0000644001034500103450000001040714655201403014506 /* * normalize_syscall_map.h * Copyright (c) 2016-17,2021-24 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; see the file COPYING. If not, write to the * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor * Boston, MA 02110-1335, USA. * * Authors: * Steve Grubb */ #include "normalize-internal.h" _S(NORM_FILE_STAT, "access") _S(NORM_FILE_STAT, "faccessat") _S(NORM_FILE_STAT, "faccessat2") _S(NORM_FILE_CHPERM, "chmod") _S(NORM_FILE_CHPERM, "fchmod") _S(NORM_FILE_CHPERM, "fchmodat") _S(NORM_FILE_CHPERM, "fchmodat2") _S(NORM_FILE_CHOWN, "chown") _S(NORM_FILE_CHOWN, "fchown") _S(NORM_FILE_CHOWN, "fchownat") _S(NORM_FILE_CHOWN, "fchownat2") _S(NORM_FILE_CHOWN, "lchown") _S(NORM_FILE_LDMOD, "finit_module") _S(NORM_FILE_LDMOD, "init_module") _S(NORM_FILE_UNLDMOD, "delete_module") _S(NORM_FILE_CHATTR, "setxattr") _S(NORM_FILE_CHATTR, "fsetxattr") _S(NORM_FILE_CHATTR, "lsetxattr") _S(NORM_FILE_CHATTR, "mount_setattr") _S(NORM_FILE_DIR, "mkdir") _S(NORM_FILE_DIR, "mkdirat") _S(NORM_FILE_MOUNT, "fsconfig") _S(NORM_FILE_MOUNT, "fsmount") _S(NORM_FILE_MOUNT, "fsopen") _S(NORM_FILE_MOUNT, "fspick") _S(NORM_FILE_MOUNT, "mount") _S(NORM_FILE_MOUNT, "move_mount") _S(NORM_FILE_STAT, "newfstatat") _S(NORM_FILE_STAT, "stat") _S(NORM_FILE_STAT, "fstat") _S(NORM_FILE_STAT, "lstat") _S(NORM_FILE_STAT, "stat64") _S(NORM_FILE_STAT, "statx") _S(NORM_FILE_SYS_STAT, "statfs") _S(NORM_FILE_SYS_STAT, "fstatfs") _S(NORM_FILE_SYS_STAT, "statmount") _S(NORM_FILE, "creat") _S(NORM_FILE, "fallocate") _S(NORM_FILE, "truncate") _S(NORM_FILE, "ftruncate") _S(NORM_FILE, "memfd_create") _S(NORM_FILE, "memfd_secret") _S(NORM_FILE, "open") _S(NORM_FILE, "openat") _S(NORM_FILE, "openat2") _S(NORM_FILE, "readlink") _S(NORM_FILE, "readlinkat") _S(NORM_FILE, "open_by_handle_at") _S(NORM_FILE, "pidfd_getfd") _S(NORM_FILE_CHATTR, "removexattr") _S(NORM_FILE_CHATTR, "fremovexattr") _S(NORM_FILE_CHATTR, "lremovexattr") _S(NORM_FILE_RENAME, "rename") _S(NORM_FILE_RENAME, "renameat") _S(NORM_FILE_RENAME, "renameat2") _S(NORM_FILE_DEL, "rmdir") _S(NORM_FILE_LNK, "symlink") _S(NORM_FILE_LNK, "symlinkat") _S(NORM_FILE_UMNT, "umount") _S(NORM_FILE_UMNT, "umount2") _S(NORM_FILE_DEL, "unlink") _S(NORM_FILE_DEL, "unlinkat") _S(NORM_FILE_TIME, "utime") _S(NORM_FILE_TIME, "utimes") _S(NORM_FILE_TIME, "futimesat") _S(NORM_FILE_TIME, "utimensat") _S(NORM_EXEC, "execve") _S(NORM_EXEC, "execveat") _S(NORM_SOCKET_ACCEPT, "accept") _S(NORM_SOCKET_ACCEPT, "accept4") _S(NORM_SOCKET_BIND, "bind") _S(NORM_SOCKET_CONN, "connect") _S(NORM_SOCKET_RECV, "recvfrom") _S(NORM_SOCKET_RECV, "recvmsg") _S(NORM_SOCKET_SEND, "sendmsg") _S(NORM_SOCKET_SEND, "sendto") _S(NORM_PID, "kill") _S(NORM_PID, "tkill") _S(NORM_PID, "tgkill") _S(NORM_UID, "setuid") _S(NORM_UID, "seteuid") _S(NORM_UID, "setfsuid") _S(NORM_UID, "setreuid") _S(NORM_UID, "setresuid") _S(NORM_GID, "setgid") _S(NORM_GID, "setegid") _S(NORM_GID, "setfsgid") _S(NORM_GID, "setregid") _S(NORM_GID, "setresgid") _S(NORM_SYSTEM_TIME, "settimeofday") _S(NORM_SYSTEM_TIME, "clock_settime") _S(NORM_SYSTEM_TIME, "clock_settime64") _S(NORM_SYSTEM_TIME, "stime") _S(NORM_SYSTEM_TIME, "adjtimex") _S(NORM_MAKE_DEV, "mknod") _S(NORM_MAKE_DEV, "mknodat") _S(NORM_SYSTEM_NAME, "sethostname") _S(NORM_SYSTEM_NAME, "setdomainname") _S(NORM_SYSTEM_MEMORY, "mmap") _S(NORM_SYSTEM_MEMORY, "brk") _S(NORM_SYSTEM_MEMORY, "map_shadow_stack") _S(NORM_SCHEDULER, "sched_setparam") _S(NORM_SCHEDULER, "sched_setscheduler") _S(NORM_SCHEDULER, "sched_setattr") _S(NORM_SECURITY_POLICY, "landlock_create_ruleset") _S(NORM_SECURITY_POLICY, "landlock_add_rule") _S(NORM_SECURITY_POLICY, "landlock_restrict_self") _S(NORM_SECURITY_POLICY, "lsm_set_self_attr") _S(NORM_SECURITY_POLICY, "mseal") audit-4.0.2/auparse/mmaptab.h0000644001034500103450000000277314655201403011547 /* mmaptab.h -- * Copyright 2012-13,2018,2020 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb * Location: include/uapi/asm-generic/mman-common.h * 0x0100 - 0x4000 flags are defined in include/uapi/asm-generic/mman.h */ _S(0x0000001, "MAP_SHARED" ) _S(0x0000002, "MAP_PRIVATE" ) _S(0x0000010, "MAP_FIXED" ) _S(0x0000020, "MAP_ANONYMOUS" ) _S(0x0000040, "MAP_32BIT" ) _S(0x0000100, "MAP_GROWSDOWN" ) _S(0x0000800, "MAP_DENYWRITE" ) _S(0x0001000, "MAP_EXECUTABLE" ) _S(0x0002000, "MAP_LOCKED" ) _S(0x0004000, "MAP_NORESERVE" ) _S(0x0008000, "MAP_POPULATE" ) _S(0x0010000, "MAP_NONBLOCK" ) _S(0x0020000, "MAP_STACK" ) _S(0x0040000, "MAP_HUGETLB" ) _S(0x0080000, "MAP_SYNC" ) _S(0x0100000, "MAP_FIXED_NOREPLACE") _S(0x4000000, "MAP_UNINITIALIZED") audit-4.0.2/auparse/shm_modetab.h0000644001034500103450000000204314655201403012376 /* shm_mode.h -- * Copyright 2013 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb * Location: include/linux/shm.h * include/uapi/linux/shm.h */ _S(00001000, "SHM_DEST" ) _S(00002000, "SHM_LOCKED" ) _S(00004000, "SHM_HUGETLB" ) _S(00010000, "SHM_NORESERVE" ) audit-4.0.2/auparse/private.h0000644001034500103450000000261214655201403011570 /* private.h -- * Copyright 2007,2013,2016 Red Hat Inc., Durham, North Carolina. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb */ #ifndef _PRIVATE_H_ #define _PRIVATE_H_ #include "auparse.h" #include "libaudit.h" #include "dso.h" AUDIT_HIDDEN_START /* Internal syslog messaging */ #define audit_msg auparse_msg #define set_aumessage_mode set_aup_message_mode void auparse_msg(const auparse_state_t *au, int priority, const char *fmt, ...) #ifdef __GNUC__ __attribute__ ((format (printf, 3, 4))); #else ; #endif void set_aup_message_mode(auparse_state_t *au, message_t mode, debug_message_t debug); AUDIT_HIDDEN_END #endif audit-4.0.2/auparse/normalize.c0000644001034500103450000015544214655201403012123 /* normalize.c -- * Copyright 2016-18,2021 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb */ #include #include #include #include #include #include #include "libaudit.h" #include "auparse.h" #include "internal.h" #include "normalize-llist.h" #include "normalize-internal.h" #include "gen_tables.h" #include "normalize_record_maps.h" #include "normalize_syscall_maps.h" #include "normalize_obj_kind_maps.h" #include "normalize_evtypetabs.h" /* * Field accessors. x is the new value, y is the variable * Layout is: 0xFFFF FFFF where first is record and second is field * Both record and field are 0 based. Simple records are always 0. Compound * records start at 0 and go up. */ #define UNSET 0xFFFFU #define get_record(y) ((y >> 16) & 0x0000FFFFU) #define set_record(y, x) (((x & 0x0000FFFFU) << 16) | (y & 0x0000FFFFU)) #define get_field(y) (y & 0x0000FFFFU) #define set_field(y, x) ((y & 0xFFFF0000U) | (x & 0x0000FFFFU)) #define is_unset(y) (get_record(y) == UNSET) #define D au->norm_data static int syscall_success; static value_t find_simple_object(auparse_state_t *au, int type); void init_normalizer(normalize_data *d) { d->evkind = NULL; d->session = set_record(0, UNSET); d->actor.primary = set_record(0, UNSET); d->actor.secondary = set_record(0, UNSET); d->actor.what = NULL; cllist_create(&d->actor.attr, NULL); d->action = NULL; d->thing.primary = set_record(0, UNSET); d->thing.secondary = set_record(0, UNSET); d->thing.two = set_record(0, UNSET); cllist_create(&d->thing.attr, NULL); d->thing.what = NORM_WHAT_UNKNOWN; d->results = set_record(0, UNSET); d->how = NULL; d->opt = NORM_OPT_ALL; d->key = set_record(0, UNSET); syscall_success = -1; } void clear_normalizer(normalize_data *d) { d->evkind = NULL; d->session = set_record(0, UNSET); d->actor.primary = set_record(0, UNSET); d->actor.secondary = set_record(0, UNSET); free((void *)d->actor.what); d->actor.what = NULL; cllist_clear(&d->actor.attr); free((void *)d->action); d->action = NULL; d->thing.primary = set_record(0, UNSET); d->thing.secondary = set_record(0, UNSET); d->thing.two = set_record(0, UNSET); cllist_clear(&d->thing.attr); d->thing.what = NORM_WHAT_UNKNOWN; d->results = set_record(0, UNSET); free((void *)d->how); d->how = NULL; d->opt = NORM_OPT_ALL; d->key = set_record(0, UNSET); syscall_success = -1; } static void set_system_subject_what(auparse_state_t *au) { D.actor.what = strdup("system"); } static void set_unknown_subject_what(auparse_state_t *au) { D.actor.what = strdup("unknown-acct"); } static unsigned int set_subject_what(auparse_state_t *au) { int uid = NORM_ACCT_UNSET - 1; int ftype = auparse_get_field_type(au); if (ftype == AUPARSE_TYPE_UID) uid = auparse_get_field_int(au); else { const char *n = auparse_get_field_name(au); if (n && strcmp(n, "acct") == 0) { const char *acct = auparse_interpret_field(au); if (acct) { // FIXME: Make this a LRU item struct passwd *pw = getpwnam(acct); if (pw) { uid = pw->pw_uid; goto check; } } } set_unknown_subject_what(au); return 1; } check: if (uid == NORM_ACCT_PRIV) D.actor.what = strdup("privileged-acct"); else if ((unsigned)uid == NORM_ACCT_UNSET) D.actor.what = strdup("unset-acct"); else if (uid < NORM_ACCT_MAX_SYS) D.actor.what = strdup("service-acct"); else if (uid < NORM_ACCT_MAX_USER) D.actor.what = strdup("user-acct"); else set_unknown_subject_what(au); return 0; } static unsigned int set_prime_subject(auparse_state_t *au, const char *str, unsigned int rnum) { if (auparse_find_field(au, str)) { D.actor.primary = set_record(0, rnum); D.actor.primary = set_field(D.actor.primary, auparse_get_field_num(au)); return 0; } return 1; } static unsigned int set_secondary_subject(auparse_state_t *au, const char *str, unsigned int rnum) { if (auparse_find_field(au, str)) { D.actor.secondary = set_record(0, rnum); D.actor.secondary = set_field(D.actor.secondary, auparse_get_field_num(au)); return set_subject_what(au); } return 1; } static unsigned int add_subj_attr(auparse_state_t *au, const char *str, unsigned int rnum) { value_t attr; if ((auparse_find_field(au, str))) { attr = set_record(0, rnum); attr = set_field(attr, auparse_get_field_num(au)); if (cllist_append(&D.actor.attr, attr, NULL)) return 1; return 0; } else auparse_goto_record_num(au, rnum); return 1; } static unsigned int set_prime_object(auparse_state_t *au, const char *str, unsigned int rnum) { if (auparse_find_field(au, str)) { D.thing.primary = set_record(0, rnum); D.thing.primary = set_field(D.thing.primary, auparse_get_field_num(au)); return 0; } return 1; } static unsigned int set_prime_object2(auparse_state_t *au, const char *str, unsigned int adjust) { unsigned int rnum = 2 + adjust; auparse_goto_record_num(au, rnum); auparse_first_field(au); if (auparse_find_field(au, str)) { D.thing.two = set_record(0, rnum); D.thing.two = set_field(D.thing.two, auparse_get_field_num(au)); return 0; } return 1; } static unsigned int add_obj_attr(auparse_state_t *au, const char *str, unsigned int rnum) { value_t attr; if ((auparse_find_field(au, str))) { attr = set_record(0, rnum); attr = set_field(attr, auparse_get_field_num(au)); if (cllist_append(&D.thing.attr, attr, NULL)) return 1; return 0; } else auparse_goto_record_num(au, rnum); return 1; } static unsigned int add_session(auparse_state_t *au, unsigned int rnum) { if (auparse_find_field(au, "ses")) { D.session = set_record(0, rnum); D.session = set_field(D.session, auparse_get_field_num(au)); return 0; } else auparse_first_record(au); return 1; } static unsigned int set_results(auparse_state_t *au, unsigned int rnum) { if (auparse_find_field(au, "res")) { D.results = set_record(0, rnum); D.results = set_field(D.results, auparse_get_field_num(au)); return 0; } return 1; } static void syscall_subj_attr(auparse_state_t *au) { unsigned int rnum; auparse_first_record(au); do { rnum = auparse_get_record_num(au); if (auparse_get_type(au) == AUDIT_SYSCALL) { if (D.opt == NORM_OPT_NO_ATTRS) { add_session(au, rnum); return; } add_subj_attr(au, "ppid", rnum); add_subj_attr(au, "pid", rnum); add_subj_attr(au, "gid", rnum); add_subj_attr(au, "euid", rnum); add_subj_attr(au, "suid", rnum); add_subj_attr(au, "fsuid", rnum); add_subj_attr(au, "egid", rnum); add_subj_attr(au, "sgid", rnum); add_subj_attr(au, "fsgid", rnum); add_subj_attr(au, "tty", rnum); add_session(au, rnum); add_subj_attr(au, "subj", rnum); return; } } while (auparse_next_record(au) == 1); } static void collect_perm_obj2(auparse_state_t *au, const char *syscall) { const char *val; if (strcmp(syscall, "fchmodat") == 0) val = "a2"; else val = "a1"; auparse_first_record(au); if (auparse_find_field(au, val)) { D.thing.two = set_record(0, 0); D.thing.two = set_field(D.thing.two, auparse_get_field_num(au)); } } static void collect_own_obj2(auparse_state_t *au, const char *syscall) { const char *val; if (strcmp(syscall, "fchownat") == 0) val = "a2"; else val = "a1"; auparse_first_record(au); if (auparse_find_field(au, val)) { // if uid is -1, its not being changed, user group if (auparse_get_field_int(au) == -1 && errno == 0) auparse_next_field(au); D.thing.two = set_record(0, 0); D.thing.two = set_field(D.thing.two, auparse_get_field_num(au)); } } static void collect_id_obj2(auparse_state_t *au, const char *syscall) { unsigned int limit, cnt = 1; if (strcmp(syscall, "setuid") == 0) limit = 1; else if (strcmp(syscall, "setreuid") == 0) limit = 2; else if (strcmp(syscall, "setresuid") == 0) limit = 3; else if (strcmp(syscall, "setgid") == 0) limit = 1; else if (strcmp(syscall, "setregid") == 0) limit = 2; else if (strcmp(syscall, "setresgid") == 0) limit = 3; else return; // Shouldn't happen auparse_first_record(au); if (auparse_find_field(au, "a0")) { while (cnt <= limit) { const char *str = auparse_interpret_field(au); if ((strcmp(str, "unset") == 0) && errno == 0) { // Only move it if its safe to if (cnt < limit) { if (auparse_next_field(au) == 0) return; cnt++; } else return; } else break; } D.thing.two = set_record(0, 0); D.thing.two = set_field(D.thing.two, auparse_get_field_num(au)); } } static int collect_path_attrs(auparse_state_t *au) { value_t attr; unsigned int rnum = auparse_get_record_num(au); auparse_first_field(au); if (add_obj_attr(au, "mode", rnum)) return 1; // Failed opens don't have anything else // All the rest of the fields matter while ((auparse_next_field(au))) { attr = set_record(0, rnum); attr = set_field(attr, auparse_get_field_num(au)); if (cllist_append(&D.thing.attr, attr, NULL)) return 1; } return 0; } static void collect_cwd_attrs(auparse_state_t *au) { unsigned int rnum = auparse_get_record_num(au); add_obj_attr(au, "cwd", rnum); } static void collect_sockaddr_attrs(auparse_state_t *au) { unsigned int rnum = auparse_get_record_num(au); add_obj_attr(au, "saddr", rnum); } static void simple_file_attr(auparse_state_t *au) { int parent = 0; if (D.opt == NORM_OPT_NO_ATTRS) return; auparse_first_record(au); do { const char *f; int type = auparse_get_type(au); switch (type) { case AUDIT_PATH: f = auparse_find_field(au, "nametype"); if (f && strcmp(f, "PARENT") == 0) { if (parent == 0) parent = auparse_get_record_num(au); continue; } // First normal record is collected collect_path_attrs(au); return; break; case AUDIT_CWD: collect_cwd_attrs(au); break; case AUDIT_SOCKADDR: collect_sockaddr_attrs(au); break; } } while (auparse_next_record(au) == 1); // If we get here, path was never collected. Go back and get parent if (parent) { auparse_goto_record_num(au, parent); collect_path_attrs(au); } } static void set_file_object(auparse_state_t *au, int adjust) { const char *f; int parent = 0; unsigned int rnum; auparse_goto_record_num(au, 2 + adjust); auparse_first_field(au); // Now double check that we picked the right one. do { f = auparse_find_field(au, "nametype"); if (f) { if (strcmp(f, "PARENT")) break; if (parent == 0) parent = auparse_get_record_num(au); } } while (f && auparse_next_record(au) == 1); // Sometimes we only have the parent (failed open at dir permission) if (f == NULL) { if (parent == 0) return; auparse_goto_record_num(au, parent); auparse_first_field(au); rnum = parent; } else rnum = auparse_get_record_num(au); if (auparse_get_type(au) == AUDIT_PATH) { auparse_first_field(au); // Object set_prime_object(au, "name", rnum); f = auparse_find_field(au, "inode"); if (f) { D.thing.secondary = set_record(0, rnum); D.thing.secondary = set_field(D.thing.secondary, auparse_get_field_num(au)); } f = auparse_find_field(au, "mode"); if (f) { unsigned int mode; errno = 0; mode = strtoul(f, NULL, 8); if (errno == 0) { if (S_ISREG(mode)) D.thing.what = NORM_WHAT_FILE; else if (S_ISDIR(mode)) D.thing.what = NORM_WHAT_DIRECTORY; else if (S_ISCHR(mode)) D.thing.what = NORM_WHAT_CHAR_DEV; else if (S_ISBLK(mode)) D.thing.what = NORM_WHAT_BLOCK_DEV; else if (S_ISFIFO(mode)) D.thing.what = NORM_WHAT_FIFO; else if (S_ISLNK(mode)) D.thing.what = NORM_WHAT_LINK; else if (S_ISSOCK(mode)) D.thing.what = NORM_WHAT_SOCKET; } } } } static void set_socket_object(auparse_state_t *au) { auparse_goto_record_num(au, 1); auparse_first_field(au); set_prime_object(au, "saddr", 1); } /* This is only called processing syscall records */ static int set_program_obj(auparse_state_t *au) { auparse_first_record(au); int type = auparse_get_type(au); if (type == AUDIT_BPF) { if (auparse_find_field(au, "prog-id")) { D.thing.primary = set_record(0, auparse_get_record_num(au)); D.thing.primary = set_field(D.thing.primary, auparse_get_field_num(au)); } } else if (type == AUDIT_EVENT_LISTENER) { if (auparse_find_field(au, "nl-mcgrp")) { D.thing.primary = set_record(0, auparse_get_record_num(au)); D.thing.primary = set_field(D.thing.primary, auparse_get_field_num(au)); } } else if (type == AUDIT_MAC_POLICY_LOAD) { if (auparse_find_field(au, "lsm")) { D.thing.primary = set_record(0, auparse_get_record_num(au)); D.thing.primary = set_field(D.thing.primary, auparse_get_field_num(au)); } } else if (auparse_find_field(au, "exe")) { const char *exe = auparse_interpret_field(au); if ((strncmp(exe, "/usr/bin/python", 15) == 0) || (strncmp(exe, "/usr/bin/sh", 11) == 0) || (strncmp(exe, "/usr/bin/bash", 13) == 0) || (strncmp(exe, "/usr/bin/perl", 13) == 0)) { // comm should be the previous field int fnum; if ((fnum = auparse_get_field_num(au)) > 0) auparse_goto_field_num(au, fnum - 1); else auparse_first_record(au); auparse_find_field(au, "comm"); } D.thing.primary = set_record(0, auparse_get_record_num(au)); D.thing.primary = set_field(D.thing.primary, auparse_get_field_num(au)); return 0; } return 1; } /* * This function is supposed to come up with the action and object for the * syscalls. */ static int normalize_syscall(auparse_state_t *au, const char *syscall) { int rc, tmp_objkind, objtype = NORM_UNKNOWN, ttype = 0, offset = 0; const char *act = NULL, *f; // cycle through all records and see what we have tmp_objkind = objtype; rc = auparse_first_record(au); while (rc == 1) { ttype = auparse_get_type(au); if (ttype == AUDIT_AVC) { // We want to go ahead with syscall to get objects tmp_objkind = NORM_MAC; break; } else if (ttype == AUDIT_SELINUX_ERR) { objtype = NORM_MAC_ERR; break; } else if (ttype == AUDIT_NETFILTER_CFG) { objtype = NORM_IPTABLES; break; } else if (ttype == AUDIT_ANOM_PROMISCUOUS) { objtype = NORM_PROMISCUOUS; break; } else if (ttype == AUDIT_KERN_MODULE) { objtype = NORM_FILE_LDMOD; break; } else if (ttype == AUDIT_MAC_POLICY_LOAD) { objtype = NORM_MAC_LOAD; break; } else if (ttype == AUDIT_MAC_STATUS) { objtype = NORM_MAC_ENFORCE; break; } else if (ttype == AUDIT_MAC_CONFIG_CHANGE) { objtype = NORM_MAC_CONFIG; break; } else if (ttype == AUDIT_FANOTIFY) { // We want to go ahead with syscall to get objects tmp_objkind = NORM_AV; break; } else if (ttype == AUDIT_TIME_INJOFFSET || ttype == AUDIT_TIME_ADJNTPVAL) { objtype = NORM_SYSTEM_TIME; break; } else if (ttype == AUDIT_BPF) { objtype = NORM_BPF; break; } else if (ttype == AUDIT_EVENT_LISTENER) { objtype = NORM_EV_LISTEN; break; } rc = auparse_next_record(au); } // lookup system call - it can be NULL if interpret_field failed. In // that case, the s2i call will fail and leave objtype untouched if (objtype == NORM_UNKNOWN) normalize_syscall_map_s2i(syscall, &objtype); // FIXME: Need to address: landlock_*, lsm_*, map_shadow_stack, pkey_*, // kexec_file_load, They likely need new NORM_* types. Also, these suggest // that NORM_WHAT_ may need some new types. switch (objtype) { case NORM_FILE: act = "opened-file"; set_file_object(au, 0); D.thing.what = NORM_WHAT_FILE; // this gets overridden simple_file_attr(au); break; case NORM_FILE_CHATTR: act = "changed-file-attributes-of"; D.thing.what = NORM_WHAT_FILE; // this gets overridden if (strcmp(syscall, "fsetxattr") == 0) offset = -1; set_file_object(au, offset); simple_file_attr(au); break; case NORM_FILE_CHPERM: act = "changed-file-permissions-of"; D.thing.what = NORM_WHAT_FILE; // this gets overridden if (strcmp(syscall, "fchmod") == 0) offset = -1; collect_perm_obj2(au, syscall); set_file_object(au, offset); simple_file_attr(au); break; case NORM_FILE_CHOWN: act = "changed-file-ownership-of"; D.thing.what = NORM_WHAT_FILE; // this gets overridden if (strcmp(syscall, "fchown") == 0) offset = -1; collect_own_obj2(au, syscall); set_file_object(au, offset); // FIXME: fchown has no cwd simple_file_attr(au); break; case NORM_FILE_LDMOD: act = "loaded-kernel-module"; D.thing.what = NORM_WHAT_FILE; auparse_goto_record_num(au, 1); set_prime_object(au, "name", 1);// FIXME:is this needed? break; case NORM_FILE_UNLDMOD: act = "unloaded-kernel-module"; D.thing.what = NORM_WHAT_FILE; // this gets overridden // set_file_object(au, 0); // simple_file_attr(au); break; case NORM_FILE_DIR: act = "created-directory"; D.thing.what = NORM_WHAT_FILE; // this gets overridden set_file_object(au, 1); // New dir is one after simple_file_attr(au); break; case NORM_FILE_MOUNT: act = "mounted"; // this gets overridden D.thing.what = NORM_WHAT_FILESYSTEM; if (syscall_success == 1) set_prime_object2(au, "name", 0); //The device is 1 after on success 0 on fail set_file_object(au, syscall_success); // We call this directly to make sure the right // PATH record is used. (There can be 4.) collect_path_attrs(au); break; case NORM_FILE_RENAME: act = "renamed"; D.thing.what = NORM_WHAT_FILE; // this gets overridden set_prime_object2(au, "name", 4); set_file_object(au, 2); // Thing renamed is 2 after simple_file_attr(au); break; case NORM_FILE_STAT: act = "checked-metadata-of"; D.thing.what = NORM_WHAT_FILE; // this gets overridden set_file_object(au, 0); simple_file_attr(au); break; case NORM_FILE_SYS_STAT: act = "checked-filesystem-metadata-of"; D.thing.what = NORM_WHAT_FILESYSTEM; // this gets overridden set_file_object(au, 0); simple_file_attr(au); break; case NORM_FILE_LNK: act = "symlinked"; D.thing.what = NORM_WHAT_FILE; // this gets overridden set_prime_object2(au, "name", 0); set_file_object(au, 2); simple_file_attr(au); break; case NORM_FILE_UMNT: act = "unmounted"; D.thing.what = NORM_WHAT_FILESYSTEM; // this gets overridden set_file_object(au, 0); simple_file_attr(au); break; case NORM_FILE_DEL: act = "deleted"; D.thing.what = NORM_WHAT_FILE; // this gets overridden set_file_object(au, 0); simple_file_attr(au); break; case NORM_FILE_TIME: act = "changed-timestamp-of"; D.thing.what = NORM_WHAT_FILE; // this gets overridden set_file_object(au, 0); simple_file_attr(au); break; case NORM_EXEC: act = "executed"; D.thing.what = NORM_WHAT_FILE; // this gets overridden set_file_object(au, 1); simple_file_attr(au); break; case NORM_SOCKET_ACCEPT: act = "accepted-connection-from"; D.thing.what = NORM_WHAT_SOCKET; set_socket_object(au); break; case NORM_SOCKET_BIND: act = "bound-socket"; D.thing.what = NORM_WHAT_SOCKET; set_socket_object(au); break; case NORM_SOCKET_CONN: act = "connected-to"; D.thing.what = NORM_WHAT_SOCKET; set_socket_object(au); break; case NORM_SOCKET_RECV: act = "received-from"; D.thing.what = NORM_WHAT_SOCKET; set_socket_object(au); break; case NORM_SOCKET_SEND: act = "sent-to"; D.thing.what = NORM_WHAT_SOCKET; set_socket_object(au); break; case NORM_PID: if (auparse_get_num_records(au) > 2) // FIXME: this has implications for object act = "killed-list-of-pids"; else act = "killed-pid"; auparse_goto_record_num(au, 1); auparse_first_field(au); f = auparse_find_field(au, "saddr"); if (f) { D.thing.primary = set_record(0, auparse_get_record_num(au)); D.thing.primary = set_field(D.thing.primary, auparse_get_field_num(au)); } D.thing.what = NORM_WHAT_PROCESS; break; case NORM_MAC_LOAD: act = normalize_record_map_i2s(ttype); // FIXME: What is the object? D.thing.what = NORM_WHAT_SECURITY_POLICY; break; case NORM_MAC_CONFIG: act = normalize_record_map_i2s(ttype); f = auparse_find_field(au, "bool"); if (f) { D.thing.primary = set_record(0, auparse_get_record_num(au)); D.thing.primary = set_field(D.thing.primary, auparse_get_field_num(au)); } D.thing.what = NORM_WHAT_SECURITY_POLICY; break; case NORM_MAC_ENFORCE: act = normalize_record_map_i2s(ttype); f = auparse_find_field(au, "enforcing"); if (f) { D.thing.primary = set_record(0, auparse_get_record_num(au)); D.thing.primary = set_field(D.thing.primary, auparse_get_field_num(au)); } D.thing.what = NORM_WHAT_SECURITY_POLICY; break; case NORM_MAC_ERR: // FIXME: What could the object be? act = "caused-mac-policy-error"; // For now we'll call the obj_kind the system D.thing.what = NORM_WHAT_SYSTEM; break; case NORM_IPTABLES: act = "loaded-firewall-rule-to"; auparse_first_record(au); f = auparse_find_field(au, "table"); if (f) { D.thing.primary = set_record(0, auparse_get_record_num(au)); D.thing.primary = set_field(D.thing.primary, auparse_get_field_num(au)); } D.thing.what = NORM_WHAT_FIREWALL; break; case NORM_PROMISCUOUS: auparse_first_record(au); f = auparse_find_field(au, "dev"); if (f) { D.thing.primary = set_record(0, auparse_get_record_num(au)); D.thing.primary = set_field(D.thing.primary, auparse_get_field_num(au)); } f = auparse_find_field(au, "prom"); if (f) { int i = auparse_get_field_int(au); if (i == 0) act = "left-promiscuous-mode-on-device"; else act = "entered-promiscuous-mode-on-device"; } D.thing.what = NORM_WHAT_SOCKET; break; case NORM_UID: case NORM_GID: act = "changed-identity-of"; D.thing.what = NORM_WHAT_PROCESS; set_program_obj(au); if (D.how) { free((void *)D.how); D.how = strdup(syscall); } collect_id_obj2(au, syscall); break; case NORM_SYSTEM_TIME: act = "changed-system-time"; // TODO: can't think of an object for this one D.thing.what = NORM_WHAT_SYSTEM; break; case NORM_MAKE_DEV: set_file_object(au, 0); simple_file_attr(au); if (D.thing.what == NORM_WHAT_CHAR_DEV) act = "made-character-device"; else if (D.thing.what == NORM_WHAT_BLOCK_DEV) act = "made-block-device"; else act = "make-device"; break; case NORM_SYSTEM_NAME: act = "changed-system-name"; // TODO: can't think of an object for this one D.thing.what = NORM_WHAT_SYSTEM; break; case NORM_SYSTEM_MEMORY: act = "allocated-memory"; if (syscall_success == 1) { // If its not a mmap avc, we can use comm act = "allocated-memory-in"; auparse_first_record(au); f = auparse_find_field(au, "comm"); if (f) { D.thing.primary = set_record(0, auparse_get_record_num(au)); D.thing.primary = set_field(D.thing.primary, auparse_get_field_num(au)); } } D.thing.what = NORM_WHAT_MEMORY; break; case NORM_SCHEDULER: act = "adjusted-scheduling-policy-of"; D.thing.what = NORM_WHAT_PROCESS; set_program_obj(au); if (D.how) { free((void *)D.how); D.how = strdup(syscall); } break; case NORM_BPF: auparse_first_record(au); f = auparse_find_field(au, "op"); if (f) { const char *str = auparse_get_field_str(au); if (strcmp(str, "LOAD") == 0) act = "loaded-bpf-program"; else act = "unloaded-bpf-program"; } else act = "bpf-program"; D.thing.what = NORM_WHAT_PROCESS; set_program_obj(au); break; case NORM_EV_LISTEN: auparse_first_record(au); f = auparse_find_field(au, "op"); if (f) { const char *str = auparse_get_field_str(au); if (strcmp(str, "connect") == 0) act = "connected-to"; else act = "disconnected-from"; } else act = "connected"; D.thing.what = NORM_WHAT_SOCKET; set_program_obj(au); break; case NORM_SECURITY_POLICY: act = "adjusted-security-policy-of"; D.thing.what = NORM_WHAT_PROCESS; set_program_obj(au); if (D.how) { free((void *)D.how); D.how = strdup(syscall); } break; default: { const char *k; rc = auparse_first_record(au); k = auparse_find_field(au, "key"); if (k && strcmp(k, "(null)")) { act = "triggered-audit-rule"; D.thing.primary = set_record(0, auparse_get_record_num(au)); D.thing.primary = set_field( D.thing.primary, auparse_get_field_num(au)); } else act = "triggered-unknown-audit-rule"; D.thing.what = NORM_WHAT_AUDIT_RULE; } break; } // We put the AVC back after gathering the object information if (tmp_objkind == NORM_MAC) act = "accessed-mac-policy-controlled-object"; else if (tmp_objkind == NORM_AV) act = "accessed-policy-controlled-file"; if (act) D.action = strdup(act); return 0; } static const char *normalize_determine_evkind(int type) { int kind; switch (type) { case AUDIT_USER_AUTH ... AUDIT_USER_ACCT: case AUDIT_CRED_ACQ ... AUDIT_USER_END: case AUDIT_USER_CHAUTHTOK ... AUDIT_CRED_REFR: case AUDIT_USER_LOGIN ... AUDIT_USER_LOGOUT: case AUDIT_LOGIN: kind = NORM_EVTYPE_USER_LOGIN; break; case AUDIT_GRP_AUTH: case AUDIT_CHGRP_ID: kind = NORM_EVTYPE_GROUP_CHANGE; break; case AUDIT_USER_MGMT: case AUDIT_ADD_USER ...AUDIT_DEL_GROUP: case AUDIT_GRP_MGMT ... AUDIT_GRP_CHAUTHTOK: case AUDIT_ACCT_LOCK ... AUDIT_ACCT_UNLOCK: kind = NORM_EVTYPE_USER_ACCT; break; case AUDIT_KERNEL: case AUDIT_SYSTEM_BOOT ... AUDIT_SERVICE_STOP: kind = NORM_EVTYPE_SYSTEM_SERVICES; break; case AUDIT_USYS_CONFIG: case AUDIT_CONFIG_CHANGE: case AUDIT_NETFILTER_CFG: case AUDIT_FEATURE_CHANGE: case AUDIT_TIME_INJOFFSET: case AUDIT_TIME_ADJNTPVAL: case AUDIT_USER_DEVICE: case AUDIT_SOFTWARE_UPDATE: kind = NORM_EVTYPE_CONFIG; break; case AUDIT_SECCOMP: kind = NORM_EVTYPE_DAC_DECISION; break; case AUDIT_TEST ... AUDIT_TRUSTED_APP: case AUDIT_USER_CMD: case AUDIT_CHUSER_ID: kind = NORM_EVTYPE_USERSPACE; break; case AUDIT_USER_TTY: case AUDIT_TTY: kind = NORM_EVTYPE_TTY; break; case AUDIT_EVENT_LISTENER: case AUDIT_FIRST_DAEMON ... AUDIT_LAST_DAEMON: kind = NORM_EVTYPE_AUDIT_DAEMON; break; case AUDIT_USER_SELINUX_ERR: case AUDIT_USER_AVC: case AUDIT_APPARMOR_ALLOWED ... AUDIT_APPARMOR_DENIED: case AUDIT_APPARMOR_ERROR: case AUDIT_AVC ... AUDIT_AVC_PATH: kind = NORM_EVTYPE_MAC_DECISION; break; case AUDIT_INTEGRITY_FIRST_MSG ... AUDIT_INTEGRITY_LAST_MSG: case AUDIT_ANOM_RBAC_INTEGRITY_FAIL: // Aide sends this kind = NORM_EVTYPE_INTEGRITY; break; case AUDIT_FIRST_KERN_ANOM_MSG ... AUDIT_LAST_KERN_ANOM_MSG: case AUDIT_FIRST_ANOM_MSG ... AUDIT_ANOM_RBAC_FAIL: case AUDIT_ANOM_CRYPTO_FAIL ... AUDIT_LAST_ANOM_MSG: kind = NORM_EVTYPE_ANOMALY; break; case AUDIT_FIRST_ANOM_RESP ... AUDIT_LAST_ANOM_RESP: kind = NORM_EVTYPE_ANOMALY_RESP; break; case AUDIT_MAC_POLICY_LOAD ... AUDIT_LAST_SELINUX: case AUDIT_AA ... AUDIT_APPARMOR_AUDIT: case AUDIT_APPARMOR_HINT ... AUDIT_APPARMOR_STATUS: case AUDIT_FIRST_USER_LSPP_MSG ... AUDIT_LAST_USER_LSPP_MSG: kind = NORM_EVTYPE_MAC; break; case AUDIT_FIRST_KERN_CRYPTO_MSG ... AUDIT_LAST_KERN_CRYPTO_MSG: case AUDIT_FIRST_CRYPTO_MSG ... AUDIT_LAST_CRYPTO_MSG: kind = NORM_EVTYPE_CRYPTO; break; case AUDIT_FIRST_VIRT_MSG ... AUDIT_LAST_VIRT_MSG: kind = NORM_EVTYPE_VIRT; break; case AUDIT_SYSCALL ... AUDIT_SOCKETCALL: case AUDIT_SOCKADDR ... AUDIT_MQ_GETSETATTR: case AUDIT_FD_PAIR ... AUDIT_OBJ_PID: case AUDIT_BPRM_FCAPS ... AUDIT_NETFILTER_PKT: case AUDIT_URINGOP: kind = NORM_EVTYPE_AUDIT_RULE; break; case AUDIT_FANOTIFY: kind = NORM_EVTYPE_AV_DECISION; break; case AUDIT_BPF: kind = NORM_EVTYPE_BPF; break; default: kind = NORM_EVTYPE_UNKNOWN; } return evtype_i2s(kind); } const char *find_config_change_object(auparse_state_t *au) { const char *f; // Check if its an audit rule auparse_first_record(au); f = auparse_find_field(au, "key"); if (f) { const char *str = auparse_get_field_str(au); if (str && strcmp(str, "(null)")) return f; } // Next lets find the individual objects being set auparse_first_record(au); f = auparse_find_field(au, "audit_enabled"); if (f) return f; auparse_first_record(au); f = auparse_find_field(au, "audit_pid"); if (f) return f; auparse_first_record(au); f = auparse_find_field(au, "audit_backlog_limit"); if (f) return f; auparse_first_record(au); f = auparse_find_field(au, "audit_failure"); if (f) return f; auparse_first_record(au); f = auparse_find_field(au, "actions"); // seccomp-logging if (f) return f; auparse_first_record(au); f = auparse_find_field(au, "list"); // If nothing else, the list if (f) return f; return NULL; } static int normalize_compound(auparse_state_t *au) { const char *f, *syscall = NULL; int rc, recno, otype, type; otype = type = auparse_get_type(au); // All compound events have a syscall record, find it. After this // loop, type should be syscall, and otype is the original type. // Traditionally, the first record is the purpose of the event and // the syscall is added on next to support/enhance information content. if (type != AUDIT_SYSCALL) { do { // If we go off the end without finding a syscall // record, don't parse corrupt events if (auparse_next_record(au) < 0) return 1; type = auparse_get_type(au); } while (type && type != AUDIT_SYSCALL); } if (!type) return 1; // Determine the kind of event using original event type D.evkind = normalize_determine_evkind(otype); if (type == AUDIT_SYSCALL) { recno = auparse_get_record_num(au); f = auparse_find_field(au, "syscall"); if (f) { f = auparse_interpret_field(au); if (f) syscall = strdup(f); } // Results f = auparse_find_field(au, "success"); if (f) { const char *str = auparse_get_field_str(au); if (strcmp(str, "no") == 0) syscall_success = 0; else syscall_success = 1; D.results = set_record(0, recno); D.results = set_field(D.results, auparse_get_field_num(au)); } else { rc = auparse_goto_record_num(au, recno); if (rc != 1) { free((void *)syscall); return 1; } auparse_first_field(au); } // Subject - primary if (set_prime_subject(au, "auid", recno)) { rc = auparse_goto_record_num(au, recno); if (rc != 1) { free((void *)syscall); return 1; } auparse_first_field(au); } // Subject - alias, uid comes before auid if (set_secondary_subject(au, "uid", recno)) { rc = auparse_goto_record_num(au, recno); if (rc != 1) { free((void *)syscall); return 1; } auparse_first_field(au); } // Subject attributes syscall_subj_attr(au); // how auparse_first_field(au); f = auparse_find_field(au, "exe"); if (f) { const char *exe = auparse_interpret_field(au); D.how = strdup(exe); if (D.how == NULL) { fprintf(stderr, "Out of memory. Check %s file, %d line", __FILE__, __LINE__); free((void *)syscall); return 1; } if ((strncmp(D.how, "/usr/bin/python", 15) == 0) || (strncmp(D.how, "/usr/bin/sh", 11) == 0) || (strncmp(D.how, "/usr/bin/bash", 13) == 0) || (strncmp(D.how, "/usr/bin/perl", 13) == 0)) { int fnum; rc = 0; // Comm should be the previous field if ((fnum = auparse_get_field_num(au)) > 0) rc = auparse_goto_field_num(au,fnum-1); if (rc == 0) auparse_first_record(au); f = auparse_find_field(au, "comm"); if (f) { free((void *)D.how); exe = auparse_interpret_field(au); D.how = strdup(exe); } } } else { rc = auparse_goto_record_num(au, recno); if (rc != 1) { free((void *)syscall); return 1; } auparse_first_field(au); } f = auparse_find_field(au, "key"); if (f) { const char *k = auparse_get_field_str(au); if (strcmp(k, "(null)")) { // We only collect real keys D.key = set_record(0, recno); D.key = set_field(D.key, auparse_get_field_num(au)); } } // No error repositioning will be done because nothing // below uses fields. // action & object if (otype == AUDIT_ANOM_LINK) { const char *act = normalize_record_map_i2s(otype); if (act) D.action = strdup(act); // FIXME: AUDIT_ANOM_LINK needs an object } else if (otype == AUDIT_CONFIG_CHANGE) { auparse_first_record(au); f = auparse_find_field(au, "op"); if (f) { value_t o; // Fix the action D.action = strdup(auparse_interpret_field(au)); // Next fix the object o = find_simple_object(au, AUDIT_CONFIG_CHANGE); D.thing.primary = o; } } else { normalize_syscall(au, syscall); if (otype == AUDIT_MAC_POLICY_LOAD) set_program_obj(au); } } free((void *)syscall); return 0; } static value_t find_simple_object(auparse_state_t *au, int type) { value_t o = set_record(0, UNSET); const char *f = NULL; auparse_first_field(au); switch (type) { case AUDIT_SERVICE_START: case AUDIT_SERVICE_STOP: f = auparse_find_field(au, "unit"); D.thing.what = NORM_WHAT_SERVICE; break; case AUDIT_SYSTEM_RUNLEVEL: f = auparse_find_field(au, "new-level"); D.thing.what = NORM_WHAT_SYSTEM; break; case AUDIT_USER_ROLE_CHANGE: f = auparse_find_field(au, "selected-context"); D.thing.what = NORM_WHAT_USER_SESSION; break; case AUDIT_ROLE_ASSIGN: case AUDIT_ROLE_REMOVE: case AUDIT_USER_MGMT: case AUDIT_ACCT_LOCK: case AUDIT_ACCT_UNLOCK: case AUDIT_ADD_USER: case AUDIT_DEL_USER: case AUDIT_ADD_GROUP: case AUDIT_DEL_GROUP: case AUDIT_GRP_MGMT: f = auparse_find_field(au, "id"); if (f == NULL) { auparse_first_record(au); f = auparse_find_field(au, "acct"); } D.thing.what = NORM_WHAT_ACCT; break; case AUDIT_USER_START: case AUDIT_USER_END: case AUDIT_USER_ERR: case AUDIT_USER_LOGIN: case AUDIT_USER_LOGOUT: f = auparse_find_field(au, "terminal"); D.thing.what = NORM_WHAT_USER_SESSION; break; case AUDIT_USER_AUTH: case AUDIT_USER_ACCT: case AUDIT_CRED_ACQ: case AUDIT_CRED_REFR: case AUDIT_CRED_DISP: case AUDIT_USER_CHAUTHTOK: case AUDIT_GRP_CHAUTHTOK: case AUDIT_ANOM_LOGIN_FAILURES: case AUDIT_ANOM_LOGIN_TIME: case AUDIT_ANOM_LOGIN_SESSIONS: case AUDIT_ANOM_LOGIN_LOCATION: f = auparse_find_field(au, "acct"); D.thing.what = NORM_WHAT_USER_SESSION; break; case AUDIT_ANOM_EXEC: case AUDIT_USER_CMD: f = auparse_find_field(au, "cmd"); D.thing.what = NORM_WHAT_PROCESS; break; case AUDIT_USER_TTY: case AUDIT_TTY: auparse_first_record(au); f = auparse_find_field(au, "data"); D.thing.what = NORM_WHAT_KEYSTROKES; break; case AUDIT_USER_DEVICE: auparse_first_record(au); f = auparse_find_field(au, "device"); D.thing.what = NORM_WHAT_KEYSTROKES; break; case AUDIT_SOFTWARE_UPDATE: auparse_first_record(au); f = auparse_find_field(au, "sw"); D.thing.what = NORM_WHAT_SOFTWARE; break; case AUDIT_VIRT_MACHINE_ID: f = auparse_find_field(au, "vm"); D.thing.what = NORM_WHAT_VM; break; case AUDIT_VIRT_RESOURCE: f = auparse_find_field(au, "resrc"); D.thing.what = NORM_WHAT_VM; break; case AUDIT_VIRT_CONTROL: f = auparse_find_field(au, "op"); D.thing.what = NORM_WHAT_VM; break; case AUDIT_LABEL_LEVEL_CHANGE: f = auparse_find_field(au, "printer"); D.thing.what = NORM_WHAT_PRINTER; break; case AUDIT_CONFIG_CHANGE: f = find_config_change_object(au); D.thing.what = NORM_WHAT_AUDIT_CONFIG; break; case AUDIT_MAC_CONFIG_CHANGE: f = auparse_find_field(au, "bool"); D.thing.what = NORM_WHAT_SECURITY_POLICY; break; case AUDIT_MAC_STATUS: f = auparse_find_field(au, "enforcing"); D.thing.what = NORM_WHAT_SECURITY_POLICY; break; // These deal with policy, not sure about object yet case AUDIT_MAC_POLICY_LOAD: case AUDIT_LABEL_OVERRIDE: case AUDIT_DEV_ALLOC ... AUDIT_USER_MAC_CONFIG_CHANGE: D.thing.what = NORM_WHAT_SECURITY_POLICY; break; case AUDIT_USER: f = auparse_find_field(au, "addr"); // D.thing.what = NORM_WHAT_? break; case AUDIT_USYS_CONFIG: f = auparse_find_field(au, "op"); if (f) { free((void *)D.action); D.action = strdup(auparse_interpret_field(au)); f = NULL; } D.thing.what = NORM_WHAT_SYSTEM; break; case AUDIT_CRYPTO_KEY_USER: f = auparse_find_field(au, "fp"); D.thing.what = NORM_WHAT_USER_SESSION; break; case AUDIT_CRYPTO_SESSION: f = auparse_find_field(au, "addr"); D.thing.what = NORM_WHAT_USER_SESSION; break; case AUDIT_ANOM_RBAC_INTEGRITY_FAIL: f = auparse_find_field(au, "hostname"); D.thing.what = NORM_WHAT_FILESYSTEM; break; default: break; } if (f) { o = set_record(0, 0); o = set_field(o, auparse_get_field_num(au)); } return o; } static value_t find_simple_obj_secondary(auparse_state_t *au, int type) { value_t o = set_record(0, UNSET); const char *f = NULL; // FIXME: maybe pass flag indicating if this is needed auparse_first_field(au); switch (type) { case AUDIT_CRYPTO_SESSION: f = auparse_find_field(au, "rport"); break; case AUDIT_SOFTWARE_UPDATE: f = auparse_find_field(au, "sw_type"); break; default: break; } if (f) { o = set_record(0, 0); o = set_field(o, auparse_get_field_num(au)); } return o; } static value_t find_simple_obj_primary2(auparse_state_t *au, int type) { value_t o = set_record(0, UNSET); const char *f = NULL; // FIXME: maybe pass flag indicating if this is needed auparse_first_field(au); switch (type) { case AUDIT_VIRT_CONTROL: f = auparse_find_field(au, "vm"); break; case AUDIT_VIRT_RESOURCE: f = auparse_find_field(au, "vm"); break; case AUDIT_SOFTWARE_UPDATE: f = auparse_find_field(au, "root_dir"); break; default: break; } if (f) { o = set_record(0, 0); o = set_field(o, auparse_get_field_num(au)); } return o; } static void collect_simple_subj_attr(auparse_state_t *au) { if (D.opt == NORM_OPT_NO_ATTRS) return; auparse_first_record(au); add_subj_attr(au, "pid", 0); // Just pass 0 since simple is 1 record add_subj_attr(au, "subj", 0); } static void collect_userspace_subj_attr(auparse_state_t *au, int type) { if (D.opt == NORM_OPT_NO_ATTRS) return; // Just pass 0 since simple is 1 record add_subj_attr(au, "hostname", 0); add_subj_attr(au, "addr", 0); // Some events have the terminal as the object - skip for them if (type != AUDIT_USER_START && type != AUDIT_USER_END && type != AUDIT_USER_ERR) add_subj_attr(au, "terminal", 0); } static int normalize_simple(auparse_state_t *au) { const char *f, *act = NULL; int type = auparse_get_type(au); // Some older OS do not have PROCTITLE records if (type == AUDIT_SYSCALL) return normalize_compound(au); // Determine the kind of event D.evkind = normalize_determine_evkind(type); // This is for events that follow: // auid, (op), (uid), stuff if (type == AUDIT_CONFIG_CHANGE || type == AUDIT_FEATURE_CHANGE || type == AUDIT_SECCOMP || type == AUDIT_ANOM_ABEND || type == AUDIT_ANOM_PROMISCUOUS) { // Subject - primary set_prime_subject(au, "auid", 0); // Session add_session(au, 0); // Subject attrs collect_simple_subj_attr(au); // action if (type == AUDIT_CONFIG_CHANGE) { auparse_first_field(au); f = auparse_find_field(au, "op"); if (f) { const char *str = auparse_interpret_field(au); if (*str == '"') str++; if (strncmp(str, "add_rule", 8) == 0) { D.action = strdup("added-audit-rule"); D.thing.primary = find_simple_object(au, type); } else if (strncmp(str,"remove_rule",11) == 0){ D.action = strdup("deleted-audit-rule"); D.thing.primary = find_simple_object(au, type); } else goto map; } else goto map; } else { // This assigns action for feature_change, seccomp, // and anom_abend map: act = normalize_record_map_i2s(type); if (act) D.action = strdup(act); if (type == AUDIT_CONFIG_CHANGE) D.thing.primary = find_simple_object(au, type); auparse_first_record(au); } // object if (type == AUDIT_FEATURE_CHANGE) { // Subject - secondary auparse_first_field(au); if (set_secondary_subject(au, "uid", 0)) auparse_first_record(au); // how f = auparse_find_field(au, "exe"); if (f) { const char *sig = auparse_interpret_field(au); D.how = strdup(sig); } // object set_prime_object(au, "feature", 0); D.thing.what = NORM_WHAT_SYSTEM; } if (type == AUDIT_SECCOMP) { // Subject - secondary auparse_first_field(au); if (set_secondary_subject(au, "uid", 0)) auparse_first_record(au); // how f = auparse_find_field(au, "exe"); if (f) { const char *sig = auparse_interpret_field(au); D.how = strdup(sig); } // Object if (set_prime_object(au, "syscall", 0)) auparse_first_record(au); D.thing.what = NORM_WHAT_PROCESS; // Results f = auparse_find_field(au, "code"); if (f) { D.results = set_record(0, 0); D.results = set_field(D.results, auparse_get_field_num(au)); } return 0; } if (type == AUDIT_ANOM_ABEND) { // Subject - secondary auparse_first_field(au); if (set_secondary_subject(au, "uid", 0)) auparse_first_record(au); //object if (set_prime_object(au, "exe", 0)) auparse_first_record(au); D.thing.what = NORM_WHAT_PROCESS; // how f = auparse_find_field(au, "sig"); if (f) { const char *sig = auparse_interpret_field(au); D.how = strdup(sig); } } if (type == AUDIT_ANOM_PROMISCUOUS) { auparse_first_field(au); set_prime_object(au, "dev", 0); set_secondary_subject(au, "uid", 0); D.thing.what = NORM_WHAT_SOCKET; } // Results set_results(au, 0); return 0; } // This one is atypical and originates from the kernel if (type == AUDIT_LOGIN) { // Secondary if (set_secondary_subject(au, "uid", 0)) auparse_first_record(au); // Subject attrs collect_simple_subj_attr(au); // Subject if (set_prime_subject(au, "old-auid", 0)) auparse_first_record(au); // Object if (set_prime_object(au, "auid", 0)) auparse_first_record(au); D.thing.what = NORM_WHAT_USER_SESSION; // Session add_session(au, 0); // Results set_results(au, 0); // action act = normalize_record_map_i2s(type); if (act) D.action = strdup(act); // How - currently missing return 0; } // NETFILTER_CFG is atypical if (type == AUDIT_NETFILTER_CFG) { // Subject attrs collect_simple_subj_attr(au); // how f = auparse_find_field(au, "comm"); if (f) { const char *sig = auparse_interpret_field(au); D.how = strdup(sig); } D.action = strdup("loaded-firewall-rule-to"); auparse_first_record(au); f = auparse_find_field(au, "table"); if (f) { D.thing.primary = set_record(0, auparse_get_record_num(au)); D.thing.primary = set_field(D.thing.primary, auparse_get_field_num(au)); } set_system_subject_what(au); D.thing.what = NORM_WHAT_FIREWALL; return 0; } /* This one is also atypical and comes from the kernel */ if (type == AUDIT_AVC) { // how f = auparse_find_field(au, "comm"); if (f) { const char *sig = auparse_interpret_field(au); D.how = strdup(sig); } else auparse_first_record(au); // Subject set_prime_subject(au, "scontext", 0); set_unknown_subject_what(au); auparse_first_record(au); // Object if (D.opt == NORM_OPT_ALL) { // We will only collect this when everything is asked // for because it messes up text format otherwise set_prime_object(au, "tcontext", 0); auparse_first_record(au); } // Ideally we would choose tclass D.thing.what = NORM_WHAT_UNKNOWN; // action act = normalize_record_map_i2s(type); if (act) D.action = strdup(act); // find the denial auparse_first_record(au); f = auparse_find_field(au, "seresult"); if (f) { D.results = set_record(0, 0); D.results = set_field(D.results, auparse_get_field_num(au)); } // This is slim pickings without a syscall record return 0; } /* Daemon events are atypical because they never transit the kernel */ if (type >= AUDIT_FIRST_DAEMON && type < AUDIT_LAST_DAEMON) { // Subject - primary set_prime_subject(au, "auid", 0); // Secondary - optional if (set_secondary_subject(au, "uid", 0)) auparse_first_record(au); // Session - optional if (add_session(au, 0)) auparse_first_record(au); // Subject attrs collect_simple_subj_attr(au); free((void *)D.actor.what); D.actor.what = strdup("auditd"); // action act = normalize_record_map_i2s(type); if (act) D.action = strdup(act); // Object type D.thing.what = NORM_WHAT_SERVICE; // How start:init, everything else:signal if (type == AUDIT_DAEMON_START) D.how = strdup("init"); else if (type < AUDIT_DAEMON_ACCEPT && type != AUDIT_DAEMON_ABORT) D.how = strdup("signal"); // Results set_results(au, 0); return 0; } // BPF events are atypical if (type == AUDIT_BPF) { set_system_subject_what(au); auparse_first_record(au); f = auparse_find_field(au, "op"); if (f) { const char *str = auparse_get_field_str(au); if (strcmp(str, "LOAD") == 0) act = "loaded-bpf-program"; else act = "unloaded-bpf-program"; } else act = "bpf-program"; D.action = strdup(act); D.thing.what = NORM_WHAT_PROCESS; set_program_obj(au); return 0; } // LISTENER events are atypical if (type == AUDIT_EVENT_LISTENER) { // Subject - primary set_prime_subject(au, "auid", 0); // Secondary - optional auparse_first_record(au); set_secondary_subject(au, "uid", 0); // Session auparse_first_record(au); add_session(au, 0); // Subject attrs collect_simple_subj_attr(au); auparse_first_record(au); f = auparse_find_field(au, "op"); if (f) { const char *str = auparse_get_field_str(au); if (strcmp(str, "connect") == 0) act = "connected-to"; else act = "disconnected-from"; } else act = "connected"; D.action = strdup(act); set_program_obj(au); D.thing.what = NORM_WHAT_SOCKET; // How auparse_first_record(au); f = auparse_find_field(au, "exe"); if (f) { const char *exe = auparse_interpret_field(au); D.how = strdup(exe); } // Results auparse_first_record(au); set_results(au, 0); return 0; } // Labeled networking events are atypical if (type >= AUDIT_MAC_UNLBL_ALLOW && type <= AUDIT_LAST_SELINUX) { // Subject - primary set_prime_subject(au, "auid", 0); // We don't have a secondary subject, so set it to auid set_subject_what(au); // Session add_session(au, 0); // Subject attrs add_subj_attr(au, "subj", 0); // action if (type == AUDIT_MAC_UNLBL_ALLOW) { f = auparse_find_field(au, "unlbl_accept"); if (f) { if (auparse_get_field_int(au) == 1) act = "is-allowing-unlabeled-network-traffic"; else act = "is-disallowing-unlabeled-network-traffic"; } else auparse_first_record(au); } else act = normalize_record_map_i2s(type); if (act) D.action = strdup(act); if (type == AUDIT_MAC_MAP_ADD || type == AUDIT_MAC_MAP_DEL) { if (set_prime_object(au, "nlbl_domain", 0)) auparse_first_record(au); } // Object type D.thing.what = NORM_WHAT_SECURITY_POLICY; // Results set_results(au, 0); return 0; } // This is for events that follow: // uid, auid, ses, res, find_simple_object // // USER_LOGIN is different in locating the subject because if they // fail login, they are not quite in the system to have an auid. if (type == AUDIT_USER_LOGIN) { // Subject - primary if (set_prime_subject(au, "id", 0)) { auparse_first_record(au); if (set_prime_subject(au, "acct", 0) == 0) set_subject_what(au); } else // If id found, set the subjkind set_subject_what(au); auparse_first_record(au); } else { // Subject - alias, uid comes before auid if (set_secondary_subject(au, "uid", 0)) auparse_first_record(au); // Subject - primary set_prime_subject(au, "auid", 0); } // Session add_session(au, 0); // Subject attrs collect_simple_subj_attr(au); if ((type >= AUDIT_FIRST_USER_MSG && type < AUDIT_LAST_USER_MSG) || (type >= AUDIT_FIRST_USER_MSG2 && type < AUDIT_LAST_USER_MSG2)) collect_userspace_subj_attr(au, type); // Results if (type != AUDIT_USER_AVC) set_results(au, 0); else { // find the denial auparse_first_record(au); f = auparse_find_field(au, "seresult"); if (f) { D.results = set_record(0, 0); D.results = set_field(D.results, auparse_get_field_num(au)); } // Subject auparse_first_record(au); set_prime_subject(au, "scontext", 0); // Object if (D.opt == NORM_OPT_ALL) { // We will only collect this when everything is asked // for because it messes up text format otherwise auparse_first_record(au); set_prime_object(au, "tcontext", 0); } } // action if (type == AUDIT_USER_DEVICE) { auparse_first_record(au); f = auparse_find_field(au, "op"); if (f) act = f; } if (act == NULL) act = normalize_record_map_i2s(type); if (act) D.action = strdup(act); // object if (type != AUDIT_USER_AVC) { auparse_first_record(au); D.thing.primary = find_simple_object(au, type); D.thing.secondary = find_simple_obj_secondary(au, type); D.thing.two = find_simple_obj_primary2(au, type); // object attrs - rare on simple events if (D.opt == NORM_OPT_ALL) { if (type == AUDIT_USER_DEVICE) { add_obj_attr(au, "uuid", 0); } else if (type == AUDIT_SOFTWARE_UPDATE) { auparse_first_record(au); add_obj_attr(au, "key_enforce", 0); add_obj_attr(au, "gpg_res", 0); } } } // how if (type == AUDIT_SYSTEM_BOOT) { D.thing.what = NORM_WHAT_SYSTEM; f = auparse_find_field(au, "exe"); if (f) { const char *exe = auparse_interpret_field(au); D.how = strdup(exe); } return 0; } else if (type == AUDIT_SYSTEM_SHUTDOWN) { D.thing.what = NORM_WHAT_SERVICE; f = auparse_find_field(au, "exe"); if (f) { const char *exe = auparse_interpret_field(au); D.how = strdup(exe); } return 0; } auparse_first_record(au); if (type == AUDIT_ANOM_EXEC) { f = auparse_find_field(au, "terminal"); if (f) { const char *term = auparse_interpret_field(au); D.how = strdup(term); } return 0; } if (type == AUDIT_TTY) { f = auparse_find_field(au, "comm"); if (f) { const char *comm = auparse_interpret_field(au); D.how = strdup(comm); } return 0; } f = auparse_find_field(au, "exe"); if (f) { const char *exe = auparse_interpret_field(au); D.how = strdup(exe); if (D.how == NULL) { fprintf(stderr, "Out of memory. Check %s file, %d line", __FILE__, __LINE__); return 1; } if ((strncmp(D.how, "/usr/bin/python", 15) == 0) || (strncmp(D.how, "/usr/bin/sh", 11) == 0) || (strncmp(D.how, "/usr/bin/bash", 13) == 0) || (strncmp(D.how, "/usr/bin/perl", 13) == 0)) { // comm should be the previous field if its there at all int fnum; if ((fnum = auparse_get_field_num(au)) > 0) auparse_goto_field_num(au, fnum - 1); else auparse_first_record(au); f = auparse_find_field(au, "comm"); if (f) { free((void *)D.how); exe = auparse_interpret_field(au); D.how = strdup(exe); } } } return 0; } /* * This is the main entry point for the normalization. This function * will analyze the current event to pick out the important pieces. */ int auparse_normalize(auparse_state_t *au, normalize_option_t opt) { int rc; unsigned num; auparse_first_record(au); num = auparse_get_num_records(au); // Reset cursor - no idea what we are being handed auparse_first_record(au); clear_normalizer(&D); D.opt = opt; // If we have more than one record in the event its a syscall based // event. Otherwise its a simple event with all pieces in the same // record. if (num > 1) rc = normalize_compound(au); else rc = normalize_simple(au); // Reset the cursor auparse_first_record(au); return rc; } /* * This function positions the internal cursor to the record and field that * the location refers to. * Returns: < 0 error, 0 uninitialized, 1 == success */ static int seek_field(auparse_state_t *au, value_t location) { int record, field, rc; if (is_unset(location)) return 0; record = get_record(location); field = get_field(location); rc = auparse_goto_record_num(au, record); if (rc != 1) return -1; rc = auparse_goto_field_num(au, field); if (rc != 1) return -2; return 1; } const char *auparse_normalize_get_event_kind(const auparse_state_t *au) { return D.evkind; } int auparse_normalize_session(auparse_state_t *au) { return seek_field(au, D.session); } int auparse_normalize_subject_primary(auparse_state_t *au) { return seek_field(au, D.actor.primary); } int auparse_normalize_subject_secondary(auparse_state_t *au) { return seek_field(au, D.actor.secondary); } const char *auparse_normalize_subject_kind(const auparse_state_t *au) { return D.actor.what; } // Returns: -1 = error, 0 uninitialized, 1 == success int auparse_normalize_subject_first_attribute(auparse_state_t *au) { if (D.actor.attr.cnt) { data_node *n; cllist_first(&D.actor.attr); n = cllist_get_cur(&D.actor.attr); if (n) return seek_field(au, n->num); } return 0; } // Returns: -1 = error, 0 uninitialized, 1 == success int auparse_normalize_subject_next_attribute(auparse_state_t *au) { if (D.actor.attr.cnt) { data_node *n; n = cllist_next(&D.actor.attr); if (n) return seek_field(au, n->num); } return 0; } const char *auparse_normalize_get_action(const auparse_state_t *au) { return D.action; } int auparse_normalize_object_primary(auparse_state_t *au) { return seek_field(au, D.thing.primary); } int auparse_normalize_object_secondary(auparse_state_t *au) { return seek_field(au, D.thing.secondary); } int auparse_normalize_object_primary2(auparse_state_t *au) { return seek_field(au, D.thing.two); } // Returns: -1 = error, 0 uninitialized, 1 == success int auparse_normalize_object_first_attribute(auparse_state_t *au) { if (D.thing.attr.cnt) { data_node *n; cllist_first(&D.thing.attr); n = cllist_get_cur(&D.thing.attr); if (n) return seek_field(au, n->num); } return 0; } // Returns: -1 = error, 0 uninitialized, 1 == success int auparse_normalize_object_next_attribute(auparse_state_t *au) { if (D.thing.attr.cnt) { data_node *n; n = cllist_next(&D.thing.attr); if (n) return seek_field(au, n->num); } return 0; } const char *auparse_normalize_object_kind(const auparse_state_t *au) { return normalize_obj_kind_map_i2s(D.thing.what); } int auparse_normalize_get_results(auparse_state_t *au) { return seek_field(au, D.results); } const char *auparse_normalize_how(const auparse_state_t *au) { return D.how; } int auparse_normalize_key(auparse_state_t *au) { return seek_field(au, D.key); } audit-4.0.2/auparse/pktoptnametab.h0000644001034500103450000000302414655201403012765 /* pktoptnametab.h -- * Copyright 2013-14,2020 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb * Location: include/uapi/linux/if_packet.h */ _S(1, "PACKET_ADD_MEMBERSHIP") _S(2, "PACKET_DROP_MEMBERSHIP") _S(3, "PACKET_RECV_OUTPUT") _S(5, "PACKET_RX_RING") _S(6, "PACKET_STATISTICS") _S(7, "PACKET_COPY_THRESH") _S(8, "PACKET_AUXDATA") _S(9, "PACKET_ORIGDEV") _S(10, "PACKET_VERSION") _S(11, "PACKET_HDRLEN") _S(12, "PACKET_RESERVE") _S(13, "PACKET_TX_RING") _S(14, "PACKET_LOSS") _S(15, "PACKET_VNET_HDR") _S(16, "PACKET_TX_TIMESTAMP") _S(17, "PACKET_TIMESTAMP") _S(18, "PACKET_FANOUT") _S(19, "PACKET_TX_HAS_OFF") _S(20, "PACKET_QDISC_BYPASS") _S(21, "PACKET_ROLLOVER_STATS") _S(22, "PACKET_FANOUT_DATA") _S(23, "PACKET_IGNORE_OUTGOING") _S(24, "PACKET_VNET_HDR_SZ") audit-4.0.2/auparse/test/0000755001034500103450000000000014655201457011014 5audit-4.0.2/auparse/test/lookup_test.c0000644001034500103450000002652514655201403013451 /* lookup_test.c -- A test of table lookups. * Copyright 2017 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; see the file COPYING. If not, write to the * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor * Boston, MA 02110-1335, USA. * * Authors: * Steve Grubb * Miloslav Trmač */ #include "config.h" #include #include #include #include #include #include #include "gen_tables.h" // To see if new tests are needed: // $ grep 'i2s(int v)' ../*.h | wc -l // 30 // only headers with i2s can be tested. /* Number of lookups of random strings */ #define RAND_ITERATIONS 1000 /* Maximum size of randomly generated strings, including the terminating NUL. */ #define S_LEN 8 struct entry { int val; const char *s; }; #define _S(V, S) { (V), (S) }, /* Generate a random string into DEST[S_LEN]. */ static void gen_id(char *dest) { size_t i, len; assert(S_LEN >= 2); len = 1 + rand() % (S_LEN - 1); assert('A' == 0x41 && 'a' == 0x61); /* ASCII */ for (i = 0; i < len; i++) { /* Don't start with a digit, audit_name_to_msg_type() interprets those strings specially. */ do { dest[i] = 0x21 + rand() % (0x7F - 0x21); } while (i == 0 && dest[i] >= '0' && dest[i] <= '9'); } dest[i] = '\0'; } static int debug = 0; #define TEST_I2S(EXCL) \ do { \ size_t i; \ \ for (i = 0; i < sizeof(t) / sizeof(*t); i++) { \ const char *s; \ \ if (EXCL) \ continue; \ s = I2S(t[i].val); \ if (s == NULL) { \ fprintf(stderr, \ "%d -> `%s' not found\n", \ t[i].val, t[i].s); \ abort(); \ } \ if (strcmp(t[i].s, s) != 0) { \ fprintf(stderr, \ "%d -> `%s' mismatch `%s'\n", \ t[i].val, t[i].s, s); \ abort(); \ } \ if (debug) printf("%d=%s\n", t[i].val, t[i].s); \ } \ for (i = 0; i < RAND_ITERATIONS; i++) { \ int val; \ size_t j; \ val = rand(); \ for (j = 0; j < sizeof(t) / sizeof(*t); j++) { \ if (t[j].val == val) \ goto test_i2s_found; \ } \ assert(I2S(val) == NULL); \ test_i2s_found: \ ; \ } \ } while (0) #define TEST_S2I(ERR_VALUE) \ do { \ size_t i; \ char buf[S_LEN]; \ \ for (i = 0; i < sizeof(t) / sizeof(*t); i++) \ assert(S2I(t[i].s) == t[i].val); \ for (i = 0; i < RAND_ITERATIONS; i++) { \ /* Blindly assuming this will not generate a \ meaningful identifier. */ \ gen_id(buf); \ if (S2I(buf) != (ERR_VALUE)) { \ fprintf(stderr, \ "Unexpected match `%s'\n", \ buf); \ abort(); \ } \ } \ } while (0) #include "../captabs.h" static void test_captab(void) { static const struct entry t[] = { #include "../captab.h" }; printf("Testing captab...\n"); #define I2S(I) cap_i2s(I) TEST_I2S(0); #undef I2S } #include "../clocktabs.h" static void test_clocktab(void) { static const struct entry t[] = { #include "../clocktab.h" }; printf("Testing clocktab...\n"); #define I2S(I) clock_i2s(I) TEST_I2S(0); #undef I2S } #include "../epoll_ctls.h" static void test_epoll_ctl(void) { static const struct entry t[] = { #include "../epoll_ctl.h" }; printf("Testing epoll_ctl...\n"); #define I2S(I) epoll_ctl_i2s(I) TEST_I2S(0); #undef I2S } #include #include "../famtabs.h" static void test_famtab(void) { static const struct entry t[] = { #include "../famtab.h" }; printf("Testing famtab...\n"); #define I2S(I) fam_i2s(I) TEST_I2S(0); #undef I2S } #include "../fcntl-cmdtabs.h" static void test_fcntltab(void) { static const struct entry t[] = { #include "../fcntl-cmdtab.h" }; printf("Testing fcntltab...\n"); #define I2S(I) fcntl_i2s(I) TEST_I2S(0); #undef I2S } #include "../fsconfigs.h" static void test_fsconfig(void) { static const struct entry t[] = { #include "../fsconfig.h" }; printf("Testing fsconfig...\n"); #define I2S(I) fsconfig_i2s(I) TEST_I2S(0); #undef I2S } #include "../icmptypetabs.h" static void test_icmptypetab(void) { static const struct entry t[] = { #include "../icmptypetab.h" }; printf("Testing icmptypetab...\n"); #define I2S(I) icmptype_i2s(I) TEST_I2S(0); #undef I2S } #include "../inethooktabs.h" static void test_inethooktab(void) { static const struct entry t[] = { #include "../inethooktab.h" }; printf("Testing inethooktab...\n"); #define I2S(I) inethook_i2s(I) TEST_I2S(0); #undef I2S } #include "../ioctlreqtabs.h" static void test_ioctlreqtab(void) { static const struct entry t[] = { #include "../ioctlreqtab.h" }; printf("Testing ioctlreqtab...\n"); #define I2S(I) ioctlreq_i2s(I) TEST_I2S(0); #undef I2S } #include "../ip6optnametabs.h" static void test_ip6optnametab(void) { static const struct entry t[] = { #include "../ip6optnametab.h" }; printf("Testing ip6optnametab...\n"); #define I2S(I) ip6optname_i2s(I) TEST_I2S(0); #undef I2S } #include #include "../ipctabs.h" static void test_ipctab(void) { static const struct entry t[] = { #include "../ipctab.h" }; printf("Testing ipctab...\n"); #define I2S(I) ipc_i2s(I) TEST_I2S(0); #undef I2S } #include "../ipoptnametabs.h" static void test_ipoptnametab(void) { static const struct entry t[] = { #include "../ipoptnametab.h" }; printf("Testing ipoptnametab...\n"); #define I2S(I) ipoptname_i2s(I) TEST_I2S(0); #undef I2S } #include "../netactiontabs.h" static void test_netactiontab(void) { static const struct entry t[] = { #include "../netactiontab.h" }; printf("Testing netactiontab...\n"); #define I2S(I) netaction_i2s(I) TEST_I2S(0); #undef I2S } #include "../nfprototabs.h" static void test_nfprototab(void) { static const struct entry t[] = { #include "../nfprototab.h" }; printf("Testing nfprototab...\n"); #define I2S(I) nfproto_i2s(I) TEST_I2S(0); #undef I2S } #include "../normalize_evtypetabs.h" static void test_evtypetab(void) { static const struct entry t[] = { #include "../normalize_evtypetab.h" }; printf("Testing evtypetab...\n"); #define I2S(I) evtype_i2s(I) TEST_I2S(0); #undef I2S } #include "../normalize_obj_kind_maps.h" static void test_normalize_obj_kind_map(void) { static const struct entry t[] = { #include "../normalize_obj_kind_map.h" }; printf("Testing normalize_obj_kind_map...\n"); #define I2S(I) normalize_obj_kind_map_i2s(I) TEST_I2S(0); #undef I2S } #include "libaudit.h" #include "../normalize_record_maps.h" static void test_normalize_record_map(void) { static const struct entry t[] = { #include "../normalize_record_map.h" }; printf("Testing normalize_record_map...\n"); #define I2S(I) normalize_record_map_i2s(I) TEST_I2S(0); #undef I2S } #include #include "../persontabs.h" static void test_persontab(void) { static const struct entry t[] = { #include "../persontab.h" }; printf("Testing persontab...\n"); #define I2S(I) person_i2s(I) TEST_I2S(0); #undef I2S } #include "../pktoptnametabs.h" static void test_pktoptnametab(void) { static const struct entry t[] = { #include "../pktoptnametab.h" }; printf("Testing pktoptnametab...\n"); #define I2S(I) pktoptname_i2s(I) TEST_I2S(0); #undef I2S } #include #include "../prctl_opttabs.h" static void test_prctl_opttab(void) { static const struct entry t[] = { #include "../prctl-opt-tab.h" }; printf("Testing prctl_opttab...\n"); #define I2S(I) prctl_opt_i2s(I) TEST_I2S(0); #undef I2S } #include "../ptracetabs.h" static void test_ptracetab(void) { static const struct entry t[] = { #include "../ptracetab.h" }; printf("Testing ptracetab...\n"); #define I2S(I) ptrace_i2s(I) TEST_I2S(0); #undef I2S } #include "../rlimittabs.h" static void test_rlimittab(void) { static const struct entry t[] = { #include "../rlimittab.h" }; printf("Testing rlimittab...\n"); #define I2S(I) rlimit_i2s(I) TEST_I2S(0); #undef I2S } #include #include "../schedtabs.h" static void test_schedtab(void) { static const struct entry t[] = { #include "../schedtab.h" }; printf("Testing schedtab...\n"); #define I2S(I) sched_i2s(I) TEST_I2S(0); #undef I2S } #include "../seccomptabs.h" static void test_seccomptab(void) { static const struct entry t[] = { #include "../seccomptab.h" }; printf("Testing seccomptab...\n"); #define I2S(I) seccomp_i2s(I) TEST_I2S(0); #undef I2S } #include "../seektabs.h" static void test_seektab(void) { static const struct entry t[] = { #include "../seektab.h" }; printf("Testing seektab...\n"); #define I2S(I) seek_i2s(I) TEST_I2S(0); #undef I2S } #include "../signaltabs.h" static void test_signaltab(void) { static const struct entry t[] = { #include "../signaltab.h" }; printf("Testing signaltab...\n"); #define I2S(I) signal_i2s(I) TEST_I2S(0); #undef I2S } #include "../sockleveltabs.h" static void test_sockleveltab(void) { static const struct entry t[] = { #include "../sockleveltab.h" }; printf("Testing sockleveltab...\n"); #define I2S(I) socklevel_i2s(I) TEST_I2S(0); #undef I2S } #include "../sockoptnametabs.h" static void test_sockoptnametab(void) { static const struct entry t[] = { #include "../sockoptnametab.h" }; printf("Testing sockoptnametab...\n"); #define I2S(I) sockoptname_i2s(I) TEST_I2S(0); #undef I2S } #include #include "../socktabs.h" static void test_socktab(void) { static const struct entry t[] = { #include "../socktab.h" }; printf("Testing socktab...\n"); #define I2S(I) sock_i2s(I) TEST_I2S(0); #undef I2S } #include "../socktypetabs.h" static void test_socktypetab(void) { static const struct entry t[] = { #include "../socktypetab.h" }; printf("Testing socktypetab...\n"); #define I2S(I) sock_type_i2s(I) TEST_I2S(0); #undef I2S } #include "../tcpoptnametabs.h" static void test_tcpoptnametab(void) { static const struct entry t[] = { #include "../tcpoptnametab.h" }; printf("Testing tcpoptnametab...\n"); #define I2S(I) tcpoptname_i2s(I) TEST_I2S(0); #undef I2S } int main(void) { // This is only for preventing collisions in s2i tests. // If collisions are found in future, change the number. srand(3); test_captab(); test_clocktab(); test_epoll_ctl(); test_famtab(); test_fcntltab(); test_fsconfig(); test_icmptypetab(); test_inethooktab(); test_ioctlreqtab(); test_ip6optnametab(); test_ipctab(); test_ipoptnametab(); test_netactiontab(); test_nfprototab(); test_evtypetab(); test_normalize_obj_kind_map(); test_normalize_record_map(); test_persontab(); test_pktoptnametab(); test_prctl_opttab(); test_ptracetab(); test_rlimittab(); test_schedtab(); test_seccomptab(); test_seektab(); test_signaltab(); test_sockleveltab(); test_sockoptnametab(); test_socktab(); test_socktypetab(); test_tcpoptnametab(); puts("==============================="); puts("Interpretation table tests pass"); puts("==============================="); return EXIT_SUCCESS; } audit-4.0.2/auparse/test/test2.log0000644001034500103450000000473314655201403012476 type=AVC msg=audit(1170021493.977:283): avc: denied { read } for pid=13010 comm="pickup" name="maildrop" dev=hda7 ino=14911367 scontext=system_u:system_r:postfix_pickup_t:s0 tcontext=system_u:object_r:postfix_spool_maildrop_t:s0 tclass=dir type=SYSCALL msg=audit(1170021493.977:283): arch=c000003e syscall=2 success=no exit=-13 a0=5555665d91b0 a1=10800 a2=5555665d91b8 a3=0 items=1 ppid=2013 pid=13010 auid=4294967295 uid=890 gid=890 euid=890 suid=890 fsuid=890 egid=890 sgid=890 fsgid=890 tty=(none) comm="pickup" exe="/usr/libexec/postfix/pickup" subj=system_u:system_r:postfix_pickup_t:s0 key=(null) type=CWD msg=audit(1170021493.977:283): cwd="/var/spool/postfix" type=PATH msg=audit(1170021493.977:283): item=0 name="maildrop" inode=14911367 dev=03:07 mode=040730 ouid=890 ogid=891 rdev=00:00 obj=system_u:object_r:postfix_spool_maildrop_t:s0 type=USER_ACCT msg=audit(1170021601.340:284): user pid=13015 uid=0 auid=4294967295 subj=system_u:system_r:crond_t:s0-s0:c0.c1023 msg='PAM: accounting acct=root : exe="/usr/sbin/crond" hostname=? addr=? terminal=cron res=success' type=CRED_ACQ msg=audit(1170021601.342:285): user pid=13015 uid=0 auid=4294967295 subj=system_u:system_r:crond_t:s0-s0:c0.c1023 msg='PAM: setcred acct=root : exe="/usr/sbin/crond" hostname=? addr=? terminal=cron res=success' type=LOGIN msg=audit(1170021601.343:286): pid=2288 uid=0 subj=system_u:system_r:init_t:s0 old-auid=4294967295 auid=42 tty=(none) old-ses=4294967295 ses=1 res=1 type=SYSCALL msg=audit(1170021601.343:286): arch=c000003e syscall=1 success=yes exit=2 a0=8 a1=7fffa7aede20 a2=2 a3=0 items=0 ppid=1 pid=2288 auid=42 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=1 comm="(systemd)" exe="/usr/lib/systemd/systemd" subj=system_u:system_r:init_t:s0 key=(null) type=PROCTITLE msg=audit(1170021601.343:286): proctitle="(systemd)" type=USER_START msg=audit(1170021601.344:287): user pid=13015 uid=0 auid=0 subj=system_u:system_r:crond_t:s0-s0:c0.c1023 msg='PAM: session open acct=root : exe="/usr/sbin/crond" (hostname=?, addr=?, terminal=cron res=success)' type=CRED_DISP msg=audit(1170021601.364:288): user pid=13015 uid=0 auid=0 subj=system_u:system_r:crond_t:s0-s0:c0.c1023 msg='PAM: setcred acct=root : exe="/usr/sbin/crond" (hostname=?, addr=?, terminal=cron res=success)' type=USER_END msg=audit(1170021601.366:289): user pid=13015 uid=0 auid=0 subj=system_u:system_r:crond_t:s0-s0:c0.c1023 msg='PAM: session close acct=root : exe="/usr/sbin/crond" (hostname=?, addr=?, terminal=cron res=success)' audit-4.0.2/auparse/test/Makefile.in0000644001034500103450000006255414655201422013005 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am -- # Copyright 2006-08,2014-17 Red Hat Inc. # All Rights Reserved. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Authors: # Steve Grubb # 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@ check_PROGRAMS = auparse_test$(EXEEXT) auparselol_test$(EXEEXT) \ lookup_test$(EXEEXT) subdir = auparse/test ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prog_cc_for_build.m4 \ $(top_srcdir)/m4/cap-ng.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/src/libev/libev.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(dist_check_SCRIPTS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_VPATH_FILES = am_auparse_test_OBJECTS = auparse_test.$(OBJEXT) auparse_test_OBJECTS = $(am_auparse_test_OBJECTS) auparse_test_DEPENDENCIES = ${top_builddir}/auparse/libauparse.la \ ${top_builddir}/lib/libaudit.la \ ${top_builddir}/common/libaucommon.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = auparse_test_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(auparse_test_LDFLAGS) $(LDFLAGS) -o $@ am_auparselol_test_OBJECTS = auparselol_test.$(OBJEXT) auparselol_test_OBJECTS = $(am_auparselol_test_OBJECTS) auparselol_test_DEPENDENCIES = ${top_builddir}/auparse/libauparse.la \ ${top_builddir}/lib/libaudit.la \ ${top_builddir}/common/libaucommon.la auparselol_test_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(auparselol_test_LDFLAGS) $(LDFLAGS) \ -o $@ am_lookup_test_OBJECTS = lookup_test.$(OBJEXT) lookup_test_OBJECTS = $(am_lookup_test_OBJECTS) lookup_test_DEPENDENCIES = ${top_builddir}/auparse/libauparse.la \ ${top_builddir}/lib/libaudit.la \ ${top_builddir}/common/libaucommon.la lookup_test_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(lookup_test_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/auparse_test.Po \ ./$(DEPDIR)/auparselol_test.Po ./$(DEPDIR)/lookup_test.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(auparse_test_SOURCES) $(auparselol_test_SOURCES) \ $(lookup_test_SOURCES) DIST_SOURCES = $(auparse_test_SOURCES) $(auparselol_test_SOURCES) \ $(lookup_test_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILD_EXEEXT = @BUILD_EXEEXT@ BUILD_OBJEXT = @BUILD_OBJEXT@ CAPNG_LDADD = @CAPNG_LDADD@ CAPNG_PKG = @CAPNG_PKG@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_FOR_BUILD = @CC_FOR_BUILD@ CFLAGS = @CFLAGS@ CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ CPP_FOR_BUILD = @CPP_FOR_BUILD@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG = @DEBUG@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GOLANG = @GOLANG@ GOROOT = @GOROOT@ 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@ LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBWRAP_LIBS = @LIBWRAP_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PYTHON = @PYTHON@ PYTHON3_CFLAGS = @PYTHON3_CFLAGS@ PYTHON3_INCLUDES = @PYTHON3_INCLUDES@ PYTHON3_LIBS = @PYTHON3_LIBS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ VERSION = @VERSION@ WFLAGS = @WFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CC_FOR_BUILD = @ac_ct_CC_FOR_BUILD@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gss_libs = @gss_libs@ 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@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ use_python3 = @use_python3@ CONFIG_CLEAN_FILES = *.loT *.rej *.orig *.cur dist_check_SCRIPTS = auparse_test.py EXTRA_DIST = auparse_test.ref auparse_test.ref.py test.log test2.log test3.log test4.log auditd_raw.sed AM_CPPFLAGS = -I${top_srcdir}/auparse -I${top_srcdir}/lib lookup_test_SOURCES = lookup_test.c lookup_test_LDFLAGS = -static lookup_test_LDADD = ${top_builddir}/auparse/libauparse.la \ ${top_builddir}/lib/libaudit.la ${top_builddir}/common/libaucommon.la auparse_test_SOURCES = auparse_test.c auparse_test_LDFLAGS = -static auparse_test_LDADD = ${top_builddir}/auparse/libauparse.la \ ${top_builddir}/lib/libaudit.la ${top_builddir}/common/libaucommon.la auparselol_test_SOURCES = auparselol_test.c auparselol_test_LDFLAGS = -static auparselol_test_LDADD = ${top_builddir}/auparse/libauparse.la \ ${top_builddir}/lib/libaudit.la ${top_builddir}/common/libaucommon.la drop_srcdir = sed 's,$(srcdir)/test,test,' all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu auparse/test/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu auparse/test/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-checkPROGRAMS: @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list auparse_test$(EXEEXT): $(auparse_test_OBJECTS) $(auparse_test_DEPENDENCIES) $(EXTRA_auparse_test_DEPENDENCIES) @rm -f auparse_test$(EXEEXT) $(AM_V_CCLD)$(auparse_test_LINK) $(auparse_test_OBJECTS) $(auparse_test_LDADD) $(LIBS) auparselol_test$(EXEEXT): $(auparselol_test_OBJECTS) $(auparselol_test_DEPENDENCIES) $(EXTRA_auparselol_test_DEPENDENCIES) @rm -f auparselol_test$(EXEEXT) $(AM_V_CCLD)$(auparselol_test_LINK) $(auparselol_test_OBJECTS) $(auparselol_test_LDADD) $(LIBS) lookup_test$(EXEEXT): $(lookup_test_OBJECTS) $(lookup_test_DEPENDENCIES) $(EXTRA_lookup_test_DEPENDENCIES) @rm -f lookup_test$(EXEEXT) $(AM_V_CCLD)$(lookup_test_LINK) $(lookup_test_OBJECTS) $(lookup_test_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/auparse_test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/auparselol_test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lookup_test.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) \ $(dist_check_SCRIPTS) $(MAKE) $(AM_MAKEFLAGS) check-local check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/auparse_test.Po -rm -f ./$(DEPDIR)/auparselol_test.Po -rm -f ./$(DEPDIR)/lookup_test.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/auparse_test.Po -rm -f ./$(DEPDIR)/auparselol_test.Po -rm -f ./$(DEPDIR)/lookup_test.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am \ check-local clean clean-checkPROGRAMS clean-generic \ clean-libtool cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile check-local: auparse_test auparselol_test lookup_test test "$(top_srcdir)" = "$(top_builddir)" || \ cp $(top_srcdir)/auparse/test/test*.log . LC_ALL=C \ ./auparse_test > auparse_test.cur diff -u $(top_srcdir)/auparse/test/auparse_test.ref auparse_test.cur ./auparselol_test -f test3.log --check | sort > auparse_test.cur sed -f $(top_srcdir)/auparse/test/auditd_raw.sed test3.log | sort > auparse_test.raw diff -u auparse_test.raw auparse_test.cur @USE_PYTHON3_TRUE@ cp ${top_builddir}/bindings/swig/python3/.libs/_audit.so ${top_builddir}/bindings/swig/python3 @USE_PYTHON3_TRUE@ PYTHONPATH=${top_builddir}/bindings/python/python3/.libs/ \ @USE_PYTHON3_TRUE@ PYTHONDONTWRITEBYTECODE=1 \ @USE_PYTHON3_TRUE@ LD_LIBRARY_PATH=${top_builddir}/auparse/.libs \ @USE_PYTHON3_TRUE@ srcdir=$(srcdir) $(srcdir)/auparse_test.py \ @USE_PYTHON3_TRUE@ | $(drop_srcdir) > auparse_test.cur @USE_PYTHON3_TRUE@ diff -u $(top_srcdir)/auparse/test/auparse_test.ref.py auparse_test.cur ./lookup_test echo -e "===================\nAuparse Test Passes\n===================" diffcheck: auparse_test auparselol_test ./auparse_test > auparse_test.cur diff -u $(srcdir)/auparse_test.ref auparse_test.cur ./auparselol_test -f test3.log --check | sort > auparse_test.cur sed -f ./auditd_raw.sed test3.log | sort > auparse_test.raw diff -u auparse_test.raw auparse_test.cur memcheck: auparse_test valgrind --leak-check=yes --show-reachable=yes ./auparse_test pycheck: auparse_test.py @USE_PYTHON3_TRUE@ PYTHONPATH=${top_builddir}/bindings/python/python3/.libs/ \ @USE_PYTHON3_TRUE@ PYTHONDONTWRITEBYTECODE=1 \ @USE_PYTHON3_TRUE@ LD_LIBRARY_PATH=${top_builddir}/auparse/.libs \ @USE_PYTHON3_TRUE@ srcdir=$(srcdir) $(srcdir)/auparse_test.py pydiffcheck: auparse_test.py @USE_PYTHON3_TRUE@ PYTHONPATH=${top_builddir}/bindings/python/python3/.libs/ \ @USE_PYTHON3_TRUE@ PYTHONDONTWRITEBYTECODE=1 \ @USE_PYTHON3_TRUE@ LD_LIBRARY_PATH=${top_builddir}/auparse/.libs \ @USE_PYTHON3_TRUE@ srcdir=$(srcdir) $(srcdir)/auparse_test.py \ @USE_PYTHON3_TRUE@ | $(drop_srcdir) > auparse_test.cur @USE_PYTHON3_TRUE@ diff -u $(srcdir)/auparse_test.ref.py auparse_test.cur pymemcheck: auparse_test.py @USE_PYTHON3_TRUE@ PYTHONPATH=${top_builddir}/bindings/python/python3/.libs/ \ @USE_PYTHON3_TRUE@ PYTHONDONTWRITEBYTECODE=1 \ @USE_PYTHON3_TRUE@ LD_LIBRARY_PATH=${top_builddir}/auparse/.libs srcdir=$(srcdir) valgrind --leak-check=yes --show-reachable=yes python $(srcdir)/auparse_test.py @USE_PYTHON3_TRUE@${top_builddir}/bindings/python/build/*/auparse.so: ${top_srcdir}/bindings/python/auparse_python.c @USE_PYTHON3_TRUE@ cd ${top_builddir}/bindings/python && make clean-generic: $(RM) *.cur $(RM) auparse_test.raw @USE_PYTHON3_TRUE@ $(RM) ${top_builddir}/bindings/swig/python3/_audit.so test "$(top_srcdir)" = "$(top_builddir)" || $(RM) test*.log # 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: audit-4.0.2/auparse/test/Makefile.am0000644001034500103450000001040114655201403012753 # Makefile.am -- # Copyright 2006-08,2014-17 Red Hat Inc. # All Rights Reserved. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Authors: # Steve Grubb # CONFIG_CLEAN_FILES = *.loT *.rej *.orig *.cur check_PROGRAMS = auparse_test auparselol_test lookup_test dist_check_SCRIPTS = auparse_test.py EXTRA_DIST = auparse_test.ref auparse_test.ref.py test.log test2.log test3.log test4.log auditd_raw.sed AM_CPPFLAGS = -I${top_srcdir}/auparse -I${top_srcdir}/lib lookup_test_SOURCES = lookup_test.c lookup_test_LDFLAGS = -static lookup_test_LDADD = ${top_builddir}/auparse/libauparse.la \ ${top_builddir}/lib/libaudit.la ${top_builddir}/common/libaucommon.la auparse_test_SOURCES = auparse_test.c auparse_test_LDFLAGS = -static auparse_test_LDADD = ${top_builddir}/auparse/libauparse.la \ ${top_builddir}/lib/libaudit.la ${top_builddir}/common/libaucommon.la auparselol_test_SOURCES = auparselol_test.c auparselol_test_LDFLAGS = -static auparselol_test_LDADD = ${top_builddir}/auparse/libauparse.la \ ${top_builddir}/lib/libaudit.la ${top_builddir}/common/libaucommon.la drop_srcdir = sed 's,$(srcdir)/test,test,' check-local: auparse_test auparselol_test lookup_test test "$(top_srcdir)" = "$(top_builddir)" || \ cp $(top_srcdir)/auparse/test/test*.log . LC_ALL=C \ ./auparse_test > auparse_test.cur diff -u $(top_srcdir)/auparse/test/auparse_test.ref auparse_test.cur ./auparselol_test -f test3.log --check | sort > auparse_test.cur sed -f $(top_srcdir)/auparse/test/auditd_raw.sed test3.log | sort > auparse_test.raw diff -u auparse_test.raw auparse_test.cur if USE_PYTHON3 cp ${top_builddir}/bindings/swig/python3/.libs/_audit.so ${top_builddir}/bindings/swig/python3 PYTHONPATH=${top_builddir}/bindings/python/python3/.libs/ \ PYTHONDONTWRITEBYTECODE=1 \ LD_LIBRARY_PATH=${top_builddir}/auparse/.libs \ srcdir=$(srcdir) $(srcdir)/auparse_test.py \ | $(drop_srcdir) > auparse_test.cur diff -u $(top_srcdir)/auparse/test/auparse_test.ref.py auparse_test.cur endif ./lookup_test echo -e "===================\nAuparse Test Passes\n===================" diffcheck: auparse_test auparselol_test ./auparse_test > auparse_test.cur diff -u $(srcdir)/auparse_test.ref auparse_test.cur ./auparselol_test -f test3.log --check | sort > auparse_test.cur sed -f ./auditd_raw.sed test3.log | sort > auparse_test.raw diff -u auparse_test.raw auparse_test.cur memcheck: auparse_test valgrind --leak-check=yes --show-reachable=yes ./auparse_test pycheck: auparse_test.py if USE_PYTHON3 PYTHONPATH=${top_builddir}/bindings/python/python3/.libs/ \ PYTHONDONTWRITEBYTECODE=1 \ LD_LIBRARY_PATH=${top_builddir}/auparse/.libs \ srcdir=$(srcdir) $(srcdir)/auparse_test.py endif pydiffcheck: auparse_test.py if USE_PYTHON3 PYTHONPATH=${top_builddir}/bindings/python/python3/.libs/ \ PYTHONDONTWRITEBYTECODE=1 \ LD_LIBRARY_PATH=${top_builddir}/auparse/.libs \ srcdir=$(srcdir) $(srcdir)/auparse_test.py \ | $(drop_srcdir) > auparse_test.cur diff -u $(srcdir)/auparse_test.ref.py auparse_test.cur endif pymemcheck: auparse_test.py if USE_PYTHON3 PYTHONPATH=${top_builddir}/bindings/python/python3/.libs/ \ PYTHONDONTWRITEBYTECODE=1 \ LD_LIBRARY_PATH=${top_builddir}/auparse/.libs srcdir=$(srcdir) valgrind --leak-check=yes --show-reachable=yes python $(srcdir)/auparse_test.py ${top_builddir}/bindings/python/build/*/auparse.so: ${top_srcdir}/bindings/python/auparse_python.c cd ${top_builddir}/bindings/python && make endif clean-generic: $(RM) *.cur $(RM) auparse_test.raw if USE_PYTHON3 $(RM) ${top_builddir}/bindings/swig/python3/_audit.so endif test "$(top_srcdir)" = "$(top_builddir)" || $(RM) test*.log audit-4.0.2/auparse/test/auparse_test.ref.py0000644001034500103450000015346214655201403014562 Starting Test 1, iterate... auid=4294967295 interp auid=unset auid=848 interp auid=unknown(848) auid=848 interp auid=unknown(848) Test 1 Done Starting Test 2, walk events, records, and fields... event 1 has 1 records record 1 of type 1006(LOGIN) has 5 fields line=1 file=None event time: 1143146623.787:142, host=(null) type=LOGIN (LOGIN) pid=2027 (2027) uid=0 (root) auid=4294967295 (unset) auid=848 (unknown(848)) event 2 has 1 records record 1 of type 1300(SYSCALL) has 24 fields line=2 file=None event time: 1143146623.875:143, host=(null) type=SYSCALL (SYSCALL) arch=c000003e (x86_64) syscall=188 (setxattr) success=yes (yes) exit=0 (0) a0=7fffffa9a9f0 (0x7fffffa9a9f0) a1=3958d11333 (0x3958d11333) a2=5131f0 (0x5131f0) a3=20 (0x20) items=1 (1) pid=2027 (2027) auid=848 (unknown(848)) uid=0 (root) gid=0 (root) euid=0 (root) suid=0 (root) fsuid=0 (root) egid=0 (root) sgid=0 (root) fsgid=0 (root) tty=tty3 (tty3) comm="login" (login) exe="/bin/login" (/bin/login) subj=system_u:system_r:local_login_t:s0-s0:c0.c255 (system_u:system_r:local_login_t:s0-s0:c0.c255) event 3 has 1 records record 1 of type 1112(USER_LOGIN) has 10 fields line=3 file=None event time: 1143146623.879:146, host=(null) type=USER_LOGIN (USER_LOGIN) pid=2027 (2027) uid=0 (root) auid=848 (unknown(848)) uid=848 (unknown(848)) exe="/bin/login" (/bin/login) hostname=? (?) addr=? (?) terminal=tty3 (tty3) res=success (success) Test 2 Done Starting Test 3, walk events, records of 1 buffer... event has 1 records record 1 of type 1112(USER_LOGIN) has 10 fields line=1 file=None event time: 1143146623.879:146, host=(null) Test 3 Done Starting Test 4, walk events, records of 1 file... event 1 has 4 records record 1 of type 1400(AVC) has 11 fields line=1 file=test.log event time: 1170021493.977:293, host=(null) type=AVC (AVC) seresult=denied (denied) seperms=read,write (read,write) pid=13010 (13010) comm="pickup" (pickup) name="maildrop" (maildrop) dev=hda7 (hda7) ino=14911367 (14911367) scontext=system_u:system_r:postfix_pickup_t:s0 (system_u:system_r:postfix_pickup_t:s0) tcontext=system_u:object_r:postfix_spool_maildrop_t:s0 (system_u:object_r:postfix_spool_maildrop_t:s0) tclass=dir (dir) record 2 of type 1300(SYSCALL) has 26 fields line=2 file=test.log event time: 1170021493.977:293, host=(null) type=SYSCALL (SYSCALL) arch=c000003e (x86_64) syscall=2 (open) success=no (no) exit=-13 (EACCES(Permission denied)) a0=5555665d91b0 (0x5555665d91b0) a1=10800 (O_RDONLY|O_NONBLOCK|O_DIRECTORY) a2=5555665d91b8 (0x5555665d91b8) a3=0 (0x0) items=1 (1) ppid=2013 (2013) pid=13010 (13010) auid=4294967295 (unset) uid=890 (unknown(890)) gid=890 (unknown(890)) euid=890 (unknown(890)) suid=890 (unknown(890)) fsuid=890 (unknown(890)) egid=890 (unknown(890)) sgid=890 (unknown(890)) fsgid=890 (unknown(890)) tty=(none) ((none)) comm="pickup" (pickup) exe="/usr/libexec/postfix/pickup" (/usr/libexec/postfix/pickup) subj=system_u:system_r:postfix_pickup_t:s0 (system_u:system_r:postfix_pickup_t:s0) key=(null) ((null)) record 3 of type 1307(CWD) has 2 fields line=3 file=test.log event time: 1170021493.977:293, host=(null) type=CWD (CWD) cwd="/var/spool/postfix" (/var/spool/postfix) record 4 of type 1302(PATH) has 10 fields line=4 file=test.log event time: 1170021493.977:293, host=(null) type=PATH (PATH) item=0 (0) name="maildrop" (maildrop) inode=14911367 (14911367) dev=03:07 (03:07) mode=040730 (dir,730) ouid=890 (unknown(890)) ogid=891 (unknown(891)) rdev=00:00 (00:00) obj=system_u:object_r:postfix_spool_maildrop_t:s0 (system_u:object_r:postfix_spool_maildrop_t:s0) event 2 has 1 records record 1 of type 1101(USER_ACCT) has 11 fields line=5 file=test.log event time: 1170021601.340:294, host=(null) type=USER_ACCT (USER_ACCT) pid=13015 (13015) uid=0 (root) auid=4294967295 (unset) subj=system_u:system_r:crond_t:s0-s0:c0.c1023 (system_u:system_r:crond_t:s0-s0:c0.c1023) acct=root (root) exe="/usr/sbin/crond" (/usr/sbin/crond) hostname=? (?) addr=? (?) terminal=cron (cron) res=success (success) event 3 has 1 records record 1 of type 1103(CRED_ACQ) has 11 fields line=6 file=test.log event time: 1170021601.342:295, host=(null) type=CRED_ACQ (CRED_ACQ) pid=13015 (13015) uid=0 (root) auid=4294967295 (unset) subj=system_u:system_r:crond_t:s0-s0:c0.c1023 (system_u:system_r:crond_t:s0-s0:c0.c1023) acct=root (root) exe="/usr/sbin/crond" (/usr/sbin/crond) hostname=? (?) addr=? (?) terminal=cron (cron) res=success (success) event 4 has 3 records record 1 of type 1006(LOGIN) has 10 fields line=7 file=test.log event time: 1170021601.343:296, host=(null) type=LOGIN (LOGIN) pid=2288 (2288) uid=0 (root) subj=system_u:system_r:init_t:s0 (system_u:system_r:init_t:s0) old-auid=4294967295 (unset) auid=42 (gdm) tty=(none) ((none)) old-ses=4294967295 (4294967295) ses=1 (1) res=1 (yes) record 2 of type 1300(SYSCALL) has 27 fields line=8 file=test.log event time: 1170021601.343:296, host=(null) type=SYSCALL (SYSCALL) arch=c000003e (x86_64) syscall=1 (write) success=yes (yes) exit=2 (2) a0=8 (0x8) a1=7fffa7aede20 (0x7fffa7aede20) a2=2 (0x2) a3=0 (0x0) items=0 (0) ppid=1 (1) pid=2288 (2288) auid=42 (gdm) uid=0 (root) gid=0 (root) euid=0 (root) suid=0 (root) fsuid=0 (root) egid=0 (root) sgid=0 (root) fsgid=0 (root) tty=(none) ((none)) ses=1 (1) comm="(systemd)" ((systemd)) exe="/usr/lib/systemd/systemd" (/usr/lib/systemd/systemd) subj=system_u:system_r:init_t:s0 (system_u:system_r:init_t:s0) key=(null) ((null)) record 3 of type 1327(PROCTITLE) has 2 fields line=9 file=test.log event time: 1170021601.343:296, host=(null) type=PROCTITLE (PROCTITLE) proctitle="(systemd)" ((systemd)) event 5 has 1 records record 1 of type 1105(USER_START) has 11 fields line=10 file=test.log event time: 1170021601.344:297, host=(null) type=USER_START (USER_START) pid=13015 (13015) uid=0 (root) auid=0 (root) subj=system_u:system_r:crond_t:s0-s0:c0.c1023 (system_u:system_r:crond_t:s0-s0:c0.c1023) acct=root (root) exe="/usr/sbin/crond" (/usr/sbin/crond) hostname=? (?) addr=? (?) terminal=cron (cron) res=success (success) event 6 has 1 records record 1 of type 1104(CRED_DISP) has 11 fields line=11 file=test.log event time: 1170021601.364:298, host=(null) type=CRED_DISP (CRED_DISP) pid=13015 (13015) uid=0 (root) auid=0 (root) subj=system_u:system_r:crond_t:s0-s0:c0.c1023 (system_u:system_r:crond_t:s0-s0:c0.c1023) acct=root (root) exe="/usr/sbin/crond" (/usr/sbin/crond) hostname=? (?) addr=? (?) terminal=cron (cron) res=success (success) event 7 has 1 records record 1 of type 1106(USER_END) has 11 fields line=12 file=test.log event time: 1170021601.366:299, host=(null) type=USER_END (USER_END) pid=13015 (13015) uid=0 (root) auid=0 (root) subj=system_u:system_r:crond_t:s0-s0:c0.c1023 (system_u:system_r:crond_t:s0-s0:c0.c1023) acct=root (root) exe="/usr/sbin/crond" (/usr/sbin/crond) hostname=? (?) addr=? (?) terminal=cron (cron) res=success (success) Test 4 Done Starting Test 5, walk events, records of 2 files... event 1 has 4 records record 1 of type 1400(AVC) has 11 fields line=1 file=test2.log event time: 1170021493.977:283, host=(null) type=AVC (AVC) seresult=denied (denied) seperms=read (read) pid=13010 (13010) comm="pickup" (pickup) name="maildrop" (maildrop) dev=hda7 (hda7) ino=14911367 (14911367) scontext=system_u:system_r:postfix_pickup_t:s0 (system_u:system_r:postfix_pickup_t:s0) tcontext=system_u:object_r:postfix_spool_maildrop_t:s0 (system_u:object_r:postfix_spool_maildrop_t:s0) tclass=dir (dir) record 2 of type 1300(SYSCALL) has 26 fields line=2 file=test2.log event time: 1170021493.977:283, host=(null) type=SYSCALL (SYSCALL) arch=c000003e (x86_64) syscall=2 (open) success=no (no) exit=-13 (EACCES(Permission denied)) a0=5555665d91b0 (0x5555665d91b0) a1=10800 (O_RDONLY|O_NONBLOCK|O_DIRECTORY) a2=5555665d91b8 (0x5555665d91b8) a3=0 (0x0) items=1 (1) ppid=2013 (2013) pid=13010 (13010) auid=4294967295 (unset) uid=890 (unknown(890)) gid=890 (unknown(890)) euid=890 (unknown(890)) suid=890 (unknown(890)) fsuid=890 (unknown(890)) egid=890 (unknown(890)) sgid=890 (unknown(890)) fsgid=890 (unknown(890)) tty=(none) ((none)) comm="pickup" (pickup) exe="/usr/libexec/postfix/pickup" (/usr/libexec/postfix/pickup) subj=system_u:system_r:postfix_pickup_t:s0 (system_u:system_r:postfix_pickup_t:s0) key=(null) ((null)) record 3 of type 1307(CWD) has 2 fields line=3 file=test2.log event time: 1170021493.977:283, host=(null) type=CWD (CWD) cwd="/var/spool/postfix" (/var/spool/postfix) record 4 of type 1302(PATH) has 10 fields line=4 file=test2.log event time: 1170021493.977:283, host=(null) type=PATH (PATH) item=0 (0) name="maildrop" (maildrop) inode=14911367 (14911367) dev=03:07 (03:07) mode=040730 (dir,730) ouid=890 (unknown(890)) ogid=891 (unknown(891)) rdev=00:00 (00:00) obj=system_u:object_r:postfix_spool_maildrop_t:s0 (system_u:object_r:postfix_spool_maildrop_t:s0) event 2 has 1 records record 1 of type 1101(USER_ACCT) has 11 fields line=5 file=test2.log event time: 1170021601.340:284, host=(null) type=USER_ACCT (USER_ACCT) pid=13015 (13015) uid=0 (root) auid=4294967295 (unset) subj=system_u:system_r:crond_t:s0-s0:c0.c1023 (system_u:system_r:crond_t:s0-s0:c0.c1023) acct=root (root) exe="/usr/sbin/crond" (/usr/sbin/crond) hostname=? (?) addr=? (?) terminal=cron (cron) res=success (success) event 3 has 1 records record 1 of type 1103(CRED_ACQ) has 11 fields line=6 file=test2.log event time: 1170021601.342:285, host=(null) type=CRED_ACQ (CRED_ACQ) pid=13015 (13015) uid=0 (root) auid=4294967295 (unset) subj=system_u:system_r:crond_t:s0-s0:c0.c1023 (system_u:system_r:crond_t:s0-s0:c0.c1023) acct=root (root) exe="/usr/sbin/crond" (/usr/sbin/crond) hostname=? (?) addr=? (?) terminal=cron (cron) res=success (success) event 4 has 3 records record 1 of type 1006(LOGIN) has 10 fields line=7 file=test2.log event time: 1170021601.343:286, host=(null) type=LOGIN (LOGIN) pid=2288 (2288) uid=0 (root) subj=system_u:system_r:init_t:s0 (system_u:system_r:init_t:s0) old-auid=4294967295 (unset) auid=42 (gdm) tty=(none) ((none)) old-ses=4294967295 (4294967295) ses=1 (1) res=1 (yes) record 2 of type 1300(SYSCALL) has 27 fields line=8 file=test2.log event time: 1170021601.343:286, host=(null) type=SYSCALL (SYSCALL) arch=c000003e (x86_64) syscall=1 (write) success=yes (yes) exit=2 (2) a0=8 (0x8) a1=7fffa7aede20 (0x7fffa7aede20) a2=2 (0x2) a3=0 (0x0) items=0 (0) ppid=1 (1) pid=2288 (2288) auid=42 (gdm) uid=0 (root) gid=0 (root) euid=0 (root) suid=0 (root) fsuid=0 (root) egid=0 (root) sgid=0 (root) fsgid=0 (root) tty=(none) ((none)) ses=1 (1) comm="(systemd)" ((systemd)) exe="/usr/lib/systemd/systemd" (/usr/lib/systemd/systemd) subj=system_u:system_r:init_t:s0 (system_u:system_r:init_t:s0) key=(null) ((null)) record 3 of type 1327(PROCTITLE) has 2 fields line=9 file=test2.log event time: 1170021601.343:286, host=(null) type=PROCTITLE (PROCTITLE) proctitle="(systemd)" ((systemd)) event 5 has 1 records record 1 of type 1105(USER_START) has 11 fields line=10 file=test2.log event time: 1170021601.344:287, host=(null) type=USER_START (USER_START) pid=13015 (13015) uid=0 (root) auid=0 (root) subj=system_u:system_r:crond_t:s0-s0:c0.c1023 (system_u:system_r:crond_t:s0-s0:c0.c1023) acct=root (root) exe="/usr/sbin/crond" (/usr/sbin/crond) hostname=? (?) addr=? (?) terminal=cron (cron) res=success (success) event 6 has 1 records record 1 of type 1104(CRED_DISP) has 11 fields line=11 file=test2.log event time: 1170021601.364:288, host=(null) type=CRED_DISP (CRED_DISP) pid=13015 (13015) uid=0 (root) auid=0 (root) subj=system_u:system_r:crond_t:s0-s0:c0.c1023 (system_u:system_r:crond_t:s0-s0:c0.c1023) acct=root (root) exe="/usr/sbin/crond" (/usr/sbin/crond) hostname=? (?) addr=? (?) terminal=cron (cron) res=success (success) event 7 has 1 records record 1 of type 1106(USER_END) has 11 fields line=12 file=test2.log event time: 1170021601.366:289, host=(null) type=USER_END (USER_END) pid=13015 (13015) uid=0 (root) auid=0 (root) subj=system_u:system_r:crond_t:s0-s0:c0.c1023 (system_u:system_r:crond_t:s0-s0:c0.c1023) acct=root (root) exe="/usr/sbin/crond" (/usr/sbin/crond) hostname=? (?) addr=? (?) terminal=cron (cron) res=success (success) event 8 has 4 records record 1 of type 1400(AVC) has 11 fields line=1 file=test.log event time: 1170021493.977:293, host=(null) type=AVC (AVC) seresult=denied (denied) seperms=read,write (read,write) pid=13010 (13010) comm="pickup" (pickup) name="maildrop" (maildrop) dev=hda7 (hda7) ino=14911367 (14911367) scontext=system_u:system_r:postfix_pickup_t:s0 (system_u:system_r:postfix_pickup_t:s0) tcontext=system_u:object_r:postfix_spool_maildrop_t:s0 (system_u:object_r:postfix_spool_maildrop_t:s0) tclass=dir (dir) record 2 of type 1300(SYSCALL) has 26 fields line=2 file=test.log event time: 1170021493.977:293, host=(null) type=SYSCALL (SYSCALL) arch=c000003e (x86_64) syscall=2 (open) success=no (no) exit=-13 (EACCES(Permission denied)) a0=5555665d91b0 (0x5555665d91b0) a1=10800 (O_RDONLY|O_NONBLOCK|O_DIRECTORY) a2=5555665d91b8 (0x5555665d91b8) a3=0 (0x0) items=1 (1) ppid=2013 (2013) pid=13010 (13010) auid=4294967295 (unset) uid=890 (unknown(890)) gid=890 (unknown(890)) euid=890 (unknown(890)) suid=890 (unknown(890)) fsuid=890 (unknown(890)) egid=890 (unknown(890)) sgid=890 (unknown(890)) fsgid=890 (unknown(890)) tty=(none) ((none)) comm="pickup" (pickup) exe="/usr/libexec/postfix/pickup" (/usr/libexec/postfix/pickup) subj=system_u:system_r:postfix_pickup_t:s0 (system_u:system_r:postfix_pickup_t:s0) key=(null) ((null)) record 3 of type 1307(CWD) has 2 fields line=3 file=test.log event time: 1170021493.977:293, host=(null) type=CWD (CWD) cwd="/var/spool/postfix" (/var/spool/postfix) record 4 of type 1302(PATH) has 10 fields line=4 file=test.log event time: 1170021493.977:293, host=(null) type=PATH (PATH) item=0 (0) name="maildrop" (maildrop) inode=14911367 (14911367) dev=03:07 (03:07) mode=040730 (dir,730) ouid=890 (unknown(890)) ogid=891 (unknown(891)) rdev=00:00 (00:00) obj=system_u:object_r:postfix_spool_maildrop_t:s0 (system_u:object_r:postfix_spool_maildrop_t:s0) event 9 has 1 records record 1 of type 1101(USER_ACCT) has 11 fields line=5 file=test.log event time: 1170021601.340:294, host=(null) type=USER_ACCT (USER_ACCT) pid=13015 (13015) uid=0 (root) auid=4294967295 (unset) subj=system_u:system_r:crond_t:s0-s0:c0.c1023 (system_u:system_r:crond_t:s0-s0:c0.c1023) acct=root (root) exe="/usr/sbin/crond" (/usr/sbin/crond) hostname=? (?) addr=? (?) terminal=cron (cron) res=success (success) event 10 has 1 records record 1 of type 1103(CRED_ACQ) has 11 fields line=6 file=test.log event time: 1170021601.342:295, host=(null) type=CRED_ACQ (CRED_ACQ) pid=13015 (13015) uid=0 (root) auid=4294967295 (unset) subj=system_u:system_r:crond_t:s0-s0:c0.c1023 (system_u:system_r:crond_t:s0-s0:c0.c1023) acct=root (root) exe="/usr/sbin/crond" (/usr/sbin/crond) hostname=? (?) addr=? (?) terminal=cron (cron) res=success (success) event 11 has 3 records record 1 of type 1006(LOGIN) has 10 fields line=7 file=test.log event time: 1170021601.343:296, host=(null) type=LOGIN (LOGIN) pid=2288 (2288) uid=0 (root) subj=system_u:system_r:init_t:s0 (system_u:system_r:init_t:s0) old-auid=4294967295 (unset) auid=42 (gdm) tty=(none) ((none)) old-ses=4294967295 (4294967295) ses=1 (1) res=1 (yes) record 2 of type 1300(SYSCALL) has 27 fields line=8 file=test.log event time: 1170021601.343:296, host=(null) type=SYSCALL (SYSCALL) arch=c000003e (x86_64) syscall=1 (write) success=yes (yes) exit=2 (2) a0=8 (0x8) a1=7fffa7aede20 (0x7fffa7aede20) a2=2 (0x2) a3=0 (0x0) items=0 (0) ppid=1 (1) pid=2288 (2288) auid=42 (gdm) uid=0 (root) gid=0 (root) euid=0 (root) suid=0 (root) fsuid=0 (root) egid=0 (root) sgid=0 (root) fsgid=0 (root) tty=(none) ((none)) ses=1 (1) comm="(systemd)" ((systemd)) exe="/usr/lib/systemd/systemd" (/usr/lib/systemd/systemd) subj=system_u:system_r:init_t:s0 (system_u:system_r:init_t:s0) key=(null) ((null)) record 3 of type 1327(PROCTITLE) has 2 fields line=9 file=test.log event time: 1170021601.343:296, host=(null) type=PROCTITLE (PROCTITLE) proctitle="(systemd)" ((systemd)) event 12 has 1 records record 1 of type 1105(USER_START) has 11 fields line=10 file=test.log event time: 1170021601.344:297, host=(null) type=USER_START (USER_START) pid=13015 (13015) uid=0 (root) auid=0 (root) subj=system_u:system_r:crond_t:s0-s0:c0.c1023 (system_u:system_r:crond_t:s0-s0:c0.c1023) acct=root (root) exe="/usr/sbin/crond" (/usr/sbin/crond) hostname=? (?) addr=? (?) terminal=cron (cron) res=success (success) event 13 has 1 records record 1 of type 1104(CRED_DISP) has 11 fields line=11 file=test.log event time: 1170021601.364:298, host=(null) type=CRED_DISP (CRED_DISP) pid=13015 (13015) uid=0 (root) auid=0 (root) subj=system_u:system_r:crond_t:s0-s0:c0.c1023 (system_u:system_r:crond_t:s0-s0:c0.c1023) acct=root (root) exe="/usr/sbin/crond" (/usr/sbin/crond) hostname=? (?) addr=? (?) terminal=cron (cron) res=success (success) event 14 has 1 records record 1 of type 1106(USER_END) has 11 fields line=12 file=test.log event time: 1170021601.366:299, host=(null) type=USER_END (USER_END) pid=13015 (13015) uid=0 (root) auid=0 (root) subj=system_u:system_r:crond_t:s0-s0:c0.c1023 (system_u:system_r:crond_t:s0-s0:c0.c1023) acct=root (root) exe="/usr/sbin/crond" (/usr/sbin/crond) hostname=? (?) addr=? (?) terminal=cron (cron) res=success (success) Test 5 Done Starting Test 6, search... auid = 500 not found...which is correct auid exists...which is correct Testing BUFFER_ARRAY, stop on field Found auid = 848 Testing BUFFER_ARRAY, stop on record Found type = SYSCALL Testing BUFFER_ARRAY, stop on event Found type = SYSCALL Testing test.log, stop on field Found auid = 4294967295 Testing test.log, stop on record Found type = SYSCALL Testing test.log, stop on event Found type = AVC Test 6 Done Starting Test 7, compound search... Found type = USER_START Found auid = 42 Test 7 Done Starting Test 8, regex search... Doing regex match... Test 8 Done Starting Test 9, buffer feed... event 1 has 1 records record 1 of type 1006(LOGIN) has 5 fields line=1 file=None event time: 1143146623.787:142, host=(null) type=LOGIN (LOGIN) pid=2027 (2027) uid=0 (root) auid=4294967295 (unset) auid=848 (unknown(848)) event 2 has 1 records record 1 of type 1300(SYSCALL) has 24 fields line=2 file=None event time: 1143146623.875:143, host=(null) type=SYSCALL (SYSCALL) arch=c000003e (x86_64) syscall=188 (setxattr) success=yes (yes) exit=0 (0) a0=7fffffa9a9f0 (0x7fffffa9a9f0) a1=3958d11333 (0x3958d11333) a2=5131f0 (0x5131f0) a3=20 (0x20) items=1 (1) pid=2027 (2027) auid=848 (unknown(848)) uid=0 (root) gid=0 (root) euid=0 (root) suid=0 (root) fsuid=0 (root) egid=0 (root) sgid=0 (root) fsgid=0 (root) tty=tty3 (tty3) comm="login" (login) exe="/bin/login" (/bin/login) subj=system_u:system_r:local_login_t:s0-s0:c0.c255 (system_u:system_r:local_login_t:s0-s0:c0.c255) event 3 has 1 records record 1 of type 1112(USER_LOGIN) has 10 fields line=3 file=None event time: 1143146623.879:146, host=(null) type=USER_LOGIN (USER_LOGIN) pid=2027 (2027) uid=0 (root) auid=848 (unknown(848)) uid=848 (unknown(848)) exe="/bin/login" (/bin/login) hostname=? (?) addr=? (?) terminal=tty3 (tty3) res=success (success) Test 9 Done Starting Test 10, file feed... event 1 has 4 records record 1 of type 1400(AVC) has 11 fields line=1 file=None event time: 1170021493.977:293, host=(null) type=AVC (AVC) seresult=denied (denied) seperms=read,write (read,write) pid=13010 (13010) comm="pickup" (pickup) name="maildrop" (maildrop) dev=hda7 (hda7) ino=14911367 (14911367) scontext=system_u:system_r:postfix_pickup_t:s0 (system_u:system_r:postfix_pickup_t:s0) tcontext=system_u:object_r:postfix_spool_maildrop_t:s0 (system_u:object_r:postfix_spool_maildrop_t:s0) tclass=dir (dir) record 2 of type 1300(SYSCALL) has 26 fields line=2 file=None event time: 1170021493.977:293, host=(null) type=SYSCALL (SYSCALL) arch=c000003e (x86_64) syscall=2 (open) success=no (no) exit=-13 (EACCES(Permission denied)) a0=5555665d91b0 (0x5555665d91b0) a1=10800 (O_RDONLY|O_NONBLOCK|O_DIRECTORY) a2=5555665d91b8 (0x5555665d91b8) a3=0 (0x0) items=1 (1) ppid=2013 (2013) pid=13010 (13010) auid=4294967295 (unset) uid=890 (unknown(890)) gid=890 (unknown(890)) euid=890 (unknown(890)) suid=890 (unknown(890)) fsuid=890 (unknown(890)) egid=890 (unknown(890)) sgid=890 (unknown(890)) fsgid=890 (unknown(890)) tty=(none) ((none)) comm="pickup" (pickup) exe="/usr/libexec/postfix/pickup" (/usr/libexec/postfix/pickup) subj=system_u:system_r:postfix_pickup_t:s0 (system_u:system_r:postfix_pickup_t:s0) key=(null) ((null)) record 3 of type 1307(CWD) has 2 fields line=3 file=None event time: 1170021493.977:293, host=(null) type=CWD (CWD) cwd="/var/spool/postfix" (/var/spool/postfix) record 4 of type 1302(PATH) has 10 fields line=4 file=None event time: 1170021493.977:293, host=(null) type=PATH (PATH) item=0 (0) name="maildrop" (maildrop) inode=14911367 (14911367) dev=03:07 (03:07) mode=040730 (dir,730) ouid=890 (unknown(890)) ogid=891 (unknown(891)) rdev=00:00 (00:00) obj=system_u:object_r:postfix_spool_maildrop_t:s0 (system_u:object_r:postfix_spool_maildrop_t:s0) event 2 has 1 records record 1 of type 1101(USER_ACCT) has 11 fields line=5 file=None event time: 1170021601.340:294, host=(null) type=USER_ACCT (USER_ACCT) pid=13015 (13015) uid=0 (root) auid=4294967295 (unset) subj=system_u:system_r:crond_t:s0-s0:c0.c1023 (system_u:system_r:crond_t:s0-s0:c0.c1023) acct=root (root) exe="/usr/sbin/crond" (/usr/sbin/crond) hostname=? (?) addr=? (?) terminal=cron (cron) res=success (success) event 3 has 1 records record 1 of type 1103(CRED_ACQ) has 11 fields line=6 file=None event time: 1170021601.342:295, host=(null) type=CRED_ACQ (CRED_ACQ) pid=13015 (13015) uid=0 (root) auid=4294967295 (unset) subj=system_u:system_r:crond_t:s0-s0:c0.c1023 (system_u:system_r:crond_t:s0-s0:c0.c1023) acct=root (root) exe="/usr/sbin/crond" (/usr/sbin/crond) hostname=? (?) addr=? (?) terminal=cron (cron) res=success (success) event 4 has 3 records record 1 of type 1006(LOGIN) has 10 fields line=7 file=None event time: 1170021601.343:296, host=(null) type=LOGIN (LOGIN) pid=2288 (2288) uid=0 (root) subj=system_u:system_r:init_t:s0 (system_u:system_r:init_t:s0) old-auid=4294967295 (unset) auid=42 (gdm) tty=(none) ((none)) old-ses=4294967295 (4294967295) ses=1 (1) res=1 (yes) record 2 of type 1300(SYSCALL) has 27 fields line=8 file=None event time: 1170021601.343:296, host=(null) type=SYSCALL (SYSCALL) arch=c000003e (x86_64) syscall=1 (write) success=yes (yes) exit=2 (2) a0=8 (0x8) a1=7fffa7aede20 (0x7fffa7aede20) a2=2 (0x2) a3=0 (0x0) items=0 (0) ppid=1 (1) pid=2288 (2288) auid=42 (gdm) uid=0 (root) gid=0 (root) euid=0 (root) suid=0 (root) fsuid=0 (root) egid=0 (root) sgid=0 (root) fsgid=0 (root) tty=(none) ((none)) ses=1 (1) comm="(systemd)" ((systemd)) exe="/usr/lib/systemd/systemd" (/usr/lib/systemd/systemd) subj=system_u:system_r:init_t:s0 (system_u:system_r:init_t:s0) key=(null) ((null)) record 3 of type 1327(PROCTITLE) has 2 fields line=9 file=None event time: 1170021601.343:296, host=(null) type=PROCTITLE (PROCTITLE) proctitle="(systemd)" ((systemd)) event 5 has 1 records record 1 of type 1105(USER_START) has 11 fields line=10 file=None event time: 1170021601.344:297, host=(null) type=USER_START (USER_START) pid=13015 (13015) uid=0 (root) auid=0 (root) subj=system_u:system_r:crond_t:s0-s0:c0.c1023 (system_u:system_r:crond_t:s0-s0:c0.c1023) acct=root (root) exe="/usr/sbin/crond" (/usr/sbin/crond) hostname=? (?) addr=? (?) terminal=cron (cron) res=success (success) event 6 has 1 records record 1 of type 1104(CRED_DISP) has 11 fields line=11 file=None event time: 1170021601.364:298, host=(null) type=CRED_DISP (CRED_DISP) pid=13015 (13015) uid=0 (root) auid=0 (root) subj=system_u:system_r:crond_t:s0-s0:c0.c1023 (system_u:system_r:crond_t:s0-s0:c0.c1023) acct=root (root) exe="/usr/sbin/crond" (/usr/sbin/crond) hostname=? (?) addr=? (?) terminal=cron (cron) res=success (success) event 7 has 1 records record 1 of type 1106(USER_END) has 11 fields line=12 file=None event time: 1170021601.366:299, host=(null) type=USER_END (USER_END) pid=13015 (13015) uid=0 (root) auid=0 (root) subj=system_u:system_r:crond_t:s0-s0:c0.c1023 (system_u:system_r:crond_t:s0-s0:c0.c1023) acct=root (root) exe="/usr/sbin/crond" (/usr/sbin/crond) hostname=? (?) addr=? (?) terminal=cron (cron) res=success (success) Test 10 Done Starting Test 11, walk LONG event records from a file... event 1 has 7 records record 1 of type 1300(SYSCALL) has 26 fields line=1 file=test4.log event time: 1655465398.534:25618, host=(null) type=SYSCALL (SYSCALL) arch=c000003e (x86_64) syscall=59 (execve) success=yes (yes) exit=0 (0) a0=8c403a0 (0x8c403a0) a1=8c3e8b0 (0x8c3e8b0) a2=fffffb6cc5b0 (0xfffffb6cc5b0) a3=0 (0x0) items=3 (3) ppid=105182 (105182) pid=105183 (105183) auid=573 (unknown(573)) uid=583 (unknown(583)) gid=583 (unknown(583)) euid=583 (unknown(583)) suid=583 (unknown(583)) fsuid=583 (unknown(583)) egid=583 (unknown(583)) sgid=583 (unknown(583)) fsgid=583 (unknown(583)) tty=pts2 (pts2) ses=2632 (2632) comm="ld" (ld) exe="/bin/sh4" (/bin/sh4) key=(null) ((null)) record 2 of type 1309(EXECVE) has 50 fields line=2 file=test4.log event time: 1655465398.534:25618, host=(null) type=EXECVE (EXECVE) argc=48 (48) a0="/bin/sh" (/bin/sh) a1="-efu" (-efu) a2="/usr/bin/ld" (/usr/bin/ld) a3="-plugin" (-plugin) a4="/usr/libexec/gcc/aarch64-alt-linux/8/liblto_plugin.so" (/usr/libexec/gcc/aarch64-alt-linux/8/liblto_plugin.so) a5="-plugin-opt=/usr/libexec/gcc/aarch64-alt-linux/8/lto-wrapper" (-plugin-opt=/usr/libexec/gcc/aarch64-alt-linux/8/lto-wrapper) a6="-plugin-opt=-fresolution=/usr/src/tmp/cchyHiZN.res" (-plugin-opt=-fresolution=/usr/src/tmp/cchyHiZN.res) a7="-plugin-opt=-pass-through=-lgcc" (-plugin-opt=-pass-through=-lgcc) a8="-plugin-opt=-pass-through=-lgcc_s" (-plugin-opt=-pass-through=-lgcc_s) a9="-plugin-opt=-pass-through=-lc" (-plugin-opt=-pass-through=-lc) a10="-plugin-opt=-pass-through=-lgcc" (-plugin-opt=-pass-through=-lgcc) a11="-plugin-opt=-pass-through=-lgcc_s" (-plugin-opt=-pass-through=-lgcc_s) a12="--build-id" (--build-id) a13="--no-add-needed" (--no-add-needed) a14="--eh-frame-hdr" (--eh-frame-hdr) a15="--hash-style=gnu" (--hash-style=gnu) a16="--as-needed" (--as-needed) a17="-shared" (-shared) a18="-X" (-X) a19="-EL" (-EL) a20="-maarch64linux" (-maarch64linux) a21="-o" (-o) a22="ztest105133.so" (ztest105133.so) a23="/usr/lib64/gcc/aarch64-alt-linux/8/../../../../lib64/crti.o" (/usr/lib64/gcc/aarch64-alt-linux/8/../../../../lib64/crti.o) a24="/usr/lib64/gcc/aarch64-alt-linux/8/crtbeginS.o" (/usr/lib64/gcc/aarch64-alt-linux/8/crtbeginS.o) a25="-L/usr/lib64/gcc/aarch64-alt-linux/8" (-L/usr/lib64/gcc/aarch64-alt-linux/8) a26="-L/usr/lib64/gcc/aarch64-alt-linux/8/../../../../lib64" (-L/usr/lib64/gcc/aarch64-alt-linux/8/../../../../lib64) a27="-L/lib/../lib64" (-L/lib/../lib64) a28="-L/usr/lib/../lib64" (-L/usr/lib/../lib64) a29="-L/usr/lib64/gcc/aarch64-alt-linux/8/../../.." (-L/usr/lib64/gcc/aarch64-alt-linux/8/../../..) a30="-soname" (-soname) a31="libz.so.1" (libz.so.1) a32="--version-script" (--version-script) a33="zlib.map" (zlib.map) a34="ztest105133.o" (ztest105133.o) a35="-lgcc" (-lgcc) a36="--push-state" (--push-state) a37="--as-needed" (--as-needed) a38="-lgcc_s" (-lgcc_s) a39="--pop-state" (--pop-state) a40="-lc" (-lc) a41="-lgcc" (-lgcc) a42="--push-state" (--push-state) a43="--as-needed" (--as-needed) a44="-lgcc_s" (-lgcc_s) a45="--pop-state" (--pop-state) a46="/usr/lib64/gcc/aarch64-alt-linux/8/crtendS.o" (/usr/lib64/gcc/aarch64-alt-linux/8/crtendS.o) a47="/usr/lib64/gcc/aarch64-alt-linux/8/../../../../lib64/crtn.o" (/usr/lib64/gcc/aarch64-alt-linux/8/../../../../lib64/crtn.o) record 3 of type 1307(CWD) has 2 fields line=3 file=test4.log event time: 1655465398.534:25618, host=(null) type=CWD (CWD) cwd="/usr/src/RPM/BUILD/zlib-1.2.11-alt1" (/usr/src/RPM/BUILD/zlib-1.2.11-alt1) record 4 of type 1302(PATH) has 15 fields line=4 file=test4.log event time: 1655465398.534:25618, host=(null) type=PATH (PATH) item=0 (0) name="/usr/bin/ld" (/usr/bin/ld) inode=40854 (40854) dev=00:30 (00:30) mode=0100755 (file,755) ouid=582 (unknown(582)) ogid=582 (unknown(582)) rdev=00:00 (00:00) nametype=NORMAL (NORMAL) cap_fp=0 (none) cap_fi=0 (none) cap_fe=0 (0) cap_fver=0 (0) cap_frootid=0 (0) record 5 of type 1302(PATH) has 15 fields line=5 file=test4.log event time: 1655465398.534:25618, host=(null) type=PATH (PATH) item=1 (1) name="/bin/sh" (/bin/sh) inode=33238 (33238) dev=00:30 (00:30) mode=0100755 (file,755) ouid=582 (unknown(582)) ogid=582 (unknown(582)) rdev=00:00 (00:00) nametype=NORMAL (NORMAL) cap_fp=0 (none) cap_fi=0 (none) cap_fe=0 (0) cap_fver=0 (0) cap_frootid=0 (0) record 6 of type 1302(PATH) has 15 fields line=6 file=test4.log event time: 1655465398.534:25618, host=(null) type=PATH (PATH) item=2 (2) name="/lib64/ld-linux-aarch64.so.1" (/lib64/ld-linux-aarch64.so.1) inode=33874 (33874) dev=00:30 (00:30) mode=0100755 (file,755) ouid=582 (unknown(582)) ogid=582 (unknown(582)) rdev=00:00 (00:00) nametype=NORMAL (NORMAL) cap_fp=0 (none) cap_fi=0 (none) cap_fe=0 (0) cap_fver=0 (0) cap_frootid=0 (0) record 7 of type 1327(PROCTITLE) has 2 fields line=7 file=test4.log event time: 1655465398.534:25618, host=(null) type=PROCTITLE (PROCTITLE) proctitle=2F62696E2F7368002D656675002F7573722F62696E2F6C64002D706C7567696E002F7573722F6C6962657865632F6763632F616172636836342D616C742D6C696E75782F382F6C69626C746F5F706C7567696E2E736F002D706C7567696E2D6F70743D2F7573722F6C6962657865632F6763632F616172636836342D616C742D (/bin/sh -efu /usr/bin/ld -plugin /usr/libexec/gcc/aarch64-alt-linux/8/liblto_plugin.so -plugin-opt=/usr/libexec/gcc/aarch64-alt-) event 2 has 6 records record 1 of type 1300(SYSCALL) has 26 fields line=8 file=test4.log event time: 1655465404.819:27091, host=(null) type=SYSCALL (SYSCALL) arch=c000003e (x86_64) syscall=59 (execve) success=yes (yes) exit=0 (0) a0=1a407f50 (0x1a407f50) a1=1a401cd0 (0x1a401cd0) a2=1a3ed090 (0x1a3ed090) a3=0 (0x0) items=2 (2) ppid=105932 (105932) pid=105933 (105933) auid=573 (unknown(573)) uid=583 (unknown(583)) gid=583 (unknown(583)) euid=583 (unknown(583)) suid=583 (unknown(583)) fsuid=583 (unknown(583)) egid=583 (unknown(583)) sgid=583 (unknown(583)) fsgid=583 (unknown(583)) tty=pts2 (pts2) ses=2632 (2632) comm="m4" (m4) exe="/usr/bin/m4" (/usr/bin/m4) key=(null) ((null)) record 2 of type 1309(EXECVE) has 218 fields line=9 file=test4.log event time: 1655465404.819:27091, host=(null) type=EXECVE (EXECVE) argc=216 (216) a0="/usr/bin/m4" (/usr/bin/m4) a1="--nesting-limit=1024" (--nesting-limit=1024) a2="--gnu" (--gnu) a3="--include=/usr/share/autoconf-2.60" (--include=/usr/share/autoconf-2.60) a4="--debug=aflq" (--debug=aflq) a5="--fatal-warning" (--fatal-warning) a6="--debugfile=autom4te.cache/traces.0t" (--debugfile=autom4te.cache/traces.0t) a7="--trace=AC_CHECK_LIBM" (--trace=AC_CHECK_LIBM) a8="--trace=AC_CONFIG_MACRO_DIR" (--trace=AC_CONFIG_MACRO_DIR) a9="--trace=AC_CONFIG_MACRO_DIR_TRACE" (--trace=AC_CONFIG_MACRO_DIR_TRACE) a10="--trace=AC_DEFUN" (--trace=AC_DEFUN) a11="--trace=AC_DEFUN_ONCE" (--trace=AC_DEFUN_ONCE) a12="--trace=AC_DEPLIBS_CHECK_METHOD" (--trace=AC_DEPLIBS_CHECK_METHOD) a13="--trace=AC_DISABLE_FAST_INSTALL" (--trace=AC_DISABLE_FAST_INSTALL) a14="--trace=AC_DISABLE_SHARED" (--trace=AC_DISABLE_SHARED) a15="--trace=AC_DISABLE_STATIC" (--trace=AC_DISABLE_STATIC) a16="--trace=AC_ENABLE_FAST_INSTALL" (--trace=AC_ENABLE_FAST_INSTALL) a17="--trace=AC_ENABLE_SHARED" (--trace=AC_ENABLE_SHARED) a18="--trace=AC_ENABLE_STATIC" (--trace=AC_ENABLE_STATIC) a19="--trace=AC_LIBLTDL_CONVENIENCE" (--trace=AC_LIBLTDL_CONVENIENCE) a20="--trace=AC_LIBLTDL_INSTALLABLE" (--trace=AC_LIBLTDL_INSTALLABLE) a21="--trace=AC_LIBTOOL_COMPILER_OPTION" (--trace=AC_LIBTOOL_COMPILER_OPTION) a22="--trace=AC_LIBTOOL_CONFIG" (--trace=AC_LIBTOOL_CONFIG) a23="--trace=AC_LIBTOOL_CXX" (--trace=AC_LIBTOOL_CXX) a24="--trace=AC_LIBTOOL_DLOPEN" (--trace=AC_LIBTOOL_DLOPEN) a25="--trace=AC_LIBTOOL_DLOPEN_SELF" (--trace=AC_LIBTOOL_DLOPEN_SELF) a26="--trace=AC_LIBTOOL_F77" (--trace=AC_LIBTOOL_F77) a27="--trace=AC_LIBTOOL_FC" (--trace=AC_LIBTOOL_FC) a28="--trace=AC_LIBTOOL_GCJ" (--trace=AC_LIBTOOL_GCJ) a29="--trace=AC_LIBTOOL_LANG_CXX_CONFIG" (--trace=AC_LIBTOOL_LANG_CXX_CONFIG) a30="--trace=AC_LIBTOOL_LANG_C_CONFIG" (--trace=AC_LIBTOOL_LANG_C_CONFIG) a31="--trace=AC_LIBTOOL_LANG_F77_CONFIG" (--trace=AC_LIBTOOL_LANG_F77_CONFIG) a32="--trace=AC_LIBTOOL_LANG_GCJ_CONFIG" (--trace=AC_LIBTOOL_LANG_GCJ_CONFIG) a33="--trace=AC_LIBTOOL_LANG_RC_CONFIG" (--trace=AC_LIBTOOL_LANG_RC_CONFIG) a34="--trace=AC_LIBTOOL_LINKER_OPTION" (--trace=AC_LIBTOOL_LINKER_OPTION) a35="--trace=AC_LIBTOOL_OBJDIR" (--trace=AC_LIBTOOL_OBJDIR) a36="--trace=AC_LIBTOOL_PICMODE" (--trace=AC_LIBTOOL_PICMODE) a37="--trace=AC_LIBTOOL_POSTDEP_PREDEP" (--trace=AC_LIBTOOL_POSTDEP_PREDEP) a38="--trace=AC_LIBTOOL_PROG_CC_C_O" (--trace=AC_LIBTOOL_PROG_CC_C_O) a39="--trace=AC_LIBTOOL_PROG_COMPILER_NO_RTTI" (--trace=AC_LIBTOOL_PROG_COMPILER_NO_RTTI) a40="--trace=AC_LIBTOOL_PROG_COMPILER_PIC" (--trace=AC_LIBTOOL_PROG_COMPILER_PIC) a41="--trace=AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH" (--trace=AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH) a42="--trace=AC_LIBTOOL_PROG_LD_SHLIBS" (--trace=AC_LIBTOOL_PROG_LD_SHLIBS) a43="--trace=AC_LIBTOOL_RC" (--trace=AC_LIBTOOL_RC) a44="--trace=AC_LIBTOOL_SETUP" (--trace=AC_LIBTOOL_SETUP) a45="--trace=AC_LIBTOOL_SYS_DYNAMIC_LINKER" (--trace=AC_LIBTOOL_SYS_DYNAMIC_LINKER) a46="--trace=AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE" (--trace=AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE) a47="--trace=AC_LIBTOOL_SYS_HARD_LINK_LOCKS" (--trace=AC_LIBTOOL_SYS_HARD_LINK_LOCKS) a48="--trace=AC_LIBTOOL_SYS_LIB_STRIP" (--trace=AC_LIBTOOL_SYS_LIB_STRIP) a49="--trace=AC_LIBTOOL_SYS_MAX_CMD_LEN" (--trace=AC_LIBTOOL_SYS_MAX_CMD_LEN) a50="--trace=AC_LIBTOOL_SYS_OLD_ARCHIVE" (--trace=AC_LIBTOOL_SYS_OLD_ARCHIVE) a51="--trace=AC_LIBTOOL_WIN32_DLL" (--trace=AC_LIBTOOL_WIN32_DLL) a52="--trace=AC_LIB_LTDL" (--trace=AC_LIB_LTDL) a53="--trace=AC_LTDL_DLLIB" (--trace=AC_LTDL_DLLIB) a54="--trace=AC_LTDL_DLSYM_USCORE" (--trace=AC_LTDL_DLSYM_USCORE) a55="--trace=AC_LTDL_ENABLE_INSTALL" (--trace=AC_LTDL_ENABLE_INSTALL) a56="--trace=AC_LTDL_OBJDIR" (--trace=AC_LTDL_OBJDIR) a57="--trace=AC_LTDL_PREOPEN" (--trace=AC_LTDL_PREOPEN) a58="--trace=AC_LTDL_SHLIBEXT" (--trace=AC_LTDL_SHLIBEXT) a59="--trace=AC_LTDL_SHLIBPATH" (--trace=AC_LTDL_SHLIBPATH) a60="--trace=AC_LTDL_SYMBOL_USCORE" (--trace=AC_LTDL_SYMBOL_USCORE) a61="--trace=AC_LTDL_SYSSEARCHPATH" (--trace=AC_LTDL_SYSSEARCHPATH) a62="--trace=AC_LTDL_SYS_DLOPEN_DEPLIBS" (--trace=AC_LTDL_SYS_DLOPEN_DEPLIBS) a63="--trace=AC_PATH_MAGIC" (--trace=AC_PATH_MAGIC) a64="--trace=AC_PATH_TOOL_PREFIX" (--trace=AC_PATH_TOOL_PREFIX) a65="--trace=AC_PROG_EGREP" (--trace=AC_PROG_EGREP) a66="--trace=AC_PROG_LD" (--trace=AC_PROG_LD) a67="--trace=AC_PROG_LD_GNU" (--trace=AC_PROG_LD_GNU) a68="--trace=AC_PROG_LD_RELOAD_FLAG" (--trace=AC_PROG_LD_RELOAD_FLAG) a69="--trace=AC_PROG_LIBTOOL" (--trace=AC_PROG_LIBTOOL) a70="--trace=AC_PROG_NM" (--trace=AC_PROG_NM) a71="--trace=AC_WITH_LTDL" (--trace=AC_WITH_LTDL) a72="--trace=AM_AUTOMAKE_VERSION" (--trace=AM_AUTOMAKE_VERSION) a73="--trace=AM_AUX_DIR_EXPAND" (--trace=AM_AUX_DIR_EXPAND) a74="--trace=AM_CONDITIONAL" (--trace=AM_CONDITIONAL) a75="--trace=AM_DEP_TRACK" (--trace=AM_DEP_TRACK) a76="--trace=AM_DISABLE_SHARED" (--trace=AM_DISABLE_SHARED) a77="--trace=AM_DISABLE_STATIC" (--trace=AM_DISABLE_STATIC) a78="--trace=AM_ENABLE_SHARED" (--trace=AM_ENABLE_SHARED) a79="--trace=AM_ENABLE_STATIC" (--trace=AM_ENABLE_STATIC) a80="--trace=AM_INIT_AUTOMAKE" (--trace=AM_INIT_AUTOMAKE) a81="--trace=AM_MAKE_INCLUDE" (--trace=AM_MAKE_INCLUDE) a82="--trace=AM_MISSING_HAS_RUN" (--trace=AM_MISSING_HAS_RUN) a83="--trace=AM_MISSING_PROG" (--trace=AM_MISSING_PROG) a84="--trace=AM_OUTPUT_DEPENDENCY_COMMANDS" (--trace=AM_OUTPUT_DEPENDENCY_COMMANDS) a85="--trace=AM_PROG_CC_C_O" (--trace=AM_PROG_CC_C_O) a86="--trace=AM_PROG_INSTALL_SH" (--trace=AM_PROG_INSTALL_SH) a87="--trace=AM_PROG_INSTALL_STRIP" (--trace=AM_PROG_INSTALL_STRIP) a88="--trace=AM_PROG_LD" (--trace=AM_PROG_LD) a89="--trace=AM_PROG_LIBTOOL" (--trace=AM_PROG_LIBTOOL) a90="--trace=AM_PROG_NM" (--trace=AM_PROG_NM) a91="--trace=AM_RUN_LOG" (--trace=AM_RUN_LOG) a92="--trace=AM_SANITY_CHECK" (--trace=AM_SANITY_CHECK) a93="--trace=AM_SET_CURRENT_AUTOMAKE_VERSION" (--trace=AM_SET_CURRENT_AUTOMAKE_VERSION) a94="--trace=AM_SET_DEPDIR" (--trace=AM_SET_DEPDIR) a95="--trace=AM_SET_LEADING_DOT" (--trace=AM_SET_LEADING_DOT) a96="--trace=AM_SILENT_RULES" (--trace=AM_SILENT_RULES) a97="--trace=AM_SUBST_NOTMAKE" (--trace=AM_SUBST_NOTMAKE) a98="--trace=AU_DEFUN" (--trace=AU_DEFUN) a99="--trace=LTDL_CONVENIENCE" (--trace=LTDL_CONVENIENCE) a100="--trace=LTDL_INIT" (--trace=LTDL_INIT) a101="--trace=LTDL_INSTALLABLE" (--trace=LTDL_INSTALLABLE) a102="--trace=LTOBSOLETE_VERSION" (--trace=LTOBSOLETE_VERSION) a103="--trace=LTOPTIONS_VERSION" (--trace=LTOPTIONS_VERSION) a104="--trace=LTSUGAR_VERSION" (--trace=LTSUGAR_VERSION) a105="--trace=LTVERSION_VERSION" (--trace=LTVERSION_VERSION) a106="--trace=LT_AC_PROG_EGREP" (--trace=LT_AC_PROG_EGREP) a107="--trace=LT_AC_PROG_GCJ" (--trace=LT_AC_PROG_GCJ) a108="--trace=LT_AC_PROG_RC" (--trace=LT_AC_PROG_RC) a109="--trace=LT_AC_PROG_SED" (--trace=LT_AC_PROG_SED) a110="--trace=LT_CMD_MAX_LEN" (--trace=LT_CMD_MAX_LEN) a111="--trace=LT_CONFIG_LTDL_DIR" (--trace=LT_CONFIG_LTDL_DIR) a112="--trace=LT_FUNC_ARGZ" (--trace=LT_FUNC_ARGZ) a113="--trace=LT_FUNC_DLSYM_USCORE" (--trace=LT_FUNC_DLSYM_USCORE) a114="--trace=LT_INIT" (--trace=LT_INIT) a115="--trace=LT_LANG" (--trace=LT_LANG) a116="--trace=LT_LIB_DLLOAD" (--trace=LT_LIB_DLLOAD) a117="--trace=LT_LIB_M" (--trace=LT_LIB_M) a118="--trace=LT_OUTPUT" (--trace=LT_OUTPUT) a119="--trace=LT_PATH_LD" (--trace=LT_PATH_LD) a120="--trace=LT_PATH_NM" (--trace=LT_PATH_NM) a121="--trace=LT_PROG_GCJ" (--trace=LT_PROG_GCJ) a122="--trace=LT_PROG_GO" (--trace=LT_PROG_GO) a123="--trace=LT_PROG_RC" (--trace=LT_PROG_RC) a124="--trace=LT_SUPPORTED_TAG" (--trace=LT_SUPPORTED_TAG) a125="--trace=LT_SYS_DLOPEN_DEPLIBS" (--trace=LT_SYS_DLOPEN_DEPLIBS) a126="--trace=LT_SYS_DLOPEN_SELF" (--trace=LT_SYS_DLOPEN_SELF) a127="--trace=LT_SYS_DLSEARCH_PATH" (--trace=LT_SYS_DLSEARCH_PATH) a128="--trace=LT_SYS_MODULE_EXT" (--trace=LT_SYS_MODULE_EXT) a129="--trace=LT_SYS_MODULE_PATH" (--trace=LT_SYS_MODULE_PATH) a130="--trace=LT_SYS_SYMBOL_USCORE" (--trace=LT_SYS_SYMBOL_USCORE) a131="--trace=LT_WITH_LTDL" (--trace=LT_WITH_LTDL) a132="--trace=_AC_AM_CONFIG_HEADER_HOOK" (--trace=_AC_AM_CONFIG_HEADER_HOOK) a133="--trace=_AC_PROG_LIBTOOL" (--trace=_AC_PROG_LIBTOOL) a134="--trace=_AM_AUTOCONF_VERSION" (--trace=_AM_AUTOCONF_VERSION) a135="--trace=_AM_CONFIG_MACRO_DIRS" (--trace=_AM_CONFIG_MACRO_DIRS) a136="--trace=_AM_DEPENDENCIES" (--trace=_AM_DEPENDENCIES) a137="--trace=_AM_IF_OPTION" (--trace=_AM_IF_OPTION) a138="--trace=_AM_MANGLE_OPTION" (--trace=_AM_MANGLE_OPTION) a139="--trace=_AM_OUTPUT_DEPENDENCY_COMMANDS" (--trace=_AM_OUTPUT_DEPENDENCY_COMMANDS) a140="--trace=_AM_PROG_CC_C_O" (--trace=_AM_PROG_CC_C_O) a141="--trace=_AM_PROG_TAR" (--trace=_AM_PROG_TAR) a142="--trace=_AM_SET_OPTION" (--trace=_AM_SET_OPTION) a143="--trace=_AM_SET_OPTIONS" (--trace=_AM_SET_OPTIONS) a144="--trace=_AM_SUBST_NOTMAKE" (--trace=_AM_SUBST_NOTMAKE) a145="--trace=_LTDL_SETUP" (--trace=_LTDL_SETUP) a146="--trace=_LT_AC_CHECK_DLFCN" (--trace=_LT_AC_CHECK_DLFCN) a147="--trace=_LT_AC_FILE_LTDLL_C" (--trace=_LT_AC_FILE_LTDLL_C) a148="--trace=_LT_AC_LANG_CXX" (--trace=_LT_AC_LANG_CXX) a149="--trace=_LT_AC_LANG_CXX_CONFIG" (--trace=_LT_AC_LANG_CXX_CONFIG) a150="--trace=_LT_AC_LANG_C_CONFIG" (--trace=_LT_AC_LANG_C_CONFIG) a151="--trace=_LT_AC_LANG_F77" (--trace=_LT_AC_LANG_F77) a152="--trace=_LT_AC_LANG_F77_CONFIG" (--trace=_LT_AC_LANG_F77_CONFIG) a153="--trace=_LT_AC_LANG_GCJ" (--trace=_LT_AC_LANG_GCJ) a154="--trace=_LT_AC_LANG_GCJ_CONFIG" (--trace=_LT_AC_LANG_GCJ_CONFIG) a155="--trace=_LT_AC_LANG_RC_CONFIG" (--trace=_LT_AC_LANG_RC_CONFIG) a156="--trace=_LT_AC_LOCK" (--trace=_LT_AC_LOCK) a157="--trace=_LT_AC_PROG_CXXCPP" (--trace=_LT_AC_PROG_CXXCPP) a158="--trace=_LT_AC_PROG_ECHO_BACKSLASH" (--trace=_LT_AC_PROG_ECHO_BACKSLASH) a159="--trace=_LT_AC_SHELL_INIT" (--trace=_LT_AC_SHELL_INIT) a160="--trace=_LT_AC_SYS_COMPILER" (--trace=_LT_AC_SYS_COMPILER) a161="--trace=_LT_AC_SYS_LIBPATH_AIX" (--trace=_LT_AC_SYS_LIBPATH_AIX) a162="--trace=_LT_AC_TAGCONFIG" (--trace=_LT_AC_TAGCONFIG) a163="--trace=_LT_AC_TAGVAR" (--trace=_LT_AC_TAGVAR) a164="--trace=_LT_AC_TRY_DLOPEN_SELF" (--trace=_LT_AC_TRY_DLOPEN_SELF) a165="--trace=_LT_CC_BASENAME" (--trace=_LT_CC_BASENAME) a166="--trace=_LT_COMPILER_BOILERPLATE" (--trace=_LT_COMPILER_BOILERPLATE) a167="--trace=_LT_COMPILER_OPTION" (--trace=_LT_COMPILER_OPTION) a168="--trace=_LT_DLL_DEF_P" (--trace=_LT_DLL_DEF_P) a169="--trace=_LT_LIBOBJ" (--trace=_LT_LIBOBJ) a170="--trace=_LT_LINKER_BOILERPLATE" (--trace=_LT_LINKER_BOILERPLATE) a171="--trace=_LT_LINKER_OPTION" (--trace=_LT_LINKER_OPTION) a172="--trace=_LT_PATH_TOOL_PREFIX" (--trace=_LT_PATH_TOOL_PREFIX) a173="--trace=_LT_PREPARE_SED_QUOTE_VARS" (--trace=_LT_PREPARE_SED_QUOTE_VARS) a174="--trace=_LT_PROG_CXX" (--trace=_LT_PROG_CXX) a175="--trace=_LT_PROG_ECHO_BACKSLASH" (--trace=_LT_PROG_ECHO_BACKSLASH) a176="--trace=_LT_PROG_F77" (--trace=_LT_PROG_F77) a177="--trace=_LT_PROG_FC" (--trace=_LT_PROG_FC) a178="--trace=_LT_PROG_LTMAIN" (--trace=_LT_PROG_LTMAIN) a179="--trace=_LT_REQUIRED_DARWIN_CHECKS" (--trace=_LT_REQUIRED_DARWIN_CHECKS) a180="--trace=_LT_WITH_SYSROOT" (--trace=_LT_WITH_SYSROOT) a181="--trace=_m4_warn" (--trace=_m4_warn) a182="--trace=include" (--trace=include) a183="--trace=m4_include" (--trace=m4_include) a184="--trace=m4_pattern_allow" (--trace=m4_pattern_allow) a185="--trace=m4_pattern_forbid" (--trace=m4_pattern_forbid) a186="--reload-state=/usr/share/autoconf-2.60/autoconf/autoconf.m4f" (--reload-state=/usr/share/autoconf-2.60/autoconf/autoconf.m4f) a187="--undefine=__m4_version__" (--undefine=__m4_version__) a188="-" (-) a189="/usr/share/aclocal-1.16/internal/ac-config-macro-dirs.m4" (/usr/share/aclocal-1.16/internal/ac-config-macro-dirs.m4) a190="/usr/share/libtool/aclocal/libtool.m4" (/usr/share/libtool/aclocal/libtool.m4) a191="/usr/share/libtool/aclocal/ltargz.m4" (/usr/share/libtool/aclocal/ltargz.m4) a192="/usr/share/libtool/aclocal/ltdl.m4" (/usr/share/libtool/aclocal/ltdl.m4) a193="/usr/share/libtool/aclocal/ltoptions.m4" (/usr/share/libtool/aclocal/ltoptions.m4) a194="/usr/share/libtool/aclocal/ltsugar.m4" (/usr/share/libtool/aclocal/ltsugar.m4) a195="/usr/share/libtool/aclocal/ltversion.m4" (/usr/share/libtool/aclocal/ltversion.m4) a196="/usr/share/libtool/aclocal/lt~obsolete.m4" (/usr/share/libtool/aclocal/lt~obsolete.m4) a197="/usr/share/aclocal-1.16/amversion.m4" (/usr/share/aclocal-1.16/amversion.m4) a198="/usr/share/aclocal-1.16/auxdir.m4" (/usr/share/aclocal-1.16/auxdir.m4) a199="/usr/share/aclocal-1.16/cond.m4" (/usr/share/aclocal-1.16/cond.m4) a200="/usr/share/aclocal-1.16/depend.m4" (/usr/share/aclocal-1.16/depend.m4) a201="/usr/share/aclocal-1.16/depout.m4" (/usr/share/aclocal-1.16/depout.m4) a202="/usr/share/aclocal-1.16/init.m4" (/usr/share/aclocal-1.16/init.m4) a203="/usr/share/aclocal-1.16/install-sh.m4" (/usr/share/aclocal-1.16/install-sh.m4) a204="/usr/share/aclocal-1.16/lead-dot.m4" (/usr/share/aclocal-1.16/lead-dot.m4) a205="/usr/share/aclocal-1.16/make.m4" (/usr/share/aclocal-1.16/make.m4) a206="/usr/share/aclocal-1.16/missing.m4" (/usr/share/aclocal-1.16/missing.m4) a207="/usr/share/aclocal-1.16/options.m4" (/usr/share/aclocal-1.16/options.m4) a208="/usr/share/aclocal-1.16/prog-cc-c-o.m4" (/usr/share/aclocal-1.16/prog-cc-c-o.m4) a209="/usr/share/aclocal-1.16/runlog.m4" (/usr/share/aclocal-1.16/runlog.m4) a210="/usr/share/aclocal-1.16/sanity.m4" (/usr/share/aclocal-1.16/sanity.m4) a211="/usr/share/aclocal-1.16/silent.m4" (/usr/share/aclocal-1.16/silent.m4) a212="/usr/share/aclocal-1.16/strip.m4" (/usr/share/aclocal-1.16/strip.m4) a213="/usr/share/aclocal-1.16/substnot.m4" (/usr/share/aclocal-1.16/substnot.m4) a214="/usr/share/aclocal-1.16/tar.m4" (/usr/share/aclocal-1.16/tar.m4) a215="configure.ac" (configure.ac) record 3 of type 1307(CWD) has 2 fields line=10 file=test4.log event time: 1655465404.819:27091, host=(null) type=CWD (CWD) cwd="/usr/src/RPM/BUILD/zlib-1.2.11-alt1/contrib/minizip" (/usr/src/RPM/BUILD/zlib-1.2.11-alt1/contrib/minizip) record 4 of type 1302(PATH) has 15 fields line=11 file=test4.log event time: 1655465404.819:27091, host=(null) type=PATH (PATH) item=0 (0) name="/usr/bin/m4" (/usr/bin/m4) inode=40839 (40839) dev=00:30 (00:30) mode=0100755 (file,755) ouid=582 (unknown(582)) ogid=582 (unknown(582)) rdev=00:00 (00:00) nametype=NORMAL (NORMAL) cap_fp=0 (none) cap_fi=0 (none) cap_fe=0 (0) cap_fver=0 (0) cap_frootid=0 (0) record 5 of type 1302(PATH) has 15 fields line=12 file=test4.log event time: 1655465404.819:27091, host=(null) type=PATH (PATH) item=1 (1) name="/lib64/ld-linux-aarch64.so.1" (/lib64/ld-linux-aarch64.so.1) inode=33874 (33874) dev=00:30 (00:30) mode=0100755 (file,755) ouid=582 (unknown(582)) ogid=582 (unknown(582)) rdev=00:00 (00:00) nametype=NORMAL (NORMAL) cap_fp=0 (none) cap_fi=0 (none) cap_fe=0 (0) cap_fver=0 (0) cap_frootid=0 (0) record 6 of type 1327(PROCTITLE) has 2 fields line=13 file=test4.log event time: 1655465404.819:27091, host=(null) type=PROCTITLE (PROCTITLE) proctitle=2F7573722F62696E2F6D34002D2D6E657374696E672D6C696D69743D31303234002D2D676E75002D2D696E636C7564653D2F7573722F73686172652F6175746F636F6E662D322E3630002D2D64656275673D61666C71002D2D666174616C2D7761726E696E67002D2D646562756766696C653D6175746F6D3474652E63616368 (/usr/bin/m4 --nesting-limit=1024 --gnu --include=/usr/share/autoconf-2.60 --debug=aflq --fatal-warning --debugfile=autom4te.cach) Test 11 Done Finished non-admin tests audit-4.0.2/auparse/test/auparse_test.ref0000644001034500103450000015330714655201403014131 Starting Test 1, iterate... auid=4294967295 interp auid=unset auid=848 interp auid=unknown(848) auid=848 interp auid=unknown(848) auid=4294967295 interp auid=unset auid=848 interp auid=unknown(848) auid=848 interp auid=unknown(848) auid=848 interp auid=unknown(848) Test 1 Done Starting Test 2, walk events, records, and fields... event 1 has 1 records record 1 of type 1006(LOGIN) has 5 fields line=1 file=None event time: 1143146623.787:142, host=? type=LOGIN (LOGIN) pid=2027 (2027) uid=0 (root) auid=4294967295 (unset) auid=848 (unknown(848)) event 2 has 1 records record 1 of type 1300(SYSCALL) has 24 fields line=2 file=None event time: 1143146623.875:143, host=? type=SYSCALL (SYSCALL) arch=c000003e (x86_64) syscall=188 (setxattr) success=yes (yes) exit=0 (0) a0=7fffffa9a9f0 (0x7fffffa9a9f0) a1=3958d11333 (0x3958d11333) a2=5131f0 (0x5131f0) a3=20 (0x20) items=1 (1) pid=2027 (2027) auid=848 (unknown(848)) uid=0 (root) gid=0 (root) euid=0 (root) suid=0 (root) fsuid=0 (root) egid=0 (root) sgid=0 (root) fsgid=0 (root) tty=tty3 (tty3) comm="login" (login) exe="/bin/login" (/bin/login) subj=system_u:system_r:local_login_t:s0-s0:c0.c255 (system_u:system_r:local_login_t:s0-s0:c0.c255) event 3 has 1 records record 1 of type 1112(USER_LOGIN) has 10 fields line=3 file=None event time: 1143146623.879:146, host=? type=USER_LOGIN (USER_LOGIN) pid=2027 (2027) uid=0 (root) auid=848 (unknown(848)) uid=848 (unknown(848)) exe="/bin/login" (/bin/login) hostname=? (?) addr=? (?) terminal=tty3 (tty3) res=success (success) Test 2 Done Starting Test 3, walk events, records of 1 buffer... event has 1 records record 1 of type 1112(USER_LOGIN) has 10 fields line=1 file=None event time: 1143146623.879:146, host=? Test 3 Done Starting Test 4, walk events, records of 1 file... event 1 has 4 records record 1 of type 1400(AVC) has 11 fields line=1 file=./test.log event time: 1170021493.977:293, host=? type=AVC (AVC) seresult=denied (denied) seperms=read,write (read,write) pid=13010 (13010) comm="pickup" (pickup) name="maildrop" (maildrop) dev=hda7 (hda7) ino=14911367 (14911367) scontext=system_u:system_r:postfix_pickup_t:s0 (system_u:system_r:postfix_pickup_t:s0) tcontext=system_u:object_r:postfix_spool_maildrop_t:s0 (system_u:object_r:postfix_spool_maildrop_t:s0) tclass=dir (dir) record 2 of type 1300(SYSCALL) has 26 fields line=2 file=./test.log event time: 1170021493.977:293, host=? type=SYSCALL (SYSCALL) arch=c000003e (x86_64) syscall=2 (open) success=no (no) exit=-13 (EACCES(Permission denied)) a0=5555665d91b0 (0x5555665d91b0) a1=10800 (O_RDONLY|O_NONBLOCK|O_DIRECTORY) a2=5555665d91b8 (0x5555665d91b8) a3=0 (0x0) items=1 (1) ppid=2013 (2013) pid=13010 (13010) auid=4294967295 (unset) uid=890 (unknown(890)) gid=890 (unknown(890)) euid=890 (unknown(890)) suid=890 (unknown(890)) fsuid=890 (unknown(890)) egid=890 (unknown(890)) sgid=890 (unknown(890)) fsgid=890 (unknown(890)) tty=(none) ((none)) comm="pickup" (pickup) exe="/usr/libexec/postfix/pickup" (/usr/libexec/postfix/pickup) subj=system_u:system_r:postfix_pickup_t:s0 (system_u:system_r:postfix_pickup_t:s0) key=(null) ((null)) record 3 of type 1307(CWD) has 2 fields line=3 file=./test.log event time: 1170021493.977:293, host=? type=CWD (CWD) cwd="/var/spool/postfix" (/var/spool/postfix) record 4 of type 1302(PATH) has 10 fields line=4 file=./test.log event time: 1170021493.977:293, host=? type=PATH (PATH) item=0 (0) name="maildrop" (maildrop) inode=14911367 (14911367) dev=03:07 (03:07) mode=040730 (dir,730) ouid=890 (unknown(890)) ogid=891 (unknown(891)) rdev=00:00 (00:00) obj=system_u:object_r:postfix_spool_maildrop_t:s0 (system_u:object_r:postfix_spool_maildrop_t:s0) event 2 has 1 records record 1 of type 1101(USER_ACCT) has 11 fields line=5 file=./test.log event time: 1170021601.340:294, host=? type=USER_ACCT (USER_ACCT) pid=13015 (13015) uid=0 (root) auid=4294967295 (unset) subj=system_u:system_r:crond_t:s0-s0:c0.c1023 (system_u:system_r:crond_t:s0-s0:c0.c1023) acct=root (root) exe="/usr/sbin/crond" (/usr/sbin/crond) hostname=? (?) addr=? (?) terminal=cron (cron) res=success (success) event 3 has 1 records record 1 of type 1103(CRED_ACQ) has 11 fields line=6 file=./test.log event time: 1170021601.342:295, host=? type=CRED_ACQ (CRED_ACQ) pid=13015 (13015) uid=0 (root) auid=4294967295 (unset) subj=system_u:system_r:crond_t:s0-s0:c0.c1023 (system_u:system_r:crond_t:s0-s0:c0.c1023) acct=root (root) exe="/usr/sbin/crond" (/usr/sbin/crond) hostname=? (?) addr=? (?) terminal=cron (cron) res=success (success) event 4 has 3 records record 1 of type 1006(LOGIN) has 10 fields line=7 file=./test.log event time: 1170021601.343:296, host=? type=LOGIN (LOGIN) pid=2288 (2288) uid=0 (root) subj=system_u:system_r:init_t:s0 (system_u:system_r:init_t:s0) old-auid=4294967295 (unset) auid=42 (gdm) tty=(none) ((none)) old-ses=4294967295 (4294967295) ses=1 (1) res=1 (yes) record 2 of type 1300(SYSCALL) has 27 fields line=8 file=./test.log event time: 1170021601.343:296, host=? type=SYSCALL (SYSCALL) arch=c000003e (x86_64) syscall=1 (write) success=yes (yes) exit=2 (2) a0=8 (0x8) a1=7fffa7aede20 (0x7fffa7aede20) a2=2 (0x2) a3=0 (0x0) items=0 (0) ppid=1 (1) pid=2288 (2288) auid=42 (gdm) uid=0 (root) gid=0 (root) euid=0 (root) suid=0 (root) fsuid=0 (root) egid=0 (root) sgid=0 (root) fsgid=0 (root) tty=(none) ((none)) ses=1 (1) comm="(systemd)" ((systemd)) exe="/usr/lib/systemd/systemd" (/usr/lib/systemd/systemd) subj=system_u:system_r:init_t:s0 (system_u:system_r:init_t:s0) key=(null) ((null)) record 3 of type 1327(PROCTITLE) has 2 fields line=9 file=./test.log event time: 1170021601.343:296, host=? type=PROCTITLE (PROCTITLE) proctitle="(systemd)" ((systemd)) event 5 has 1 records record 1 of type 1105(USER_START) has 11 fields line=10 file=./test.log event time: 1170021601.344:297, host=? type=USER_START (USER_START) pid=13015 (13015) uid=0 (root) auid=0 (root) subj=system_u:system_r:crond_t:s0-s0:c0.c1023 (system_u:system_r:crond_t:s0-s0:c0.c1023) acct=root (root) exe="/usr/sbin/crond" (/usr/sbin/crond) hostname=? (?) addr=? (?) terminal=cron (cron) res=success (success) event 6 has 1 records record 1 of type 1104(CRED_DISP) has 11 fields line=11 file=./test.log event time: 1170021601.364:298, host=? type=CRED_DISP (CRED_DISP) pid=13015 (13015) uid=0 (root) auid=0 (root) subj=system_u:system_r:crond_t:s0-s0:c0.c1023 (system_u:system_r:crond_t:s0-s0:c0.c1023) acct=root (root) exe="/usr/sbin/crond" (/usr/sbin/crond) hostname=? (?) addr=? (?) terminal=cron (cron) res=success (success) event 7 has 1 records record 1 of type 1106(USER_END) has 11 fields line=12 file=./test.log event time: 1170021601.366:299, host=? type=USER_END (USER_END) pid=13015 (13015) uid=0 (root) auid=0 (root) subj=system_u:system_r:crond_t:s0-s0:c0.c1023 (system_u:system_r:crond_t:s0-s0:c0.c1023) acct=root (root) exe="/usr/sbin/crond" (/usr/sbin/crond) hostname=? (?) addr=? (?) terminal=cron (cron) res=success (success) Test 4 Done Starting Test 5, walk events, records of 2 files... event 1 has 4 records record 1 of type 1400(AVC) has 11 fields line=1 file=test2.log event time: 1170021493.977:283, host=? type=AVC (AVC) seresult=denied (denied) seperms=read (read) pid=13010 (13010) comm="pickup" (pickup) name="maildrop" (maildrop) dev=hda7 (hda7) ino=14911367 (14911367) scontext=system_u:system_r:postfix_pickup_t:s0 (system_u:system_r:postfix_pickup_t:s0) tcontext=system_u:object_r:postfix_spool_maildrop_t:s0 (system_u:object_r:postfix_spool_maildrop_t:s0) tclass=dir (dir) record 2 of type 1300(SYSCALL) has 26 fields line=2 file=test2.log event time: 1170021493.977:283, host=? type=SYSCALL (SYSCALL) arch=c000003e (x86_64) syscall=2 (open) success=no (no) exit=-13 (EACCES(Permission denied)) a0=5555665d91b0 (0x5555665d91b0) a1=10800 (O_RDONLY|O_NONBLOCK|O_DIRECTORY) a2=5555665d91b8 (0x5555665d91b8) a3=0 (0x0) items=1 (1) ppid=2013 (2013) pid=13010 (13010) auid=4294967295 (unset) uid=890 (unknown(890)) gid=890 (unknown(890)) euid=890 (unknown(890)) suid=890 (unknown(890)) fsuid=890 (unknown(890)) egid=890 (unknown(890)) sgid=890 (unknown(890)) fsgid=890 (unknown(890)) tty=(none) ((none)) comm="pickup" (pickup) exe="/usr/libexec/postfix/pickup" (/usr/libexec/postfix/pickup) subj=system_u:system_r:postfix_pickup_t:s0 (system_u:system_r:postfix_pickup_t:s0) key=(null) ((null)) record 3 of type 1307(CWD) has 2 fields line=3 file=test2.log event time: 1170021493.977:283, host=? type=CWD (CWD) cwd="/var/spool/postfix" (/var/spool/postfix) record 4 of type 1302(PATH) has 10 fields line=4 file=test2.log event time: 1170021493.977:283, host=? type=PATH (PATH) item=0 (0) name="maildrop" (maildrop) inode=14911367 (14911367) dev=03:07 (03:07) mode=040730 (dir,730) ouid=890 (unknown(890)) ogid=891 (unknown(891)) rdev=00:00 (00:00) obj=system_u:object_r:postfix_spool_maildrop_t:s0 (system_u:object_r:postfix_spool_maildrop_t:s0) event 2 has 1 records record 1 of type 1101(USER_ACCT) has 11 fields line=5 file=test2.log event time: 1170021601.340:284, host=? type=USER_ACCT (USER_ACCT) pid=13015 (13015) uid=0 (root) auid=4294967295 (unset) subj=system_u:system_r:crond_t:s0-s0:c0.c1023 (system_u:system_r:crond_t:s0-s0:c0.c1023) acct=root (root) exe="/usr/sbin/crond" (/usr/sbin/crond) hostname=? (?) addr=? (?) terminal=cron (cron) res=success (success) event 3 has 1 records record 1 of type 1103(CRED_ACQ) has 11 fields line=6 file=test2.log event time: 1170021601.342:285, host=? type=CRED_ACQ (CRED_ACQ) pid=13015 (13015) uid=0 (root) auid=4294967295 (unset) subj=system_u:system_r:crond_t:s0-s0:c0.c1023 (system_u:system_r:crond_t:s0-s0:c0.c1023) acct=root (root) exe="/usr/sbin/crond" (/usr/sbin/crond) hostname=? (?) addr=? (?) terminal=cron (cron) res=success (success) event 4 has 3 records record 1 of type 1006(LOGIN) has 10 fields line=7 file=test2.log event time: 1170021601.343:286, host=? type=LOGIN (LOGIN) pid=2288 (2288) uid=0 (root) subj=system_u:system_r:init_t:s0 (system_u:system_r:init_t:s0) old-auid=4294967295 (unset) auid=42 (gdm) tty=(none) ((none)) old-ses=4294967295 (4294967295) ses=1 (1) res=1 (yes) record 2 of type 1300(SYSCALL) has 27 fields line=8 file=test2.log event time: 1170021601.343:286, host=? type=SYSCALL (SYSCALL) arch=c000003e (x86_64) syscall=1 (write) success=yes (yes) exit=2 (2) a0=8 (0x8) a1=7fffa7aede20 (0x7fffa7aede20) a2=2 (0x2) a3=0 (0x0) items=0 (0) ppid=1 (1) pid=2288 (2288) auid=42 (gdm) uid=0 (root) gid=0 (root) euid=0 (root) suid=0 (root) fsuid=0 (root) egid=0 (root) sgid=0 (root) fsgid=0 (root) tty=(none) ((none)) ses=1 (1) comm="(systemd)" ((systemd)) exe="/usr/lib/systemd/systemd" (/usr/lib/systemd/systemd) subj=system_u:system_r:init_t:s0 (system_u:system_r:init_t:s0) key=(null) ((null)) record 3 of type 1327(PROCTITLE) has 2 fields line=9 file=test2.log event time: 1170021601.343:286, host=? type=PROCTITLE (PROCTITLE) proctitle="(systemd)" ((systemd)) event 5 has 1 records record 1 of type 1105(USER_START) has 11 fields line=10 file=test2.log event time: 1170021601.344:287, host=? type=USER_START (USER_START) pid=13015 (13015) uid=0 (root) auid=0 (root) subj=system_u:system_r:crond_t:s0-s0:c0.c1023 (system_u:system_r:crond_t:s0-s0:c0.c1023) acct=root (root) exe="/usr/sbin/crond" (/usr/sbin/crond) hostname=? (?) addr=? (?) terminal=cron (cron) res=success (success) event 6 has 1 records record 1 of type 1104(CRED_DISP) has 11 fields line=11 file=test2.log event time: 1170021601.364:288, host=? type=CRED_DISP (CRED_DISP) pid=13015 (13015) uid=0 (root) auid=0 (root) subj=system_u:system_r:crond_t:s0-s0:c0.c1023 (system_u:system_r:crond_t:s0-s0:c0.c1023) acct=root (root) exe="/usr/sbin/crond" (/usr/sbin/crond) hostname=? (?) addr=? (?) terminal=cron (cron) res=success (success) event 7 has 1 records record 1 of type 1106(USER_END) has 11 fields line=12 file=test2.log event time: 1170021601.366:289, host=? type=USER_END (USER_END) pid=13015 (13015) uid=0 (root) auid=0 (root) subj=system_u:system_r:crond_t:s0-s0:c0.c1023 (system_u:system_r:crond_t:s0-s0:c0.c1023) acct=root (root) exe="/usr/sbin/crond" (/usr/sbin/crond) hostname=? (?) addr=? (?) terminal=cron (cron) res=success (success) event 8 has 4 records record 1 of type 1400(AVC) has 11 fields line=1 file=test.log event time: 1170021493.977:293, host=? type=AVC (AVC) seresult=denied (denied) seperms=read,write (read,write) pid=13010 (13010) comm="pickup" (pickup) name="maildrop" (maildrop) dev=hda7 (hda7) ino=14911367 (14911367) scontext=system_u:system_r:postfix_pickup_t:s0 (system_u:system_r:postfix_pickup_t:s0) tcontext=system_u:object_r:postfix_spool_maildrop_t:s0 (system_u:object_r:postfix_spool_maildrop_t:s0) tclass=dir (dir) record 2 of type 1300(SYSCALL) has 26 fields line=2 file=test.log event time: 1170021493.977:293, host=? type=SYSCALL (SYSCALL) arch=c000003e (x86_64) syscall=2 (open) success=no (no) exit=-13 (EACCES(Permission denied)) a0=5555665d91b0 (0x5555665d91b0) a1=10800 (O_RDONLY|O_NONBLOCK|O_DIRECTORY) a2=5555665d91b8 (0x5555665d91b8) a3=0 (0x0) items=1 (1) ppid=2013 (2013) pid=13010 (13010) auid=4294967295 (unset) uid=890 (unknown(890)) gid=890 (unknown(890)) euid=890 (unknown(890)) suid=890 (unknown(890)) fsuid=890 (unknown(890)) egid=890 (unknown(890)) sgid=890 (unknown(890)) fsgid=890 (unknown(890)) tty=(none) ((none)) comm="pickup" (pickup) exe="/usr/libexec/postfix/pickup" (/usr/libexec/postfix/pickup) subj=system_u:system_r:postfix_pickup_t:s0 (system_u:system_r:postfix_pickup_t:s0) key=(null) ((null)) record 3 of type 1307(CWD) has 2 fields line=3 file=test.log event time: 1170021493.977:293, host=? type=CWD (CWD) cwd="/var/spool/postfix" (/var/spool/postfix) record 4 of type 1302(PATH) has 10 fields line=4 file=test.log event time: 1170021493.977:293, host=? type=PATH (PATH) item=0 (0) name="maildrop" (maildrop) inode=14911367 (14911367) dev=03:07 (03:07) mode=040730 (dir,730) ouid=890 (unknown(890)) ogid=891 (unknown(891)) rdev=00:00 (00:00) obj=system_u:object_r:postfix_spool_maildrop_t:s0 (system_u:object_r:postfix_spool_maildrop_t:s0) event 9 has 1 records record 1 of type 1101(USER_ACCT) has 11 fields line=5 file=test.log event time: 1170021601.340:294, host=? type=USER_ACCT (USER_ACCT) pid=13015 (13015) uid=0 (root) auid=4294967295 (unset) subj=system_u:system_r:crond_t:s0-s0:c0.c1023 (system_u:system_r:crond_t:s0-s0:c0.c1023) acct=root (root) exe="/usr/sbin/crond" (/usr/sbin/crond) hostname=? (?) addr=? (?) terminal=cron (cron) res=success (success) event 10 has 1 records record 1 of type 1103(CRED_ACQ) has 11 fields line=6 file=test.log event time: 1170021601.342:295, host=? type=CRED_ACQ (CRED_ACQ) pid=13015 (13015) uid=0 (root) auid=4294967295 (unset) subj=system_u:system_r:crond_t:s0-s0:c0.c1023 (system_u:system_r:crond_t:s0-s0:c0.c1023) acct=root (root) exe="/usr/sbin/crond" (/usr/sbin/crond) hostname=? (?) addr=? (?) terminal=cron (cron) res=success (success) event 11 has 3 records record 1 of type 1006(LOGIN) has 10 fields line=7 file=test.log event time: 1170021601.343:296, host=? type=LOGIN (LOGIN) pid=2288 (2288) uid=0 (root) subj=system_u:system_r:init_t:s0 (system_u:system_r:init_t:s0) old-auid=4294967295 (unset) auid=42 (gdm) tty=(none) ((none)) old-ses=4294967295 (4294967295) ses=1 (1) res=1 (yes) record 2 of type 1300(SYSCALL) has 27 fields line=8 file=test.log event time: 1170021601.343:296, host=? type=SYSCALL (SYSCALL) arch=c000003e (x86_64) syscall=1 (write) success=yes (yes) exit=2 (2) a0=8 (0x8) a1=7fffa7aede20 (0x7fffa7aede20) a2=2 (0x2) a3=0 (0x0) items=0 (0) ppid=1 (1) pid=2288 (2288) auid=42 (gdm) uid=0 (root) gid=0 (root) euid=0 (root) suid=0 (root) fsuid=0 (root) egid=0 (root) sgid=0 (root) fsgid=0 (root) tty=(none) ((none)) ses=1 (1) comm="(systemd)" ((systemd)) exe="/usr/lib/systemd/systemd" (/usr/lib/systemd/systemd) subj=system_u:system_r:init_t:s0 (system_u:system_r:init_t:s0) key=(null) ((null)) record 3 of type 1327(PROCTITLE) has 2 fields line=9 file=test.log event time: 1170021601.343:296, host=? type=PROCTITLE (PROCTITLE) proctitle="(systemd)" ((systemd)) event 12 has 1 records record 1 of type 1105(USER_START) has 11 fields line=10 file=test.log event time: 1170021601.344:297, host=? type=USER_START (USER_START) pid=13015 (13015) uid=0 (root) auid=0 (root) subj=system_u:system_r:crond_t:s0-s0:c0.c1023 (system_u:system_r:crond_t:s0-s0:c0.c1023) acct=root (root) exe="/usr/sbin/crond" (/usr/sbin/crond) hostname=? (?) addr=? (?) terminal=cron (cron) res=success (success) event 13 has 1 records record 1 of type 1104(CRED_DISP) has 11 fields line=11 file=test.log event time: 1170021601.364:298, host=? type=CRED_DISP (CRED_DISP) pid=13015 (13015) uid=0 (root) auid=0 (root) subj=system_u:system_r:crond_t:s0-s0:c0.c1023 (system_u:system_r:crond_t:s0-s0:c0.c1023) acct=root (root) exe="/usr/sbin/crond" (/usr/sbin/crond) hostname=? (?) addr=? (?) terminal=cron (cron) res=success (success) event 14 has 1 records record 1 of type 1106(USER_END) has 11 fields line=12 file=test.log event time: 1170021601.366:299, host=? type=USER_END (USER_END) pid=13015 (13015) uid=0 (root) auid=0 (root) subj=system_u:system_r:crond_t:s0-s0:c0.c1023 (system_u:system_r:crond_t:s0-s0:c0.c1023) acct=root (root) exe="/usr/sbin/crond" (/usr/sbin/crond) hostname=? (?) addr=? (?) terminal=cron (cron) res=success (success) Test 5 Done Starting Test 6, search... auid = 500 not found...which is correct auid exists...which is correct Testing BUFFER_ARRAY, stop on field Found auid = 848 Testing BUFFER_ARRAY, stop on record Found type = SYSCALL Testing BUFFER_ARRAY, stop on event Found type = SYSCALL Testing test.log, stop on field Found auid = 4294967295 Testing test.log, stop on record Found type = SYSCALL Testing test.log, stop on event Found type = AVC Test 6 Done Starting Test 7, compound search... Found type = USER_START Found auid = 42 Test 7 Done Starting Test 8, regex search... Doing regex match... Found type = LOGIN Doing regex wildcard search... Found type = USER_LOGIN Test 8 Done Starting Test 9, buffer feed... event 1 has 1 records record 1 of type 1006(LOGIN) has 5 fields line=1 file=None event time: 1143146623.787:142, host=? type=LOGIN (LOGIN) pid=2027 (2027) uid=0 (root) auid=4294967295 (unset) auid=848 (unknown(848)) event 2 has 1 records record 1 of type 1300(SYSCALL) has 24 fields line=2 file=None event time: 1143146623.875:143, host=? type=SYSCALL (SYSCALL) arch=c000003e (x86_64) syscall=188 (setxattr) success=yes (yes) exit=0 (0) a0=7fffffa9a9f0 (0x7fffffa9a9f0) a1=3958d11333 (0x3958d11333) a2=5131f0 (0x5131f0) a3=20 (0x20) items=1 (1) pid=2027 (2027) auid=848 (unknown(848)) uid=0 (root) gid=0 (root) euid=0 (root) suid=0 (root) fsuid=0 (root) egid=0 (root) sgid=0 (root) fsgid=0 (root) tty=tty3 (tty3) comm="login" (login) exe="/bin/login" (/bin/login) subj=system_u:system_r:local_login_t:s0-s0:c0.c255 (system_u:system_r:local_login_t:s0-s0:c0.c255) event 3 has 1 records record 1 of type 1112(USER_LOGIN) has 10 fields line=3 file=None event time: 1143146623.879:146, host=? type=USER_LOGIN (USER_LOGIN) pid=2027 (2027) uid=0 (root) auid=848 (unknown(848)) uid=848 (unknown(848)) exe="/bin/login" (/bin/login) hostname=? (?) addr=? (?) terminal=tty3 (tty3) res=success (success) Test 9 Done Starting Test 10, file feed... event 1 has 4 records record 1 of type 1400(AVC) has 11 fields line=1 file=None event time: 1170021493.977:293, host=? type=AVC (AVC) seresult=denied (denied) seperms=read,write (read,write) pid=13010 (13010) comm="pickup" (pickup) name="maildrop" (maildrop) dev=hda7 (hda7) ino=14911367 (14911367) scontext=system_u:system_r:postfix_pickup_t:s0 (system_u:system_r:postfix_pickup_t:s0) tcontext=system_u:object_r:postfix_spool_maildrop_t:s0 (system_u:object_r:postfix_spool_maildrop_t:s0) tclass=dir (dir) record 2 of type 1300(SYSCALL) has 26 fields line=2 file=None event time: 1170021493.977:293, host=? type=SYSCALL (SYSCALL) arch=c000003e (x86_64) syscall=2 (open) success=no (no) exit=-13 (EACCES(Permission denied)) a0=5555665d91b0 (0x5555665d91b0) a1=10800 (O_RDONLY|O_NONBLOCK|O_DIRECTORY) a2=5555665d91b8 (0x5555665d91b8) a3=0 (0x0) items=1 (1) ppid=2013 (2013) pid=13010 (13010) auid=4294967295 (unset) uid=890 (unknown(890)) gid=890 (unknown(890)) euid=890 (unknown(890)) suid=890 (unknown(890)) fsuid=890 (unknown(890)) egid=890 (unknown(890)) sgid=890 (unknown(890)) fsgid=890 (unknown(890)) tty=(none) ((none)) comm="pickup" (pickup) exe="/usr/libexec/postfix/pickup" (/usr/libexec/postfix/pickup) subj=system_u:system_r:postfix_pickup_t:s0 (system_u:system_r:postfix_pickup_t:s0) key=(null) ((null)) record 3 of type 1307(CWD) has 2 fields line=3 file=None event time: 1170021493.977:293, host=? type=CWD (CWD) cwd="/var/spool/postfix" (/var/spool/postfix) record 4 of type 1302(PATH) has 10 fields line=4 file=None event time: 1170021493.977:293, host=? type=PATH (PATH) item=0 (0) name="maildrop" (maildrop) inode=14911367 (14911367) dev=03:07 (03:07) mode=040730 (dir,730) ouid=890 (unknown(890)) ogid=891 (unknown(891)) rdev=00:00 (00:00) obj=system_u:object_r:postfix_spool_maildrop_t:s0 (system_u:object_r:postfix_spool_maildrop_t:s0) event 2 has 1 records record 1 of type 1101(USER_ACCT) has 11 fields line=5 file=None event time: 1170021601.340:294, host=? type=USER_ACCT (USER_ACCT) pid=13015 (13015) uid=0 (root) auid=4294967295 (unset) subj=system_u:system_r:crond_t:s0-s0:c0.c1023 (system_u:system_r:crond_t:s0-s0:c0.c1023) acct=root (root) exe="/usr/sbin/crond" (/usr/sbin/crond) hostname=? (?) addr=? (?) terminal=cron (cron) res=success (success) event 3 has 1 records record 1 of type 1103(CRED_ACQ) has 11 fields line=6 file=None event time: 1170021601.342:295, host=? type=CRED_ACQ (CRED_ACQ) pid=13015 (13015) uid=0 (root) auid=4294967295 (unset) subj=system_u:system_r:crond_t:s0-s0:c0.c1023 (system_u:system_r:crond_t:s0-s0:c0.c1023) acct=root (root) exe="/usr/sbin/crond" (/usr/sbin/crond) hostname=? (?) addr=? (?) terminal=cron (cron) res=success (success) event 4 has 3 records record 1 of type 1006(LOGIN) has 10 fields line=7 file=None event time: 1170021601.343:296, host=? type=LOGIN (LOGIN) pid=2288 (2288) uid=0 (root) subj=system_u:system_r:init_t:s0 (system_u:system_r:init_t:s0) old-auid=4294967295 (unset) auid=42 (gdm) tty=(none) ((none)) old-ses=4294967295 (4294967295) ses=1 (1) res=1 (yes) record 2 of type 1300(SYSCALL) has 27 fields line=8 file=None event time: 1170021601.343:296, host=? type=SYSCALL (SYSCALL) arch=c000003e (x86_64) syscall=1 (write) success=yes (yes) exit=2 (2) a0=8 (0x8) a1=7fffa7aede20 (0x7fffa7aede20) a2=2 (0x2) a3=0 (0x0) items=0 (0) ppid=1 (1) pid=2288 (2288) auid=42 (gdm) uid=0 (root) gid=0 (root) euid=0 (root) suid=0 (root) fsuid=0 (root) egid=0 (root) sgid=0 (root) fsgid=0 (root) tty=(none) ((none)) ses=1 (1) comm="(systemd)" ((systemd)) exe="/usr/lib/systemd/systemd" (/usr/lib/systemd/systemd) subj=system_u:system_r:init_t:s0 (system_u:system_r:init_t:s0) key=(null) ((null)) record 3 of type 1327(PROCTITLE) has 2 fields line=9 file=None event time: 1170021601.343:296, host=? type=PROCTITLE (PROCTITLE) proctitle="(systemd)" ((systemd)) event 5 has 1 records record 1 of type 1105(USER_START) has 11 fields line=10 file=None event time: 1170021601.344:297, host=? type=USER_START (USER_START) pid=13015 (13015) uid=0 (root) auid=0 (root) subj=system_u:system_r:crond_t:s0-s0:c0.c1023 (system_u:system_r:crond_t:s0-s0:c0.c1023) acct=root (root) exe="/usr/sbin/crond" (/usr/sbin/crond) hostname=? (?) addr=? (?) terminal=cron (cron) res=success (success) event 6 has 1 records record 1 of type 1104(CRED_DISP) has 11 fields line=11 file=None event time: 1170021601.364:298, host=? type=CRED_DISP (CRED_DISP) pid=13015 (13015) uid=0 (root) auid=0 (root) subj=system_u:system_r:crond_t:s0-s0:c0.c1023 (system_u:system_r:crond_t:s0-s0:c0.c1023) acct=root (root) exe="/usr/sbin/crond" (/usr/sbin/crond) hostname=? (?) addr=? (?) terminal=cron (cron) res=success (success) event 7 has 1 records record 1 of type 1106(USER_END) has 11 fields line=12 file=None event time: 1170021601.366:299, host=? type=USER_END (USER_END) pid=13015 (13015) uid=0 (root) auid=0 (root) subj=system_u:system_r:crond_t:s0-s0:c0.c1023 (system_u:system_r:crond_t:s0-s0:c0.c1023) acct=root (root) exe="/usr/sbin/crond" (/usr/sbin/crond) hostname=? (?) addr=? (?) terminal=cron (cron) res=success (success) Test 10 Done Starting Test 11, walk LONG event records from a file... event 1 has 7 records record 1 of type 1300(SYSCALL) has 26 fields line=1 file=test4.log event time: 1655465398.534:25618, host=? type=SYSCALL (SYSCALL) arch=c000003e (x86_64) syscall=59 (execve) success=yes (yes) exit=0 (0) a0=8c403a0 (0x8c403a0) a1=8c3e8b0 (0x8c3e8b0) a2=fffffb6cc5b0 (0xfffffb6cc5b0) a3=0 (0x0) items=3 (3) ppid=105182 (105182) pid=105183 (105183) auid=573 (unknown(573)) uid=583 (unknown(583)) gid=583 (unknown(583)) euid=583 (unknown(583)) suid=583 (unknown(583)) fsuid=583 (unknown(583)) egid=583 (unknown(583)) sgid=583 (unknown(583)) fsgid=583 (unknown(583)) tty=pts2 (pts2) ses=2632 (2632) comm="ld" (ld) exe="/bin/sh4" (/bin/sh4) key=(null) ((null)) record 2 of type 1309(EXECVE) has 50 fields line=2 file=test4.log event time: 1655465398.534:25618, host=? type=EXECVE (EXECVE) argc=48 (48) a0="/bin/sh" (/bin/sh) a1="-efu" (-efu) a2="/usr/bin/ld" (/usr/bin/ld) a3="-plugin" (-plugin) a4="/usr/libexec/gcc/aarch64-alt-linux/8/liblto_plugin.so" (/usr/libexec/gcc/aarch64-alt-linux/8/liblto_plugin.so) a5="-plugin-opt=/usr/libexec/gcc/aarch64-alt-linux/8/lto-wrapper" (-plugin-opt=/usr/libexec/gcc/aarch64-alt-linux/8/lto-wrapper) a6="-plugin-opt=-fresolution=/usr/src/tmp/cchyHiZN.res" (-plugin-opt=-fresolution=/usr/src/tmp/cchyHiZN.res) a7="-plugin-opt=-pass-through=-lgcc" (-plugin-opt=-pass-through=-lgcc) a8="-plugin-opt=-pass-through=-lgcc_s" (-plugin-opt=-pass-through=-lgcc_s) a9="-plugin-opt=-pass-through=-lc" (-plugin-opt=-pass-through=-lc) a10="-plugin-opt=-pass-through=-lgcc" (-plugin-opt=-pass-through=-lgcc) a11="-plugin-opt=-pass-through=-lgcc_s" (-plugin-opt=-pass-through=-lgcc_s) a12="--build-id" (--build-id) a13="--no-add-needed" (--no-add-needed) a14="--eh-frame-hdr" (--eh-frame-hdr) a15="--hash-style=gnu" (--hash-style=gnu) a16="--as-needed" (--as-needed) a17="-shared" (-shared) a18="-X" (-X) a19="-EL" (-EL) a20="-maarch64linux" (-maarch64linux) a21="-o" (-o) a22="ztest105133.so" (ztest105133.so) a23="/usr/lib64/gcc/aarch64-alt-linux/8/../../../../lib64/crti.o" (/usr/lib64/gcc/aarch64-alt-linux/8/../../../../lib64/crti.o) a24="/usr/lib64/gcc/aarch64-alt-linux/8/crtbeginS.o" (/usr/lib64/gcc/aarch64-alt-linux/8/crtbeginS.o) a25="-L/usr/lib64/gcc/aarch64-alt-linux/8" (-L/usr/lib64/gcc/aarch64-alt-linux/8) a26="-L/usr/lib64/gcc/aarch64-alt-linux/8/../../../../lib64" (-L/usr/lib64/gcc/aarch64-alt-linux/8/../../../../lib64) a27="-L/lib/../lib64" (-L/lib/../lib64) a28="-L/usr/lib/../lib64" (-L/usr/lib/../lib64) a29="-L/usr/lib64/gcc/aarch64-alt-linux/8/../../.." (-L/usr/lib64/gcc/aarch64-alt-linux/8/../../..) a30="-soname" (-soname) a31="libz.so.1" (libz.so.1) a32="--version-script" (--version-script) a33="zlib.map" (zlib.map) a34="ztest105133.o" (ztest105133.o) a35="-lgcc" (-lgcc) a36="--push-state" (--push-state) a37="--as-needed" (--as-needed) a38="-lgcc_s" (-lgcc_s) a39="--pop-state" (--pop-state) a40="-lc" (-lc) a41="-lgcc" (-lgcc) a42="--push-state" (--push-state) a43="--as-needed" (--as-needed) a44="-lgcc_s" (-lgcc_s) a45="--pop-state" (--pop-state) a46="/usr/lib64/gcc/aarch64-alt-linux/8/crtendS.o" (/usr/lib64/gcc/aarch64-alt-linux/8/crtendS.o) a47="/usr/lib64/gcc/aarch64-alt-linux/8/../../../../lib64/crtn.o" (/usr/lib64/gcc/aarch64-alt-linux/8/../../../../lib64/crtn.o) record 3 of type 1307(CWD) has 2 fields line=3 file=test4.log event time: 1655465398.534:25618, host=? type=CWD (CWD) cwd="/usr/src/RPM/BUILD/zlib-1.2.11-alt1" (/usr/src/RPM/BUILD/zlib-1.2.11-alt1) record 4 of type 1302(PATH) has 15 fields line=4 file=test4.log event time: 1655465398.534:25618, host=? type=PATH (PATH) item=0 (0) name="/usr/bin/ld" (/usr/bin/ld) inode=40854 (40854) dev=00:30 (00:30) mode=0100755 (file,755) ouid=582 (unknown(582)) ogid=582 (unknown(582)) rdev=00:00 (00:00) nametype=NORMAL (NORMAL) cap_fp=0 (none) cap_fi=0 (none) cap_fe=0 (0) cap_fver=0 (0) cap_frootid=0 (0) record 5 of type 1302(PATH) has 15 fields line=5 file=test4.log event time: 1655465398.534:25618, host=? type=PATH (PATH) item=1 (1) name="/bin/sh" (/bin/sh) inode=33238 (33238) dev=00:30 (00:30) mode=0100755 (file,755) ouid=582 (unknown(582)) ogid=582 (unknown(582)) rdev=00:00 (00:00) nametype=NORMAL (NORMAL) cap_fp=0 (none) cap_fi=0 (none) cap_fe=0 (0) cap_fver=0 (0) cap_frootid=0 (0) record 6 of type 1302(PATH) has 15 fields line=6 file=test4.log event time: 1655465398.534:25618, host=? type=PATH (PATH) item=2 (2) name="/lib64/ld-linux-aarch64.so.1" (/lib64/ld-linux-aarch64.so.1) inode=33874 (33874) dev=00:30 (00:30) mode=0100755 (file,755) ouid=582 (unknown(582)) ogid=582 (unknown(582)) rdev=00:00 (00:00) nametype=NORMAL (NORMAL) cap_fp=0 (none) cap_fi=0 (none) cap_fe=0 (0) cap_fver=0 (0) cap_frootid=0 (0) record 7 of type 1327(PROCTITLE) has 2 fields line=7 file=test4.log event time: 1655465398.534:25618, host=? type=PROCTITLE (PROCTITLE) proctitle=2F62696E2F7368002D656675002F7573722F62696E2F6C64002D706C7567696E002F7573722F6C6962657865632F6763632F616172636836342D616C742D6C696E75782F382F6C69626C746F5F706C7567696E2E736F002D706C7567696E2D6F70743D2F7573722F6C6962657865632F6763632F616172636836342D616C742D (/bin/sh -efu /usr/bin/ld -plugin /usr/libexec/gcc/aarch64-alt-linux/8/liblto_plugin.so -plugin-opt=/usr/libexec/gcc/aarch64-alt-) event 2 has 6 records record 1 of type 1300(SYSCALL) has 26 fields line=8 file=test4.log event time: 1655465404.819:27091, host=? type=SYSCALL (SYSCALL) arch=c000003e (x86_64) syscall=59 (execve) success=yes (yes) exit=0 (0) a0=1a407f50 (0x1a407f50) a1=1a401cd0 (0x1a401cd0) a2=1a3ed090 (0x1a3ed090) a3=0 (0x0) items=2 (2) ppid=105932 (105932) pid=105933 (105933) auid=573 (unknown(573)) uid=583 (unknown(583)) gid=583 (unknown(583)) euid=583 (unknown(583)) suid=583 (unknown(583)) fsuid=583 (unknown(583)) egid=583 (unknown(583)) sgid=583 (unknown(583)) fsgid=583 (unknown(583)) tty=pts2 (pts2) ses=2632 (2632) comm="m4" (m4) exe="/usr/bin/m4" (/usr/bin/m4) key=(null) ((null)) record 2 of type 1309(EXECVE) has 218 fields line=9 file=test4.log event time: 1655465404.819:27091, host=? type=EXECVE (EXECVE) argc=216 (216) a0="/usr/bin/m4" (/usr/bin/m4) a1="--nesting-limit=1024" (--nesting-limit=1024) a2="--gnu" (--gnu) a3="--include=/usr/share/autoconf-2.60" (--include=/usr/share/autoconf-2.60) a4="--debug=aflq" (--debug=aflq) a5="--fatal-warning" (--fatal-warning) a6="--debugfile=autom4te.cache/traces.0t" (--debugfile=autom4te.cache/traces.0t) a7="--trace=AC_CHECK_LIBM" (--trace=AC_CHECK_LIBM) a8="--trace=AC_CONFIG_MACRO_DIR" (--trace=AC_CONFIG_MACRO_DIR) a9="--trace=AC_CONFIG_MACRO_DIR_TRACE" (--trace=AC_CONFIG_MACRO_DIR_TRACE) a10="--trace=AC_DEFUN" (--trace=AC_DEFUN) a11="--trace=AC_DEFUN_ONCE" (--trace=AC_DEFUN_ONCE) a12="--trace=AC_DEPLIBS_CHECK_METHOD" (--trace=AC_DEPLIBS_CHECK_METHOD) a13="--trace=AC_DISABLE_FAST_INSTALL" (--trace=AC_DISABLE_FAST_INSTALL) a14="--trace=AC_DISABLE_SHARED" (--trace=AC_DISABLE_SHARED) a15="--trace=AC_DISABLE_STATIC" (--trace=AC_DISABLE_STATIC) a16="--trace=AC_ENABLE_FAST_INSTALL" (--trace=AC_ENABLE_FAST_INSTALL) a17="--trace=AC_ENABLE_SHARED" (--trace=AC_ENABLE_SHARED) a18="--trace=AC_ENABLE_STATIC" (--trace=AC_ENABLE_STATIC) a19="--trace=AC_LIBLTDL_CONVENIENCE" (--trace=AC_LIBLTDL_CONVENIENCE) a20="--trace=AC_LIBLTDL_INSTALLABLE" (--trace=AC_LIBLTDL_INSTALLABLE) a21="--trace=AC_LIBTOOL_COMPILER_OPTION" (--trace=AC_LIBTOOL_COMPILER_OPTION) a22="--trace=AC_LIBTOOL_CONFIG" (--trace=AC_LIBTOOL_CONFIG) a23="--trace=AC_LIBTOOL_CXX" (--trace=AC_LIBTOOL_CXX) a24="--trace=AC_LIBTOOL_DLOPEN" (--trace=AC_LIBTOOL_DLOPEN) a25="--trace=AC_LIBTOOL_DLOPEN_SELF" (--trace=AC_LIBTOOL_DLOPEN_SELF) a26="--trace=AC_LIBTOOL_F77" (--trace=AC_LIBTOOL_F77) a27="--trace=AC_LIBTOOL_FC" (--trace=AC_LIBTOOL_FC) a28="--trace=AC_LIBTOOL_GCJ" (--trace=AC_LIBTOOL_GCJ) a29="--trace=AC_LIBTOOL_LANG_CXX_CONFIG" (--trace=AC_LIBTOOL_LANG_CXX_CONFIG) a30="--trace=AC_LIBTOOL_LANG_C_CONFIG" (--trace=AC_LIBTOOL_LANG_C_CONFIG) a31="--trace=AC_LIBTOOL_LANG_F77_CONFIG" (--trace=AC_LIBTOOL_LANG_F77_CONFIG) a32="--trace=AC_LIBTOOL_LANG_GCJ_CONFIG" (--trace=AC_LIBTOOL_LANG_GCJ_CONFIG) a33="--trace=AC_LIBTOOL_LANG_RC_CONFIG" (--trace=AC_LIBTOOL_LANG_RC_CONFIG) a34="--trace=AC_LIBTOOL_LINKER_OPTION" (--trace=AC_LIBTOOL_LINKER_OPTION) a35="--trace=AC_LIBTOOL_OBJDIR" (--trace=AC_LIBTOOL_OBJDIR) a36="--trace=AC_LIBTOOL_PICMODE" (--trace=AC_LIBTOOL_PICMODE) a37="--trace=AC_LIBTOOL_POSTDEP_PREDEP" (--trace=AC_LIBTOOL_POSTDEP_PREDEP) a38="--trace=AC_LIBTOOL_PROG_CC_C_O" (--trace=AC_LIBTOOL_PROG_CC_C_O) a39="--trace=AC_LIBTOOL_PROG_COMPILER_NO_RTTI" (--trace=AC_LIBTOOL_PROG_COMPILER_NO_RTTI) a40="--trace=AC_LIBTOOL_PROG_COMPILER_PIC" (--trace=AC_LIBTOOL_PROG_COMPILER_PIC) a41="--trace=AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH" (--trace=AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH) a42="--trace=AC_LIBTOOL_PROG_LD_SHLIBS" (--trace=AC_LIBTOOL_PROG_LD_SHLIBS) a43="--trace=AC_LIBTOOL_RC" (--trace=AC_LIBTOOL_RC) a44="--trace=AC_LIBTOOL_SETUP" (--trace=AC_LIBTOOL_SETUP) a45="--trace=AC_LIBTOOL_SYS_DYNAMIC_LINKER" (--trace=AC_LIBTOOL_SYS_DYNAMIC_LINKER) a46="--trace=AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE" (--trace=AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE) a47="--trace=AC_LIBTOOL_SYS_HARD_LINK_LOCKS" (--trace=AC_LIBTOOL_SYS_HARD_LINK_LOCKS) a48="--trace=AC_LIBTOOL_SYS_LIB_STRIP" (--trace=AC_LIBTOOL_SYS_LIB_STRIP) a49="--trace=AC_LIBTOOL_SYS_MAX_CMD_LEN" (--trace=AC_LIBTOOL_SYS_MAX_CMD_LEN) a50="--trace=AC_LIBTOOL_SYS_OLD_ARCHIVE" (--trace=AC_LIBTOOL_SYS_OLD_ARCHIVE) a51="--trace=AC_LIBTOOL_WIN32_DLL" (--trace=AC_LIBTOOL_WIN32_DLL) a52="--trace=AC_LIB_LTDL" (--trace=AC_LIB_LTDL) a53="--trace=AC_LTDL_DLLIB" (--trace=AC_LTDL_DLLIB) a54="--trace=AC_LTDL_DLSYM_USCORE" (--trace=AC_LTDL_DLSYM_USCORE) a55="--trace=AC_LTDL_ENABLE_INSTALL" (--trace=AC_LTDL_ENABLE_INSTALL) a56="--trace=AC_LTDL_OBJDIR" (--trace=AC_LTDL_OBJDIR) a57="--trace=AC_LTDL_PREOPEN" (--trace=AC_LTDL_PREOPEN) a58="--trace=AC_LTDL_SHLIBEXT" (--trace=AC_LTDL_SHLIBEXT) a59="--trace=AC_LTDL_SHLIBPATH" (--trace=AC_LTDL_SHLIBPATH) a60="--trace=AC_LTDL_SYMBOL_USCORE" (--trace=AC_LTDL_SYMBOL_USCORE) a61="--trace=AC_LTDL_SYSSEARCHPATH" (--trace=AC_LTDL_SYSSEARCHPATH) a62="--trace=AC_LTDL_SYS_DLOPEN_DEPLIBS" (--trace=AC_LTDL_SYS_DLOPEN_DEPLIBS) a63="--trace=AC_PATH_MAGIC" (--trace=AC_PATH_MAGIC) a64="--trace=AC_PATH_TOOL_PREFIX" (--trace=AC_PATH_TOOL_PREFIX) a65="--trace=AC_PROG_EGREP" (--trace=AC_PROG_EGREP) a66="--trace=AC_PROG_LD" (--trace=AC_PROG_LD) a67="--trace=AC_PROG_LD_GNU" (--trace=AC_PROG_LD_GNU) a68="--trace=AC_PROG_LD_RELOAD_FLAG" (--trace=AC_PROG_LD_RELOAD_FLAG) a69="--trace=AC_PROG_LIBTOOL" (--trace=AC_PROG_LIBTOOL) a70="--trace=AC_PROG_NM" (--trace=AC_PROG_NM) a71="--trace=AC_WITH_LTDL" (--trace=AC_WITH_LTDL) a72="--trace=AM_AUTOMAKE_VERSION" (--trace=AM_AUTOMAKE_VERSION) a73="--trace=AM_AUX_DIR_EXPAND" (--trace=AM_AUX_DIR_EXPAND) a74="--trace=AM_CONDITIONAL" (--trace=AM_CONDITIONAL) a75="--trace=AM_DEP_TRACK" (--trace=AM_DEP_TRACK) a76="--trace=AM_DISABLE_SHARED" (--trace=AM_DISABLE_SHARED) a77="--trace=AM_DISABLE_STATIC" (--trace=AM_DISABLE_STATIC) a78="--trace=AM_ENABLE_SHARED" (--trace=AM_ENABLE_SHARED) a79="--trace=AM_ENABLE_STATIC" (--trace=AM_ENABLE_STATIC) a80="--trace=AM_INIT_AUTOMAKE" (--trace=AM_INIT_AUTOMAKE) a81="--trace=AM_MAKE_INCLUDE" (--trace=AM_MAKE_INCLUDE) a82="--trace=AM_MISSING_HAS_RUN" (--trace=AM_MISSING_HAS_RUN) a83="--trace=AM_MISSING_PROG" (--trace=AM_MISSING_PROG) a84="--trace=AM_OUTPUT_DEPENDENCY_COMMANDS" (--trace=AM_OUTPUT_DEPENDENCY_COMMANDS) a85="--trace=AM_PROG_CC_C_O" (--trace=AM_PROG_CC_C_O) a86="--trace=AM_PROG_INSTALL_SH" (--trace=AM_PROG_INSTALL_SH) a87="--trace=AM_PROG_INSTALL_STRIP" (--trace=AM_PROG_INSTALL_STRIP) a88="--trace=AM_PROG_LD" (--trace=AM_PROG_LD) a89="--trace=AM_PROG_LIBTOOL" (--trace=AM_PROG_LIBTOOL) a90="--trace=AM_PROG_NM" (--trace=AM_PROG_NM) a91="--trace=AM_RUN_LOG" (--trace=AM_RUN_LOG) a92="--trace=AM_SANITY_CHECK" (--trace=AM_SANITY_CHECK) a93="--trace=AM_SET_CURRENT_AUTOMAKE_VERSION" (--trace=AM_SET_CURRENT_AUTOMAKE_VERSION) a94="--trace=AM_SET_DEPDIR" (--trace=AM_SET_DEPDIR) a95="--trace=AM_SET_LEADING_DOT" (--trace=AM_SET_LEADING_DOT) a96="--trace=AM_SILENT_RULES" (--trace=AM_SILENT_RULES) a97="--trace=AM_SUBST_NOTMAKE" (--trace=AM_SUBST_NOTMAKE) a98="--trace=AU_DEFUN" (--trace=AU_DEFUN) a99="--trace=LTDL_CONVENIENCE" (--trace=LTDL_CONVENIENCE) a100="--trace=LTDL_INIT" (--trace=LTDL_INIT) a101="--trace=LTDL_INSTALLABLE" (--trace=LTDL_INSTALLABLE) a102="--trace=LTOBSOLETE_VERSION" (--trace=LTOBSOLETE_VERSION) a103="--trace=LTOPTIONS_VERSION" (--trace=LTOPTIONS_VERSION) a104="--trace=LTSUGAR_VERSION" (--trace=LTSUGAR_VERSION) a105="--trace=LTVERSION_VERSION" (--trace=LTVERSION_VERSION) a106="--trace=LT_AC_PROG_EGREP" (--trace=LT_AC_PROG_EGREP) a107="--trace=LT_AC_PROG_GCJ" (--trace=LT_AC_PROG_GCJ) a108="--trace=LT_AC_PROG_RC" (--trace=LT_AC_PROG_RC) a109="--trace=LT_AC_PROG_SED" (--trace=LT_AC_PROG_SED) a110="--trace=LT_CMD_MAX_LEN" (--trace=LT_CMD_MAX_LEN) a111="--trace=LT_CONFIG_LTDL_DIR" (--trace=LT_CONFIG_LTDL_DIR) a112="--trace=LT_FUNC_ARGZ" (--trace=LT_FUNC_ARGZ) a113="--trace=LT_FUNC_DLSYM_USCORE" (--trace=LT_FUNC_DLSYM_USCORE) a114="--trace=LT_INIT" (--trace=LT_INIT) a115="--trace=LT_LANG" (--trace=LT_LANG) a116="--trace=LT_LIB_DLLOAD" (--trace=LT_LIB_DLLOAD) a117="--trace=LT_LIB_M" (--trace=LT_LIB_M) a118="--trace=LT_OUTPUT" (--trace=LT_OUTPUT) a119="--trace=LT_PATH_LD" (--trace=LT_PATH_LD) a120="--trace=LT_PATH_NM" (--trace=LT_PATH_NM) a121="--trace=LT_PROG_GCJ" (--trace=LT_PROG_GCJ) a122="--trace=LT_PROG_GO" (--trace=LT_PROG_GO) a123="--trace=LT_PROG_RC" (--trace=LT_PROG_RC) a124="--trace=LT_SUPPORTED_TAG" (--trace=LT_SUPPORTED_TAG) a125="--trace=LT_SYS_DLOPEN_DEPLIBS" (--trace=LT_SYS_DLOPEN_DEPLIBS) a126="--trace=LT_SYS_DLOPEN_SELF" (--trace=LT_SYS_DLOPEN_SELF) a127="--trace=LT_SYS_DLSEARCH_PATH" (--trace=LT_SYS_DLSEARCH_PATH) a128="--trace=LT_SYS_MODULE_EXT" (--trace=LT_SYS_MODULE_EXT) a129="--trace=LT_SYS_MODULE_PATH" (--trace=LT_SYS_MODULE_PATH) a130="--trace=LT_SYS_SYMBOL_USCORE" (--trace=LT_SYS_SYMBOL_USCORE) a131="--trace=LT_WITH_LTDL" (--trace=LT_WITH_LTDL) a132="--trace=_AC_AM_CONFIG_HEADER_HOOK" (--trace=_AC_AM_CONFIG_HEADER_HOOK) a133="--trace=_AC_PROG_LIBTOOL" (--trace=_AC_PROG_LIBTOOL) a134="--trace=_AM_AUTOCONF_VERSION" (--trace=_AM_AUTOCONF_VERSION) a135="--trace=_AM_CONFIG_MACRO_DIRS" (--trace=_AM_CONFIG_MACRO_DIRS) a136="--trace=_AM_DEPENDENCIES" (--trace=_AM_DEPENDENCIES) a137="--trace=_AM_IF_OPTION" (--trace=_AM_IF_OPTION) a138="--trace=_AM_MANGLE_OPTION" (--trace=_AM_MANGLE_OPTION) a139="--trace=_AM_OUTPUT_DEPENDENCY_COMMANDS" (--trace=_AM_OUTPUT_DEPENDENCY_COMMANDS) a140="--trace=_AM_PROG_CC_C_O" (--trace=_AM_PROG_CC_C_O) a141="--trace=_AM_PROG_TAR" (--trace=_AM_PROG_TAR) a142="--trace=_AM_SET_OPTION" (--trace=_AM_SET_OPTION) a143="--trace=_AM_SET_OPTIONS" (--trace=_AM_SET_OPTIONS) a144="--trace=_AM_SUBST_NOTMAKE" (--trace=_AM_SUBST_NOTMAKE) a145="--trace=_LTDL_SETUP" (--trace=_LTDL_SETUP) a146="--trace=_LT_AC_CHECK_DLFCN" (--trace=_LT_AC_CHECK_DLFCN) a147="--trace=_LT_AC_FILE_LTDLL_C" (--trace=_LT_AC_FILE_LTDLL_C) a148="--trace=_LT_AC_LANG_CXX" (--trace=_LT_AC_LANG_CXX) a149="--trace=_LT_AC_LANG_CXX_CONFIG" (--trace=_LT_AC_LANG_CXX_CONFIG) a150="--trace=_LT_AC_LANG_C_CONFIG" (--trace=_LT_AC_LANG_C_CONFIG) a151="--trace=_LT_AC_LANG_F77" (--trace=_LT_AC_LANG_F77) a152="--trace=_LT_AC_LANG_F77_CONFIG" (--trace=_LT_AC_LANG_F77_CONFIG) a153="--trace=_LT_AC_LANG_GCJ" (--trace=_LT_AC_LANG_GCJ) a154="--trace=_LT_AC_LANG_GCJ_CONFIG" (--trace=_LT_AC_LANG_GCJ_CONFIG) a155="--trace=_LT_AC_LANG_RC_CONFIG" (--trace=_LT_AC_LANG_RC_CONFIG) a156="--trace=_LT_AC_LOCK" (--trace=_LT_AC_LOCK) a157="--trace=_LT_AC_PROG_CXXCPP" (--trace=_LT_AC_PROG_CXXCPP) a158="--trace=_LT_AC_PROG_ECHO_BACKSLASH" (--trace=_LT_AC_PROG_ECHO_BACKSLASH) a159="--trace=_LT_AC_SHELL_INIT" (--trace=_LT_AC_SHELL_INIT) a160="--trace=_LT_AC_SYS_COMPILER" (--trace=_LT_AC_SYS_COMPILER) a161="--trace=_LT_AC_SYS_LIBPATH_AIX" (--trace=_LT_AC_SYS_LIBPATH_AIX) a162="--trace=_LT_AC_TAGCONFIG" (--trace=_LT_AC_TAGCONFIG) a163="--trace=_LT_AC_TAGVAR" (--trace=_LT_AC_TAGVAR) a164="--trace=_LT_AC_TRY_DLOPEN_SELF" (--trace=_LT_AC_TRY_DLOPEN_SELF) a165="--trace=_LT_CC_BASENAME" (--trace=_LT_CC_BASENAME) a166="--trace=_LT_COMPILER_BOILERPLATE" (--trace=_LT_COMPILER_BOILERPLATE) a167="--trace=_LT_COMPILER_OPTION" (--trace=_LT_COMPILER_OPTION) a168="--trace=_LT_DLL_DEF_P" (--trace=_LT_DLL_DEF_P) a169="--trace=_LT_LIBOBJ" (--trace=_LT_LIBOBJ) a170="--trace=_LT_LINKER_BOILERPLATE" (--trace=_LT_LINKER_BOILERPLATE) a171="--trace=_LT_LINKER_OPTION" (--trace=_LT_LINKER_OPTION) a172="--trace=_LT_PATH_TOOL_PREFIX" (--trace=_LT_PATH_TOOL_PREFIX) a173="--trace=_LT_PREPARE_SED_QUOTE_VARS" (--trace=_LT_PREPARE_SED_QUOTE_VARS) a174="--trace=_LT_PROG_CXX" (--trace=_LT_PROG_CXX) a175="--trace=_LT_PROG_ECHO_BACKSLASH" (--trace=_LT_PROG_ECHO_BACKSLASH) a176="--trace=_LT_PROG_F77" (--trace=_LT_PROG_F77) a177="--trace=_LT_PROG_FC" (--trace=_LT_PROG_FC) a178="--trace=_LT_PROG_LTMAIN" (--trace=_LT_PROG_LTMAIN) a179="--trace=_LT_REQUIRED_DARWIN_CHECKS" (--trace=_LT_REQUIRED_DARWIN_CHECKS) a180="--trace=_LT_WITH_SYSROOT" (--trace=_LT_WITH_SYSROOT) a181="--trace=_m4_warn" (--trace=_m4_warn) a182="--trace=include" (--trace=include) a183="--trace=m4_include" (--trace=m4_include) a184="--trace=m4_pattern_allow" (--trace=m4_pattern_allow) a185="--trace=m4_pattern_forbid" (--trace=m4_pattern_forbid) a186="--reload-state=/usr/share/autoconf-2.60/autoconf/autoconf.m4f" (--reload-state=/usr/share/autoconf-2.60/autoconf/autoconf.m4f) a187="--undefine=__m4_version__" (--undefine=__m4_version__) a188="-" (-) a189="/usr/share/aclocal-1.16/internal/ac-config-macro-dirs.m4" (/usr/share/aclocal-1.16/internal/ac-config-macro-dirs.m4) a190="/usr/share/libtool/aclocal/libtool.m4" (/usr/share/libtool/aclocal/libtool.m4) a191="/usr/share/libtool/aclocal/ltargz.m4" (/usr/share/libtool/aclocal/ltargz.m4) a192="/usr/share/libtool/aclocal/ltdl.m4" (/usr/share/libtool/aclocal/ltdl.m4) a193="/usr/share/libtool/aclocal/ltoptions.m4" (/usr/share/libtool/aclocal/ltoptions.m4) a194="/usr/share/libtool/aclocal/ltsugar.m4" (/usr/share/libtool/aclocal/ltsugar.m4) a195="/usr/share/libtool/aclocal/ltversion.m4" (/usr/share/libtool/aclocal/ltversion.m4) a196="/usr/share/libtool/aclocal/lt~obsolete.m4" (/usr/share/libtool/aclocal/lt~obsolete.m4) a197="/usr/share/aclocal-1.16/amversion.m4" (/usr/share/aclocal-1.16/amversion.m4) a198="/usr/share/aclocal-1.16/auxdir.m4" (/usr/share/aclocal-1.16/auxdir.m4) a199="/usr/share/aclocal-1.16/cond.m4" (/usr/share/aclocal-1.16/cond.m4) a200="/usr/share/aclocal-1.16/depend.m4" (/usr/share/aclocal-1.16/depend.m4) a201="/usr/share/aclocal-1.16/depout.m4" (/usr/share/aclocal-1.16/depout.m4) a202="/usr/share/aclocal-1.16/init.m4" (/usr/share/aclocal-1.16/init.m4) a203="/usr/share/aclocal-1.16/install-sh.m4" (/usr/share/aclocal-1.16/install-sh.m4) a204="/usr/share/aclocal-1.16/lead-dot.m4" (/usr/share/aclocal-1.16/lead-dot.m4) a205="/usr/share/aclocal-1.16/make.m4" (/usr/share/aclocal-1.16/make.m4) a206="/usr/share/aclocal-1.16/missing.m4" (/usr/share/aclocal-1.16/missing.m4) a207="/usr/share/aclocal-1.16/options.m4" (/usr/share/aclocal-1.16/options.m4) a208="/usr/share/aclocal-1.16/prog-cc-c-o.m4" (/usr/share/aclocal-1.16/prog-cc-c-o.m4) a209="/usr/share/aclocal-1.16/runlog.m4" (/usr/share/aclocal-1.16/runlog.m4) a210="/usr/share/aclocal-1.16/sanity.m4" (/usr/share/aclocal-1.16/sanity.m4) a211="/usr/share/aclocal-1.16/silent.m4" (/usr/share/aclocal-1.16/silent.m4) a212="/usr/share/aclocal-1.16/strip.m4" (/usr/share/aclocal-1.16/strip.m4) a213="/usr/share/aclocal-1.16/substnot.m4" (/usr/share/aclocal-1.16/substnot.m4) a214="/usr/share/aclocal-1.16/tar.m4" (/usr/share/aclocal-1.16/tar.m4) a215="configure.ac" (configure.ac) record 3 of type 1307(CWD) has 2 fields line=10 file=test4.log event time: 1655465404.819:27091, host=? type=CWD (CWD) cwd="/usr/src/RPM/BUILD/zlib-1.2.11-alt1/contrib/minizip" (/usr/src/RPM/BUILD/zlib-1.2.11-alt1/contrib/minizip) record 4 of type 1302(PATH) has 15 fields line=11 file=test4.log event time: 1655465404.819:27091, host=? type=PATH (PATH) item=0 (0) name="/usr/bin/m4" (/usr/bin/m4) inode=40839 (40839) dev=00:30 (00:30) mode=0100755 (file,755) ouid=582 (unknown(582)) ogid=582 (unknown(582)) rdev=00:00 (00:00) nametype=NORMAL (NORMAL) cap_fp=0 (none) cap_fi=0 (none) cap_fe=0 (0) cap_fver=0 (0) cap_frootid=0 (0) record 5 of type 1302(PATH) has 15 fields line=12 file=test4.log event time: 1655465404.819:27091, host=? type=PATH (PATH) item=1 (1) name="/lib64/ld-linux-aarch64.so.1" (/lib64/ld-linux-aarch64.so.1) inode=33874 (33874) dev=00:30 (00:30) mode=0100755 (file,755) ouid=582 (unknown(582)) ogid=582 (unknown(582)) rdev=00:00 (00:00) nametype=NORMAL (NORMAL) cap_fp=0 (none) cap_fi=0 (none) cap_fe=0 (0) cap_fver=0 (0) cap_frootid=0 (0) record 6 of type 1327(PROCTITLE) has 2 fields line=13 file=test4.log event time: 1655465404.819:27091, host=? type=PROCTITLE (PROCTITLE) proctitle=2F7573722F62696E2F6D34002D2D6E657374696E672D6C696D69743D31303234002D2D676E75002D2D696E636C7564653D2F7573722F73686172652F6175746F636F6E662D322E3630002D2D64656275673D61666C71002D2D666174616C2D7761726E696E67002D2D646562756766696C653D6175746F6D3474652E63616368 (/usr/bin/m4 --nesting-limit=1024 --gnu --include=/usr/share/autoconf-2.60 --debug=aflq --fatal-warning --debugfile=autom4te.cach) Test 11 Done Finished non-admin tests audit-4.0.2/auparse/test/test4.log0000644001034500103450000002566414655201403012506 type=SYSCALL msg=audit(1655465398.534:25618): arch=c000003e syscall=59 success=yes exit=0 a0=8c403a0 a1=8c3e8b0 a2=fffffb6cc5b0 a3=0 items=3 ppid=105182 pid=105183 auid=573 uid=583 gid=583 euid=583 suid=583 fsuid=583 egid=583 sgid=583 fsgid=583 tty=pts2 ses=2632 comm="ld" exe="/bin/sh4" key=(null) type=EXECVE msg=audit(1655465398.534:25618): argc=48 a0="/bin/sh" a1="-efu" a2="/usr/bin/ld" a3="-plugin" a4="/usr/libexec/gcc/aarch64-alt-linux/8/liblto_plugin.so" a5="-plugin-opt=/usr/libexec/gcc/aarch64-alt-linux/8/lto-wrapper" a6="-plugin-opt=-fresolution=/usr/src/tmp/cchyHiZN.res" a7="-plugin-opt=-pass-through=-lgcc" a8="-plugin-opt=-pass-through=-lgcc_s" a9="-plugin-opt=-pass-through=-lc" a10="-plugin-opt=-pass-through=-lgcc" a11="-plugin-opt=-pass-through=-lgcc_s" a12="--build-id" a13="--no-add-needed" a14="--eh-frame-hdr" a15="--hash-style=gnu" a16="--as-needed" a17="-shared" a18="-X" a19="-EL" a20="-maarch64linux" a21="-o" a22="ztest105133.so" a23="/usr/lib64/gcc/aarch64-alt-linux/8/../../../../lib64/crti.o" a24="/usr/lib64/gcc/aarch64-alt-linux/8/crtbeginS.o" a25="-L/usr/lib64/gcc/aarch64-alt-linux/8" a26="-L/usr/lib64/gcc/aarch64-alt-linux/8/../../../../lib64" a27="-L/lib/../lib64" a28="-L/usr/lib/../lib64" a29="-L/usr/lib64/gcc/aarch64-alt-linux/8/../../.." a30="-soname" a31="libz.so.1" a32="--version-script" a33="zlib.map" a34="ztest105133.o" a35="-lgcc" a36="--push-state" a37="--as-needed" a38="-lgcc_s" a39="--pop-state" a40="-lc" a41="-lgcc" a42="--push-state" a43="--as-needed" a44="-lgcc_s" a45="--pop-state" a46="/usr/lib64/gcc/aarch64-alt-linux/8/crtendS.o" a47="/usr/lib64/gcc/aarch64-alt-linux/8/../../../../lib64/crtn.o" type=CWD msg=audit(1655465398.534:25618): cwd="/usr/src/RPM/BUILD/zlib-1.2.11-alt1" type=PATH msg=audit(1655465398.534:25618): item=0 name="/usr/bin/ld" inode=40854 dev=00:30 mode=0100755 ouid=582 ogid=582 rdev=00:00 nametype=NORMAL cap_fp=0 cap_fi=0 cap_fe=0 cap_fver=0 cap_frootid=0 type=PATH msg=audit(1655465398.534:25618): item=1 name="/bin/sh" inode=33238 dev=00:30 mode=0100755 ouid=582 ogid=582 rdev=00:00 nametype=NORMAL cap_fp=0 cap_fi=0 cap_fe=0 cap_fver=0 cap_frootid=0 type=PATH msg=audit(1655465398.534:25618): item=2 name="/lib64/ld-linux-aarch64.so.1" inode=33874 dev=00:30 mode=0100755 ouid=582 ogid=582 rdev=00:00 nametype=NORMAL cap_fp=0 cap_fi=0 cap_fe=0 cap_fver=0 cap_frootid=0 type=PROCTITLE msg=audit(1655465398.534:25618): proctitle=2F62696E2F7368002D656675002F7573722F62696E2F6C64002D706C7567696E002F7573722F6C6962657865632F6763632F616172636836342D616C742D6C696E75782F382F6C69626C746F5F706C7567696E2E736F002D706C7567696E2D6F70743D2F7573722F6C6962657865632F6763632F616172636836342D616C742D type=SYSCALL msg=audit(1655465404.819:27091): arch=c000003e syscall=59 success=yes exit=0 a0=1a407f50 a1=1a401cd0 a2=1a3ed090 a3=0 items=2 ppid=105932 pid=105933 auid=573 uid=583 gid=583 euid=583 suid=583 fsuid=583 egid=583 sgid=583 fsgid=583 tty=pts2 ses=2632 comm="m4" exe="/usr/bin/m4" key=(null) type=EXECVE msg=audit(1655465404.819:27091): argc=216 a0="/usr/bin/m4" a1="--nesting-limit=1024" a2="--gnu" a3="--include=/usr/share/autoconf-2.60" a4="--debug=aflq" a5="--fatal-warning" a6="--debugfile=autom4te.cache/traces.0t" a7="--trace=AC_CHECK_LIBM" a8="--trace=AC_CONFIG_MACRO_DIR" a9="--trace=AC_CONFIG_MACRO_DIR_TRACE" a10="--trace=AC_DEFUN" a11="--trace=AC_DEFUN_ONCE" a12="--trace=AC_DEPLIBS_CHECK_METHOD" a13="--trace=AC_DISABLE_FAST_INSTALL" a14="--trace=AC_DISABLE_SHARED" a15="--trace=AC_DISABLE_STATIC" a16="--trace=AC_ENABLE_FAST_INSTALL" a17="--trace=AC_ENABLE_SHARED" a18="--trace=AC_ENABLE_STATIC" a19="--trace=AC_LIBLTDL_CONVENIENCE" a20="--trace=AC_LIBLTDL_INSTALLABLE" a21="--trace=AC_LIBTOOL_COMPILER_OPTION" a22="--trace=AC_LIBTOOL_CONFIG" a23="--trace=AC_LIBTOOL_CXX" a24="--trace=AC_LIBTOOL_DLOPEN" a25="--trace=AC_LIBTOOL_DLOPEN_SELF" a26="--trace=AC_LIBTOOL_F77" a27="--trace=AC_LIBTOOL_FC" a28="--trace=AC_LIBTOOL_GCJ" a29="--trace=AC_LIBTOOL_LANG_CXX_CONFIG" a30="--trace=AC_LIBTOOL_LANG_C_CONFIG" a31="--trace=AC_LIBTOOL_LANG_F77_CONFIG" a32="--trace=AC_LIBTOOL_LANG_GCJ_CONFIG" a33="--trace=AC_LIBTOOL_LANG_RC_CONFIG" a34="--trace=AC_LIBTOOL_LINKER_OPTION" a35="--trace=AC_LIBTOOL_OBJDIR" a36="--trace=AC_LIBTOOL_PICMODE" a37="--trace=AC_LIBTOOL_POSTDEP_PREDEP" a38="--trace=AC_LIBTOOL_PROG_CC_C_O" a39="--trace=AC_LIBTOOL_PROG_COMPILER_NO_RTTI" a40="--trace=AC_LIBTOOL_PROG_COMPILER_PIC" a41="--trace=AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH" a42="--trace=AC_LIBTOOL_PROG_LD_SHLIBS" a43="--trace=AC_LIBTOOL_RC" a44="--trace=AC_LIBTOOL_SETUP" a45="--trace=AC_LIBTOOL_SYS_DYNAMIC_LINKER" a46="--trace=AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE" a47="--trace=AC_LIBTOOL_SYS_HARD_LINK_LOCKS" a48="--trace=AC_LIBTOOL_SYS_LIB_STRIP" a49="--trace=AC_LIBTOOL_SYS_MAX_CMD_LEN" a50="--trace=AC_LIBTOOL_SYS_OLD_ARCHIVE" a51="--trace=AC_LIBTOOL_WIN32_DLL" a52="--trace=AC_LIB_LTDL" a53="--trace=AC_LTDL_DLLIB" a54="--trace=AC_LTDL_DLSYM_USCORE" a55="--trace=AC_LTDL_ENABLE_INSTALL" a56="--trace=AC_LTDL_OBJDIR" a57="--trace=AC_LTDL_PREOPEN" a58="--trace=AC_LTDL_SHLIBEXT" a59="--trace=AC_LTDL_SHLIBPATH" a60="--trace=AC_LTDL_SYMBOL_USCORE" a61="--trace=AC_LTDL_SYSSEARCHPATH" a62="--trace=AC_LTDL_SYS_DLOPEN_DEPLIBS" a63="--trace=AC_PATH_MAGIC" a64="--trace=AC_PATH_TOOL_PREFIX" a65="--trace=AC_PROG_EGREP" a66="--trace=AC_PROG_LD" a67="--trace=AC_PROG_LD_GNU" a68="--trace=AC_PROG_LD_RELOAD_FLAG" a69="--trace=AC_PROG_LIBTOOL" a70="--trace=AC_PROG_NM" a71="--trace=AC_WITH_LTDL" a72="--trace=AM_AUTOMAKE_VERSION" a73="--trace=AM_AUX_DIR_EXPAND" a74="--trace=AM_CONDITIONAL" a75="--trace=AM_DEP_TRACK" a76="--trace=AM_DISABLE_SHARED" a77="--trace=AM_DISABLE_STATIC" a78="--trace=AM_ENABLE_SHARED" a79="--trace=AM_ENABLE_STATIC" a80="--trace=AM_INIT_AUTOMAKE" a81="--trace=AM_MAKE_INCLUDE" a82="--trace=AM_MISSING_HAS_RUN" a83="--trace=AM_MISSING_PROG" a84="--trace=AM_OUTPUT_DEPENDENCY_COMMANDS" a85="--trace=AM_PROG_CC_C_O" a86="--trace=AM_PROG_INSTALL_SH" a87="--trace=AM_PROG_INSTALL_STRIP" a88="--trace=AM_PROG_LD" a89="--trace=AM_PROG_LIBTOOL" a90="--trace=AM_PROG_NM" a91="--trace=AM_RUN_LOG" a92="--trace=AM_SANITY_CHECK" a93="--trace=AM_SET_CURRENT_AUTOMAKE_VERSION" a94="--trace=AM_SET_DEPDIR" a95="--trace=AM_SET_LEADING_DOT" a96="--trace=AM_SILENT_RULES" a97="--trace=AM_SUBST_NOTMAKE" a98="--trace=AU_DEFUN" a99="--trace=LTDL_CONVENIENCE" a100="--trace=LTDL_INIT" a101="--trace=LTDL_INSTALLABLE" a102="--trace=LTOBSOLETE_VERSION" a103="--trace=LTOPTIONS_VERSION" a104="--trace=LTSUGAR_VERSION" a105="--trace=LTVERSION_VERSION" a106="--trace=LT_AC_PROG_EGREP" a107="--trace=LT_AC_PROG_GCJ" a108="--trace=LT_AC_PROG_RC" a109="--trace=LT_AC_PROG_SED" a110="--trace=LT_CMD_MAX_LEN" a111="--trace=LT_CONFIG_LTDL_DIR" a112="--trace=LT_FUNC_ARGZ" a113="--trace=LT_FUNC_DLSYM_USCORE" a114="--trace=LT_INIT" a115="--trace=LT_LANG" a116="--trace=LT_LIB_DLLOAD" a117="--trace=LT_LIB_M" a118="--trace=LT_OUTPUT" a119="--trace=LT_PATH_LD" a120="--trace=LT_PATH_NM" a121="--trace=LT_PROG_GCJ" a122="--trace=LT_PROG_GO" a123="--trace=LT_PROG_RC" a124="--trace=LT_SUPPORTED_TAG" a125="--trace=LT_SYS_DLOPEN_DEPLIBS" a126="--trace=LT_SYS_DLOPEN_SELF" a127="--trace=LT_SYS_DLSEARCH_PATH" a128="--trace=LT_SYS_MODULE_EXT" a129="--trace=LT_SYS_MODULE_PATH" a130="--trace=LT_SYS_SYMBOL_USCORE" a131="--trace=LT_WITH_LTDL" a132="--trace=_AC_AM_CONFIG_HEADER_HOOK" a133="--trace=_AC_PROG_LIBTOOL" a134="--trace=_AM_AUTOCONF_VERSION" a135="--trace=_AM_CONFIG_MACRO_DIRS" a136="--trace=_AM_DEPENDENCIES" a137="--trace=_AM_IF_OPTION" a138="--trace=_AM_MANGLE_OPTION" a139="--trace=_AM_OUTPUT_DEPENDENCY_COMMANDS" a140="--trace=_AM_PROG_CC_C_O" a141="--trace=_AM_PROG_TAR" a142="--trace=_AM_SET_OPTION" a143="--trace=_AM_SET_OPTIONS" a144="--trace=_AM_SUBST_NOTMAKE" a145="--trace=_LTDL_SETUP" a146="--trace=_LT_AC_CHECK_DLFCN" a147="--trace=_LT_AC_FILE_LTDLL_C" a148="--trace=_LT_AC_LANG_CXX" a149="--trace=_LT_AC_LANG_CXX_CONFIG" a150="--trace=_LT_AC_LANG_C_CONFIG" a151="--trace=_LT_AC_LANG_F77" a152="--trace=_LT_AC_LANG_F77_CONFIG" a153="--trace=_LT_AC_LANG_GCJ" a154="--trace=_LT_AC_LANG_GCJ_CONFIG" a155="--trace=_LT_AC_LANG_RC_CONFIG" a156="--trace=_LT_AC_LOCK" a157="--trace=_LT_AC_PROG_CXXCPP" a158="--trace=_LT_AC_PROG_ECHO_BACKSLASH" a159="--trace=_LT_AC_SHELL_INIT" a160="--trace=_LT_AC_SYS_COMPILER" a161="--trace=_LT_AC_SYS_LIBPATH_AIX" a162="--trace=_LT_AC_TAGCONFIG" a163="--trace=_LT_AC_TAGVAR" a164="--trace=_LT_AC_TRY_DLOPEN_SELF" a165="--trace=_LT_CC_BASENAME" a166="--trace=_LT_COMPILER_BOILERPLATE" a167="--trace=_LT_COMPILER_OPTION" a168="--trace=_LT_DLL_DEF_P" a169="--trace=_LT_LIBOBJ" a170="--trace=_LT_LINKER_BOILERPLATE" a171="--trace=_LT_LINKER_OPTION" a172="--trace=_LT_PATH_TOOL_PREFIX" a173="--trace=_LT_PREPARE_SED_QUOTE_VARS" a174="--trace=_LT_PROG_CXX" a175="--trace=_LT_PROG_ECHO_BACKSLASH" a176="--trace=_LT_PROG_F77" a177="--trace=_LT_PROG_FC" a178="--trace=_LT_PROG_LTMAIN" a179="--trace=_LT_REQUIRED_DARWIN_CHECKS" a180="--trace=_LT_WITH_SYSROOT" a181="--trace=_m4_warn" a182="--trace=include" a183="--trace=m4_include" a184="--trace=m4_pattern_allow" a185="--trace=m4_pattern_forbid" a186="--reload-state=/usr/share/autoconf-2.60/autoconf/autoconf.m4f" a187="--undefine=__m4_version__" a188="-" a189="/usr/share/aclocal-1.16/internal/ac-config-macro-dirs.m4" a190="/usr/share/libtool/aclocal/libtool.m4" a191="/usr/share/libtool/aclocal/ltargz.m4" a192="/usr/share/libtool/aclocal/ltdl.m4" a193="/usr/share/libtool/aclocal/ltoptions.m4" a194="/usr/share/libtool/aclocal/ltsugar.m4" a195="/usr/share/libtool/aclocal/ltversion.m4" a196="/usr/share/libtool/aclocal/lt~obsolete.m4" a197="/usr/share/aclocal-1.16/amversion.m4" a198="/usr/share/aclocal-1.16/auxdir.m4" a199="/usr/share/aclocal-1.16/cond.m4" a200="/usr/share/aclocal-1.16/depend.m4" a201="/usr/share/aclocal-1.16/depout.m4" a202="/usr/share/aclocal-1.16/init.m4" a203="/usr/share/aclocal-1.16/install-sh.m4" a204="/usr/share/aclocal-1.16/lead-dot.m4" a205="/usr/share/aclocal-1.16/make.m4" a206="/usr/share/aclocal-1.16/missing.m4" a207="/usr/share/aclocal-1.16/options.m4" a208="/usr/share/aclocal-1.16/prog-cc-c-o.m4" a209="/usr/share/aclocal-1.16/runlog.m4" a210="/usr/share/aclocal-1.16/sanity.m4" a211="/usr/share/aclocal-1.16/silent.m4" a212="/usr/share/aclocal-1.16/strip.m4" a213="/usr/share/aclocal-1.16/substnot.m4" a214="/usr/share/aclocal-1.16/tar.m4" a215="configure.ac" type=CWD msg=audit(1655465404.819:27091): cwd="/usr/src/RPM/BUILD/zlib-1.2.11-alt1/contrib/minizip" type=PATH msg=audit(1655465404.819:27091): item=0 name="/usr/bin/m4" inode=40839 dev=00:30 mode=0100755 ouid=582 ogid=582 rdev=00:00 nametype=NORMAL cap_fp=0 cap_fi=0 cap_fe=0 cap_fver=0 cap_frootid=0 type=PATH msg=audit(1655465404.819:27091): item=1 name="/lib64/ld-linux-aarch64.so.1" inode=33874 dev=00:30 mode=0100755 ouid=582 ogid=582 rdev=00:00 nametype=NORMAL cap_fp=0 cap_fi=0 cap_fe=0 cap_fver=0 cap_frootid=0 type=PROCTITLE msg=audit(1655465404.819:27091): proctitle=2F7573722F62696E2F6D34002D2D6E657374696E672D6C696D69743D31303234002D2D676E75002D2D696E636C7564653D2F7573722F73686172652F6175746F636F6E662D322E3630002D2D64656275673D61666C71002D2D666174616C2D7761726E696E67002D2D646562756766696C653D6175746F6D3474652E63616368 audit-4.0.2/auparse/test/test.log0000644001034500103450000000474114655201403012413 type=AVC msg=audit(1170021493.977:293): avc: denied { read write } for pid=13010 comm="pickup" name="maildrop" dev=hda7 ino=14911367 scontext=system_u:system_r:postfix_pickup_t:s0 tcontext=system_u:object_r:postfix_spool_maildrop_t:s0 tclass=dir type=SYSCALL msg=audit(1170021493.977:293): arch=c000003e syscall=2 success=no exit=-13 a0=5555665d91b0 a1=10800 a2=5555665d91b8 a3=0 items=1 ppid=2013 pid=13010 auid=4294967295 uid=890 gid=890 euid=890 suid=890 fsuid=890 egid=890 sgid=890 fsgid=890 tty=(none) comm="pickup" exe="/usr/libexec/postfix/pickup" subj=system_u:system_r:postfix_pickup_t:s0 key=(null) type=CWD msg=audit(1170021493.977:293): cwd="/var/spool/postfix" type=PATH msg=audit(1170021493.977:293): item=0 name="maildrop" inode=14911367 dev=03:07 mode=040730 ouid=890 ogid=891 rdev=00:00 obj=system_u:object_r:postfix_spool_maildrop_t:s0 type=USER_ACCT msg=audit(1170021601.340:294): user pid=13015 uid=0 auid=4294967295 subj=system_u:system_r:crond_t:s0-s0:c0.c1023 msg='PAM: accounting acct=root : exe="/usr/sbin/crond" hostname=? addr=? terminal=cron res=success' type=CRED_ACQ msg=audit(1170021601.342:295): user pid=13015 uid=0 auid=4294967295 subj=system_u:system_r:crond_t:s0-s0:c0.c1023 msg='PAM: setcred acct=root : exe="/usr/sbin/crond" hostname=? addr=? terminal=cron res=success' type=LOGIN msg=audit(1170021601.343:296): pid=2288 uid=0 subj=system_u:system_r:init_t:s0 old-auid=4294967295 auid=42 tty=(none) old-ses=4294967295 ses=1 res=1 type=SYSCALL msg=audit(1170021601.343:296): arch=c000003e syscall=1 success=yes exit=2 a0=8 a1=7fffa7aede20 a2=2 a3=0 items=0 ppid=1 pid=2288 auid=42 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=1 comm="(systemd)" exe="/usr/lib/systemd/systemd" subj=system_u:system_r:init_t:s0 key=(null) type=PROCTITLE msg=audit(1170021601.343:296): proctitle="(systemd)" type=USER_START msg=audit(1170021601.344:297): user pid=13015 uid=0 auid=0 subj=system_u:system_r:crond_t:s0-s0:c0.c1023 msg='PAM: session open acct=root : exe="/usr/sbin/crond" (hostname=?, addr=?, terminal=cron res=success)' type=CRED_DISP msg=audit(1170021601.364:298): user pid=13015 uid=0 auid=0 subj=system_u:system_r:crond_t:s0-s0:c0.c1023 msg='PAM: setcred acct=root : exe="/usr/sbin/crond" (hostname=?, addr=?, terminal=cron res=success)' type=USER_END msg=audit(1170021601.366:299): user pid=13015 uid=0 auid=0 subj=system_u:system_r:crond_t:s0-s0:c0.c1023 msg='PAM: session close acct=root : exe="/usr/sbin/crond" (hostname=?, addr=?, terminal=cron res=success)' audit-4.0.2/auparse/test/auparselol_test.c0000644001034500103450000001706014655201403014301 #include "config.h" #include #include #include #include #include #include #include #include #include "libaudit.h" #include "auparse.h" /* * Tool to exercise the auparse library input and processing capability * Based on the code example shown in auparse_feed manual entry * * Standard test would be * mkdir /tmp/auparse_test * cp /var/log/audit/audit.log /tmp/auparse_test/audit.log * sed -f auparse_patch.sed /tmp/auparse_test/audit.log | sort > /tmp/auparse_test/auparse.raw * auparselol_test --check -f /tmp/auparse_test/audit.log | sort > /tmp/auparse_test/auparse.new * diff /tmp/auparse_test/auparse.raw /tmp/auparse_test/auparse.new * and the output of the diff should be zero or explainable (and hence expand the auparse_patch.sed file) * */ /* * Flags bitset */ unsigned flags = 0x0; #define F_VERBOSE 0x00000001 #define F_CHECK 0x00000002 #define F_USESTDIN 0x00000004 /* * Print a null terminated string, escaping chararters from the given set */ void print_escape(FILE * fd, char *str, const char *escape) { register char *s = str; int ch; while ((ch = (int) *s++)) { if (strrchr(escape, ch)) fputc('\\', fd); fputc(ch, fd); } } /* * auparse_callback - callback routine to be executed once a complete event is composed */ void auparse_callback(auparse_state_t * au, auparse_cb_event_t cb_event_type, void *user_data) { int *event_cnt = (int *) user_data; if (cb_event_type == AUPARSE_CB_EVENT_READY) { if (auparse_first_record(au) <= 0) return; /* If no first record, then no event ! */ if (!(flags & F_CHECK)) printf("event=%d records=%u\n", *event_cnt, auparse_get_num_records(au)); do { const au_event_t *e = auparse_get_timestamp(au); if (e == NULL) return; /* If no timestamp, then no event */ /* If checking, we just emit the raw record again */ if (flags & F_CHECK) { if (e->host != NULL) printf("node=%s type=%s msg=audit(%u.%3.3u:%lu):", e->host, auparse_get_type_name(au), (unsigned) e->sec, e->milli, e->serial); else printf("type=%s msg=audit(%u.%3.3u:%lu):", auparse_get_type_name(au), (unsigned) e->sec, e->milli, e->serial); auparse_first_field(au); /* Move to first field */ do { const char *fname = auparse_get_field_name(au); /* We ignore the node and type fields */ if (strcmp(fname, "type") == 0 || strcmp(fname, "node") == 0) continue; printf(" %s=%s", fname, auparse_get_field_str(au)); } while (auparse_next_field(au) > 0); printf("\n"); continue; } printf("fields=%u\t", auparse_get_num_fields(au)); printf("type=%d (%s) ", auparse_get_type(au), auparse_get_type_name(au)); printf("event_tid=%u.%3.3u:%lu ", (unsigned) e->sec, e->milli, e->serial); if (flags & F_VERBOSE) { char *fv, *ifv = NULL; auparse_first_field(au); /* Move to first field */ do { fv = (char *) auparse_get_field_str(au); ifv = (char *) auparse_interpret_field(au); printf("%s=", auparse_get_field_name(au)); print_escape(stdout, fv, "=()"); printf(" ("); print_escape(stdout, ifv, "=()"); printf(") "); } while (auparse_next_field(au) > 0); } printf("\n"); } while (auparse_next_record(au) > 0); (*event_cnt)++; } } void usage(void) { fprintf(stderr, "usage: auparselol_test [--stdin] [-f file] [--verbose] [--check] [--escape R|T|S|Q]\n"); } int main(int argc, char **argv) { char *filename = NULL; auparse_esc_t em; FILE *fd; #define BUFSZ 2048 char buf[BUFSZ]; size_t len; int *event_cnt = NULL; auparse_state_t *au; int i; /* Argument parsing */ while (1) { int option_index = 0; int c; static struct option long_options[] = { { "verbose", no_argument, 0, 'v'}, { "file", required_argument, 0, 'f'}, { "stdin", no_argument, 0, 's'}, { "check", no_argument, 0, 'c'}, { "escape", required_argument, 0, 'e'}, { 0, 0, 0, 0} }; c = getopt_long(argc, argv, "cvf:e:s", long_options, &option_index); if (c == -1) break; switch (c) { case 'e': /* escape mode */ switch (*optarg) { case 'R': case 'r': em = AUPARSE_ESC_RAW; break; case 'T': case 't': em = AUPARSE_ESC_TTY; break; case 'S': case 's': em = AUPARSE_ESC_SHELL; break; case 'Q': case 'q': em = AUPARSE_ESC_SHELL_QUOTE; break; default: fprintf(stderr, "%s: Unknown escape character 0x%2.2X\n", argv[0], *optarg); usage(); return 1; } auparse_set_escape_mode(NULL, em); break; case 'c': /* check */ flags |= F_CHECK; break; case 'v': /* verbose */ flags |= F_VERBOSE; break; case 's': /* stdin */ flags |= F_USESTDIN; break; case 'f': /* file */ filename = optarg; break; case '?': default: fprintf(stderr, "%s: Unknown option 0x%2.2X\n", argv[0], c); usage(); return 1; } } if ((flags & F_USESTDIN) && filename != NULL) { fprintf(stderr, "%s: --stdin cannot be used with file argument\n", argv[0]); usage(); return 1; } if (!(flags & F_USESTDIN) && filename == NULL) { fprintf(stderr, "%s: Missing --stdin or -f file argument\n", argv[0]); usage(); return 1; } if ((event_cnt = malloc(sizeof(int))) == NULL) { fprintf(stderr, "%s: No memory to allocate %lu bytes\n", argv[0], sizeof(int)); return 1; } if (flags & F_USESTDIN) { fd = stdin; } else { if ((fd = fopen(filename, "r")) == NULL) { fprintf(stderr, "could not open ’%s’, %s\n", filename, strerror(errno)); (void) free(event_cnt); return 1; } } au = auparse_init(AUSOURCE_FEED, NULL); *event_cnt = 1; auparse_add_callback(au, auparse_callback, event_cnt, free); i = 0; while ((len = fread(buf, 1, sizeof(buf), fd))) { auparse_feed(au, buf, len); i++; } auparse_flush_feed(au); auparse_destroy(au); /* this also free's event_cnt */ if (!(flags & F_USESTDIN)) fclose(fd); return 0; } audit-4.0.2/auparse/test/auparse_test.py0000755001034500103450000002334714655201403014010 #!/usr/bin/env python3 import os srcdir = os.getenv('srcdir') buf = ["type=LOGIN msg=audit(1143146623.787:142): login pid=2027 uid=0 old auid=4294967295 new auid=848\ntype=SYSCALL msg=audit(1143146623.875:143): arch=c000003e syscall=188 success=yes exit=0 a0=7fffffa9a9f0 a1=3958d11333 a2=5131f0 a3=20 items=1 pid=2027 auid=848 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=tty3 comm=\"login\" exe=\"/bin/login\" subj=system_u:system_r:local_login_t:s0-s0:c0.c255\n", "type=USER_LOGIN msg=audit(1143146623.879:146): user pid=2027 uid=0 auid=848 msg=\'uid=848: exe=\"/bin/login\" (hostname=?, addr=?, terminal=tty3 res=success)\'\n", ] files = ["%s%s" % (srcdir,"/test2.log"), "%s%s" % (srcdir,"/test.log")] import sys import time load_path = '../../bindings/python/python3' if False: sys.path.insert(0, load_path) import auparse def none_to_null(s): 'used so output matches C version' if s is None: return '(null)' else: return s walked_fields = 0 FIELDS_EXPECTED = 403 def walk_test(au): global walked_fields event_cnt = 1 au.reset() if not au.first_record(): print("Error getting first record") sys.exit(1) while True: print("event %d has %d records" % (event_cnt, au.get_num_records())) record_cnt = 1 while True: print(" record %d of type %d(%s) has %d fields" % \ (record_cnt, au.get_type(), au.get_type_name(), au.get_num_fields())) print(" line=%d file=%s" % (au.get_line_number(), au.get_filename())) event = au.get_timestamp() if event is None: print("Error getting timestamp - aborting") sys.exit(1) print(" event time: %d.%d:%d, host=%s" % (event.sec, event.milli, event.serial, none_to_null(event.host))) au.first_field() while True: print(" %s=%s (%s)" % (au.get_field_name(), au.get_field_str(), au.interpret_field())) walked_fields += 1 if not au.next_field(): break print("") record_cnt += 1 if not au.next_record(): break event_cnt += 1 if not au.parse_next_event(): break def light_test(au): while True: if not au.first_record(): print("Error getting first record") sys.exit(1) print("event has %d records" % (au.get_num_records())) record_cnt = 1 while True: print(" record %d of type %d(%s) has %d fields" % \ (record_cnt, au.get_type(), au.get_type_name(), au.get_num_fields())) print(" line=%d file=%s" % (au.get_line_number(), au.get_filename())) event = au.get_timestamp() if event is None: print("Error getting timestamp - aborting") sys.exit(1) print(" event time: %d.%d:%d, host=%s" % (event.sec, event.milli, event.serial, none_to_null(event.host))) print("") record_cnt += 1 if not au.next_record(): break if not au.parse_next_event(): break def simple_search(au, source, where): if source == auparse.AUSOURCE_FILE: au = auparse.AuParser(auparse.AUSOURCE_FILE, srcdir + "/test.log"); val = "4294967295" else: au = auparse.AuParser(auparse.AUSOURCE_BUFFER_ARRAY, buf) val = "848" au.search_add_item("auid", "=", val, auparse.AUSEARCH_RULE_CLEAR) au.search_set_stop(where) if not au.search_next_event(): print("Error searching for auid") else: print("Found %s = %s" % (au.get_field_name(), au.get_field_str())) def compound_search(au, how): au = auparse.AuParser(auparse.AUSOURCE_FILE, srcdir + "/test.log"); if how == auparse.AUSEARCH_RULE_AND: au.search_add_item("uid", "=", "0", auparse.AUSEARCH_RULE_CLEAR) au.search_add_item("pid", "=", "13015", how) au.search_add_item("type", "=", "USER_START", how) else: au.search_add_item("auid", "=", "42", auparse.AUSEARCH_RULE_CLEAR) # should stop on this one au.search_add_item("auid", "=", "0", how) au.search_add_item("auid", "=", "500", how) au.search_set_stop(auparse.AUSEARCH_STOP_FIELD) if not au.search_next_event(): print("Error searching for auid") else: print("Found %s = %s" % (au.get_field_name(), au.get_field_str())) def feed_callback(au, cb_event_type, event_cnt): if cb_event_type == auparse.AUPARSE_CB_EVENT_READY: if not au.first_record(): print("Error getting first record") sys.exit(1) print("event %d has %d records" % (event_cnt[0], au.get_num_records())) record_cnt = 1 while True: print(" record %d of type %d(%s) has %d fields" % \ (record_cnt, au.get_type(), au.get_type_name(), au.get_num_fields())) print(" line=%d file=%s" % (au.get_line_number(), au.get_filename())) event = au.get_timestamp() if event is None: print("Error getting timestamp - aborting") sys.exit(1) print(" event time: %d.%d:%d, host=%s" % (event.sec, event.milli, event.serial, none_to_null(event.host))) au.first_field() while True: print(" %s=%s (%s)" % (au.get_field_name(), au.get_field_str(), au.interpret_field())) if not au.next_field(): break print("") record_cnt += 1 if not au.next_record(): break event_cnt[0] += 1 au = auparse.AuParser(auparse.AUSOURCE_BUFFER_ARRAY, buf) print("Starting Test 1, iterate...") while au.parse_next_event(): if au.find_field("auid"): print("%s=%s" % (au.get_field_name(), au.get_field_str())) print("interp auid=%s" % (au.interpret_field())) else: print("Error iterating to auid") print("Test 1 Done\n") # Reset, now lets go to beginning and walk the list manually */ print("Starting Test 2, walk events, records, and fields...") walk_test(au) print("Test 2 Done\n") # Reset, now lets go to beginning and walk the list manually */ print("Starting Test 3, walk events, records of 1 buffer...") au = auparse.AuParser(auparse.AUSOURCE_BUFFER, buf[1]) au.reset() light_test(au); print("Test 3 Done\n") print("Starting Test 4, walk events, records of 1 file...") file1 = "%s%s" % (srcdir,"/test.log") au = auparse.AuParser(auparse.AUSOURCE_FILE, file1); walk_test(au); print("Test 4 Done\n") print("Starting Test 5, walk events, records of 2 files...") au = auparse.AuParser(auparse.AUSOURCE_FILE_ARRAY, files); walk_test(au); print("Test 5 Done\n") print("Starting Test 6, search...") au = auparse.AuParser(auparse.AUSOURCE_BUFFER_ARRAY, buf) au.search_add_item("auid", "=", "500", auparse.AUSEARCH_RULE_CLEAR) au.search_set_stop(auparse.AUSEARCH_STOP_EVENT) if au.search_next_event(): print("Error search found something it shouldn't have") else: print("auid = 500 not found...which is correct") au.search_clear() au = auparse.AuParser(auparse.AUSOURCE_BUFFER_ARRAY, buf) #au.search_add_item("auid", "exists", None, auparse.AUSEARCH_RULE_CLEAR) au.search_add_item("auid", "exists", "", auparse.AUSEARCH_RULE_CLEAR) au.search_set_stop(auparse.AUSEARCH_STOP_EVENT) if not au.search_next_event(): print("Error searching for existence of auid") print("auid exists...which is correct") print("Testing BUFFER_ARRAY, stop on field") simple_search(au, auparse.AUSOURCE_BUFFER_ARRAY, auparse.AUSEARCH_STOP_FIELD) print("Testing BUFFER_ARRAY, stop on record") simple_search(au, auparse.AUSOURCE_BUFFER_ARRAY, auparse.AUSEARCH_STOP_RECORD) print("Testing BUFFER_ARRAY, stop on event") simple_search(au, auparse.AUSOURCE_BUFFER_ARRAY, auparse.AUSEARCH_STOP_EVENT) print("Testing test.log, stop on field") simple_search(au, auparse.AUSOURCE_FILE, auparse.AUSEARCH_STOP_FIELD) print("Testing test.log, stop on record") simple_search(au, auparse.AUSOURCE_FILE, auparse.AUSEARCH_STOP_RECORD) print("Testing test.log, stop on event") simple_search(au, auparse.AUSOURCE_FILE, auparse.AUSEARCH_STOP_EVENT) print("Test 6 Done\n") print("Starting Test 7, compound search...") au = auparse.AuParser(auparse.AUSOURCE_BUFFER_ARRAY, buf) compound_search(au, auparse.AUSEARCH_RULE_AND) compound_search(au, auparse.AUSEARCH_RULE_OR) print("Test 7 Done\n") print("Starting Test 8, regex search...") au = auparse.AuParser(auparse.AUSOURCE_BUFFER_ARRAY, buf) print("Doing regex match...\n") au = auparse.AuParser(auparse.AUSOURCE_BUFFER_ARRAY, buf) print("Test 8 Done\n") # Note: this should match Test 2 exactly # Note: this should match Test 2 exactly print("Starting Test 9, buffer feed...") au = auparse.AuParser(auparse.AUSOURCE_FEED); event_cnt = 1 au.add_callback(feed_callback, [event_cnt]) chunk_len = 3 for s in buf: s_len = len(s) beg = 0 while beg < s_len: end = min(s_len, beg + chunk_len) data = s[beg:end] beg += chunk_len au.feed(data) au.flush_feed() print("Test 9 Done\n") # Note: this should match Test 4 exactly print("Starting Test 10, file feed...") au = auparse.AuParser(auparse.AUSOURCE_FEED); event_cnt = 1 au.add_callback(feed_callback, [event_cnt]) f = open(srcdir + "/test.log"); while True: data = f.read(4) if not data: break au.feed(data) au.flush_feed() print("Test 10 Done\n") print("Starting Test 11, walk LONG event records from a file...") au = auparse.AuParser(auparse.AUSOURCE_FILE, "test4.log"); walked_fields = 0 walk_test(au) if walked_fields != FIELDS_EXPECTED: print("Error: %i fields expected, but %i read!\n" % \ (FIELDS_EXPECTED, walked_fields)) print("Test 11 Done\n") print("Finished non-admin tests\n") au = None sys.exit(0) audit-4.0.2/auparse/test/auditd_raw.sed0000644001034500103450000000157214655201403013550 s/ cwd/ cwd/ s/ comm=/ comm=/ s/msg='// s/(hostname=/hostname=/ s/success)/success/ s/ : exe=/ exe=/ s/'$// s/): a/): a/ s/, addr=/ addr=/ s/, terminal=/ terminal=/ s/tty pid=/pid=/ s/Unknown permission start for class system // s/Unknown permission stop for class system // s/ exe=/ exe=/ s/ pam: default-context/ default-context/ s/ avc: denied { stop } for auid=/ auid=/ s/old ses=/ses=/ s/new ses=/ses=/ s/old auid=/auid=/ s/login pid=/pid=/ s/user pid=/pid=/ s/new auid=/auid=/ s/auditd start, ver=/ver=/ s/policy loaded auid=/auid=/ s/auditd normal halt, sending auid=/auid=/ s/op=change password id=/op=change id=/ s/avc: received policyload notice (seqno=\(\d+)\))/seqno=\1/ s/PAM: accounting acct/acct/ s/PAM: session open acct/acct/ s/PAM: session close acct/acct/ s/PAM: setcred acct/acct/ s/avc: denied { read write } for pid=/seresult=denied seperms=read,write pid=/ audit-4.0.2/auparse/test/test3.log0000644001034500103450000000712714655201403012477 node=auditdtest.a1959.org type=SYSCALL msg=audit(1451781471.394:194435): arch=c000003e syscall=23 success=yes exit=1 a0=c a1=56420184ade0 a2=564201867510 a3=0 items=0 ppid=1271 pid=1281 auid=1000 uid=1000 gid=1000 euid=1000 suid=1000 fsuid=1000 egid=1000 sgid=1000 fsgid=1000 tty=(none) ses=1 comm="sshd" exe="/usr/sbin/sshd" subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 key=(null) node=auditdtest.a1959.org type=SYSCALL msg=audit(1451781471.394:194433): arch=c000003e syscall=13 success=yes exit=0 a0=b a1=7ffd42eb1590 a2=0 a3=8 items=0 ppid=1306 pid=1321 auid=1000 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts0 ses=1 comm="bash" exe="/usr/bin/bash" subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 key=(null) node=auditdtest.a1959.org type=PROCTITLE msg=audit(1451781471.394:194433): proctitle="bash" node=auditdtest.a1959.org type=PROCTITLE msg=audit(1451781471.394:194435): proctitle=737368643A206275726E205B707269765D node=auditdtest.a1959.org type=SYSCALL msg=audit(1451781471.394:194436): arch=c000003e syscall=13 success=yes exit=0 a0=1f a1=7ffd42eb1590 a2=0 a3=8 items=0 ppid=1306 pid=1321 auid=1000 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts0 ses=1 comm="bash" exe="/usr/bin/bash" subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 key=(null) node=auditdtest.a1959.org type=SYSCALL msg=audit(1451781471.394:194437): arch=c000003e syscall=14 success=yes exit=0 a0=0 a1=7ffdac6fe9a0 a2=7ffdac6fe920 a3=8 items=0 ppid=1271 pid=1281 auid=1000 uid=1000 gid=1000 euid=1000 suid=1000 fsuid=1000 egid=1000 sgid=1000 fsgid=1000 tty=(none) ses=1 comm="sshd" exe="/usr/sbin/sshd" subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 key=(null) node=auditdtest.a1959.org type=PROCTITLE msg=audit(1451781471.394:194436): proctitle="bash" node=auditdtest.a1959.org type=PROCTITLE msg=audit(1451781471.394:194437): proctitle=737368643A206275726E205B707269765D node=auditdtest.a1959.org type=SYSCALL msg=audit(1451781471.394:194438): arch=c000003e syscall=13 success=yes exit=0 a0=d a1=7ffd42eb1590 a2=0 a3=8 items=0 ppid=1306 pid=1321 auid=1000 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts0 ses=1 comm="bash" exe="/usr/bin/bash" subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 key=(null) node=auditdtest.a1959.org type=SYSCALL msg=audit(1451781471.394:194439): arch=c000003e syscall=14 success=yes exit=0 a0=2 a1=7ffdac6fe920 a2=0 a3=8 items=0 ppid=1271 pid=1281 auid=1000 uid=1000 gid=1000 euid=1000 suid=1000 fsuid=1000 egid=1000 sgid=1000 fsgid=1000 tty=(none) ses=1 comm="sshd" exe="/usr/sbin/sshd" subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 key=(null) node=auditdtest.a1959.org type=PROCTITLE msg=audit(1451781471.394:194439): proctitle=737368643A206275726E205B707269765D node=auditdtest.a1959.org type=SYSCALL msg=audit(1451781471.394:194440): arch=c000003e syscall=228 success=yes exit=0 a0=7 a1=7ffdac6fe9c0 a2=564201867510 a3=8 items=0 ppid=1271 pid=1281 auid=1000 uid=1000 gid=1000 euid=1000 suid=1000 fsuid=1000 egid=1000 sgid=1000 fsgid=1000 tty=(none) ses=1 comm="sshd" exe="/usr/sbin/sshd" subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 key=(null) node=auditdtest.a1959.org type=PROCTITLE msg=audit(1451781471.394:194438): proctitle="bash" node=auditdtest.a1959.org type=PROCTITLE msg=audit(1451781471.394:194440): proctitle=737368643A206275726E205B707269765D node=auditdtest.a1959.org type=ADD_GROUP msg=audit(1451781471.602:194894): pid=1321 uid=0 auid=1000 ses=1 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=add-group acct="frodo" exe="/usr/sbin/useradd" hostname=? addr=? terminal=pts/0 res=success' audit-4.0.2/auparse/test/auparse_test.c0000644001034500103450000003266014655201403013575 #include #include #include #include #include #include #include "libaudit.h" #include "auparse.h" // NOTE: First two run together on purpose, #3 is buf[1] static const char *buf[] = { "type=LOGIN msg=audit(1143146623.787:142): login pid=2027 uid=0 old auid=4294967295 new auid=848\n" "type=SYSCALL msg=audit(1143146623.875:143): arch=c000003e syscall=188 success=yes exit=0 a0=7fffffa9a9f0 a1=3958d11333 a2=5131f0 a3=20 items=1 pid=2027 auid=848 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=tty3 comm=\"login\" exe=\"/bin/login\" subj=system_u:system_r:local_login_t:s0-s0:c0.c255\n", "type=USER_LOGIN msg=audit(1143146623.879:146): user pid=2027 uid=0 auid=848 msg=\'uid=848: exe=\"/bin/login\" (hostname=?, addr=?, terminal=tty3 res=success)\'\n", NULL }; unsigned int walked_fields = 0; #define FIELDS_EXPECTED 403 static void walk_test(auparse_state_t *au) { int event_cnt = 1, record_cnt; do { if (auparse_first_record(au) <= 0) { printf("Error getting first record (%s)\n", strerror(errno)); exit(1); } printf("event %d has %u records\n", event_cnt, auparse_get_num_records(au)); record_cnt = 1; do { printf(" record %d of type %d(%s) has %u fields\n", record_cnt, auparse_get_type(au), audit_msg_type_to_name(auparse_get_type(au)), auparse_get_num_fields(au)); printf(" line=%u file=%s\n", auparse_get_line_number(au), auparse_get_filename(au) ? auparse_get_filename(au) : "None"); const au_event_t *e = auparse_get_timestamp(au); if (e == NULL) { printf("Error getting timestamp - aborting\n"); exit(1); } printf(" event time: %u.%u:%lu, host=%s\n", (unsigned)e->sec, e->milli, e->serial, e->host ? e->host : "?"); auparse_first_field(au); do { printf(" %s=%s (%s)\n", auparse_get_field_name(au), auparse_get_field_str(au), auparse_interpret_field(au)); walked_fields++; } while (auparse_next_field(au) > 0); printf("\n"); record_cnt++; } while(auparse_next_record(au) > 0); event_cnt++; } while (auparse_next_event(au) > 0); } void light_test(auparse_state_t *au) { int record_cnt; do { if (auparse_first_record(au) <= 0) { puts("Error getting first record"); exit(1); } printf("event has %u records\n", auparse_get_num_records(au)); record_cnt = 1; do { printf(" record %d of type %d(%s) has %u fields\n", record_cnt, auparse_get_type(au), audit_msg_type_to_name(auparse_get_type(au)), auparse_get_num_fields(au)); printf(" line=%u file=%s\n", auparse_get_line_number(au), auparse_get_filename(au) ? auparse_get_filename(au) : "None"); const au_event_t *e = auparse_get_timestamp(au); if (e == NULL) { printf("Error getting timestamp - aborting\n"); exit(1); } printf(" event time: %u.%u:%lu, host=%s\n", (unsigned)e->sec, e->milli, e->serial, e->host ? e->host : "?"); printf("\n"); record_cnt++; } while(auparse_next_record(au) > 0); } while (auparse_next_event(au) > 0); } void simple_search(ausource_t source, austop_t where) { auparse_state_t *au; const char *val; if (source == AUSOURCE_FILE) { au = auparse_init(AUSOURCE_FILE, "./test.log"); val = "4294967295"; } else { au = auparse_init(AUSOURCE_BUFFER_ARRAY, buf); val = "848"; } if (au == NULL) { printf("auparse_init error - %s\n", strerror(errno)); exit(1); } if (ausearch_add_item(au, "auid", "=", val, AUSEARCH_RULE_CLEAR)){ printf("ausearch_add_item error - %s\n", strerror(errno)); exit(1); } if (ausearch_set_stop(au, where)){ printf("ausearch_set_stop error - %s\n", strerror(errno)); exit(1); } if (ausearch_next_event(au) <= 0) printf("Error searching for auid - %s\n", strerror(errno)); else printf("Found %s = %s\n", auparse_get_field_name(au), auparse_get_field_str(au)); auparse_destroy(au); } void compound_search(ausearch_rule_t how) { auparse_state_t *au; au = auparse_init(AUSOURCE_FILE, "./test.log"); if (au == NULL) { printf("auparse_init error - %s\n", strerror(errno)); exit(1); } if (how == AUSEARCH_RULE_AND) { if (ausearch_add_item(au, "uid", "=", "0", AUSEARCH_RULE_CLEAR)){ printf("ausearch_add_item 1 error - %s\n", strerror(errno)); exit(1); } if (ausearch_add_item(au, "pid", "=", "13015", how)){ printf("ausearch_add_item 2 error - %s\n", strerror(errno)); exit(1); } if (ausearch_add_item(au, "type", "=", "USER_START", how)){ printf("ausearch_add_item 3 error - %s\n", strerror(errno)); exit(1); } } else { if (ausearch_add_item(au, "auid", "=", "42", AUSEARCH_RULE_CLEAR)){ printf("ausearch_add_item 4 error - %s\n", strerror(errno)); exit(1); } // should stop on this one if (ausearch_add_item(au, "auid", "=", "0", how)){ printf("ausearch_add_item 5 error - %s\n", strerror(errno)); exit(1); } if (ausearch_add_item(au, "auid", "=", "500", how)){ printf("ausearch_add_item 6 error - %s\n", strerror(errno)); exit(1); } } if (ausearch_set_stop(au, AUSEARCH_STOP_FIELD)){ printf("ausearch_set_stop error - %s\n", strerror(errno)); exit(1); } if (ausearch_next_event(au) <= 0) printf("Error searching for auid - %s\n", strerror(errno)); else printf("Found %s = %s\n", auparse_get_field_name(au), auparse_get_field_str(au)); auparse_destroy(au); } void regex_search(const char *expr) { auparse_state_t *au; int rc; au = auparse_init(AUSOURCE_BUFFER_ARRAY, buf); if (au == NULL) { printf("auparse_init error - %s\n", strerror(errno)); exit(1); } if (ausearch_add_regex(au, expr)){ printf("ausearch_add_regex error - %s\n", strerror(errno)); exit(1); } if (ausearch_set_stop(au, AUSEARCH_STOP_RECORD)){ printf("ausearch_set_stop error - %s\n", strerror(errno)); exit(1); } rc = ausearch_next_event(au); if (rc < 0) printf("Error searching for %s - %s\n", expr, strerror(errno)); else if (rc == 0) printf("Not found\n"); else printf("Found %s = %s\n", auparse_get_field_name(au), auparse_get_field_str(au)); auparse_destroy(au); } static void auparse_callback(auparse_state_t *au, auparse_cb_event_t cb_event_type, void *user_data) { int *event_cnt = (int *)user_data; int record_cnt; if (cb_event_type == AUPARSE_CB_EVENT_READY) { if (auparse_first_record(au) <= 0) { printf("can't get first record\n"); return; } printf("event %d has %u records\n", *event_cnt, auparse_get_num_records(au)); record_cnt = 1; do { printf(" record %d of type %d(%s) has %u fields\n", record_cnt, auparse_get_type(au), audit_msg_type_to_name(auparse_get_type(au)), auparse_get_num_fields(au)); printf(" line=%u file=%s\n", auparse_get_line_number(au), auparse_get_filename(au) ? auparse_get_filename(au) : "None"); const au_event_t *e = auparse_get_timestamp(au); if (e == NULL) { return; } printf(" event time: %u.%u:%lu, host=%s\n", (unsigned)e->sec, e->milli, e->serial, e->host ? e->host : "?"); auparse_first_field(au); do { printf(" %s=%s (%s)\n", auparse_get_field_name(au), auparse_get_field_str(au), auparse_interpret_field(au)); } while (auparse_next_field(au) > 0); printf("\n"); record_cnt++; } while(auparse_next_record(au) > 0); (*event_cnt)++; } } int main(void) { //char *files[4] = { "test.log", "test2.log", "test3.log", NULL }; char *files[3] = { "test2.log", "test.log", NULL }; setlocale (LC_ALL, ""); auparse_state_t *au; au = auparse_init(AUSOURCE_BUFFER_ARRAY, buf); if (au == NULL) { printf("Error - %s\n", strerror(errno)); return 1; } printf("Starting Test 1, iterate...\n"); while (auparse_next_event(au) > 0) { if (auparse_find_field(au, "auid")) { printf("%s=%s\n", auparse_get_field_name(au), auparse_get_field_str(au)); printf("interp auid=%s\n", auparse_interpret_field(au)); } else printf("Error iterating to auid\n"); } auparse_reset(au); while (auparse_next_event(au) > 0) { if (auparse_find_field(au, "auid")) { do { printf("%s=%s\n", auparse_get_field_name(au), auparse_get_field_str(au)); printf("interp auid=%s\n", auparse_interpret_field(au)); } while (auparse_find_field_next(au)); } else printf("Error iterating to auid\n"); } printf("Test 1 Done\n\n"); /* Reset, now lets go to beginning and walk the list manually */ printf("Starting Test 2, walk events, records, and fields...\n"); auparse_reset(au); walk_test(au); auparse_destroy(au); printf("Test 2 Done\n\n"); /* Reset, now lets go to beginning and walk the list manually */ printf("Starting Test 3, walk events, records of 1 buffer...\n"); au = auparse_init(AUSOURCE_BUFFER, buf[1]); if (au == NULL) { printf("Error - %s\n", strerror(errno)); return 1; } light_test(au); auparse_destroy(au); printf("Test 3 Done\n\n"); printf("Starting Test 4, walk events, records of 1 file...\n"); au = auparse_init(AUSOURCE_FILE, "./test.log"); if (au == NULL) { printf("Error - %s\n", strerror(errno)); return 1; } walk_test(au); auparse_destroy(au); printf("Test 4 Done\n\n"); printf("Starting Test 5, walk events, records of 2 files...\n"); au = auparse_init(AUSOURCE_FILE_ARRAY, files); if (au == NULL) { printf("Error - %s\n", strerror(errno)); return 1; } walk_test(au); auparse_destroy(au); printf("Test 5 Done\n\n"); printf("Starting Test 6, search...\n"); au = auparse_init(AUSOURCE_BUFFER_ARRAY, buf); if (au == NULL) { printf("Error - %s\n", strerror(errno)); return 1; } if (ausearch_add_item(au, "auid", "=", "500", AUSEARCH_RULE_CLEAR)){ printf("Error - %s", strerror(errno)); return 1; } if (ausearch_set_stop(au, AUSEARCH_STOP_EVENT)){ printf("Error - %s", strerror(errno)); exit(1); } if (ausearch_next_event(au) != 0) { printf("Error search found something it shouldn't have\n"); } puts("auid = 500 not found...which is correct"); ausearch_clear(au); auparse_destroy(au); au = auparse_init(AUSOURCE_BUFFER_ARRAY, buf); if (ausearch_add_item(au,"auid", "exists", NULL, AUSEARCH_RULE_CLEAR)){ printf("Error - %s", strerror(errno)); return 1; } if (ausearch_set_stop(au, AUSEARCH_STOP_EVENT)){ printf("Error - %s", strerror(errno)); exit(1); } if (ausearch_next_event(au) <= 0) { printf("Error searching for existence of auid\n"); } puts("auid exists...which is correct"); puts("Testing BUFFER_ARRAY, stop on field"); simple_search(AUSOURCE_BUFFER_ARRAY, AUSEARCH_STOP_FIELD); puts("Testing BUFFER_ARRAY, stop on record"); simple_search(AUSOURCE_BUFFER_ARRAY, AUSEARCH_STOP_RECORD); puts("Testing BUFFER_ARRAY, stop on event"); simple_search(AUSOURCE_BUFFER_ARRAY, AUSEARCH_STOP_EVENT); puts("Testing test.log, stop on field"); simple_search(AUSOURCE_FILE, AUSEARCH_STOP_FIELD); puts("Testing test.log, stop on record"); simple_search(AUSOURCE_FILE, AUSEARCH_STOP_RECORD); puts("Testing test.log, stop on event"); simple_search(AUSOURCE_FILE, AUSEARCH_STOP_EVENT); auparse_destroy(au); printf("Test 6 Done\n\n"); printf("Starting Test 7, compound search...\n"); au = auparse_init(AUSOURCE_BUFFER_ARRAY, buf); if (au == NULL) { printf("Error - %s\n", strerror(errno)); return 1; } compound_search(AUSEARCH_RULE_AND); compound_search(AUSEARCH_RULE_OR); auparse_destroy(au); printf("Test 7 Done\n\n"); printf("Starting Test 8, regex search...\n"); puts("Doing regex match..."); regex_search("1143146623"); puts("Doing regex wildcard search..."); regex_search("11431466.*146"); printf("Test 8 Done\n\n"); /* Note: this should match Test 2 exactly */ printf("Starting Test 9, buffer feed...\n"); { int event_cnt = 1; size_t len, chunk_len = 3; const char **cur_buf, *p_beg, *p_end, *p_chunk_beg, *p_chunk_end; au = auparse_init(AUSOURCE_FEED, 0); auparse_add_callback(au, auparse_callback, &event_cnt, NULL); for (cur_buf = buf, p_beg = *cur_buf; *cur_buf; cur_buf++, p_beg = *cur_buf) { len = strlen(p_beg); p_end = p_beg + len; p_chunk_beg = p_beg; while (p_chunk_beg < p_end) { p_chunk_end = p_chunk_beg + chunk_len; if (p_chunk_end > p_end) p_chunk_end = p_end; //fwrite(p_chunk_beg, 1, // p_chunk_end-p_chunk_beg, stdout); auparse_feed(au, p_chunk_beg, p_chunk_end-p_chunk_beg); p_chunk_beg = p_chunk_end; } } auparse_flush_feed(au); auparse_destroy(au); } printf("Test 9 Done\n\n"); /* Note: this should match Test 4 exactly */ printf("Starting Test 10, file feed...\n"); { int *event_cnt = malloc(sizeof(int)); size_t len; char filename[] = "./test.log"; char buf[4]; FILE *fp; *event_cnt = 1; au = auparse_init(AUSOURCE_FEED, 0); auparse_add_callback(au, auparse_callback, event_cnt, free); if ((fp = fopen(filename, "r")) == NULL) { fprintf(stderr, "could not open '%s', %s\n", filename, strerror(errno)); return 1; } while ((len = fread(buf, 1, sizeof(buf), fp))) { auparse_feed(au, buf, len); } fclose(fp); auparse_flush_feed(au); auparse_destroy(au); } printf("Test 10 Done\n\n"); printf("Starting Test 11, walk LONG event records from a file...\n"); au = auparse_init(AUSOURCE_FILE, "test4.log"); if (au == NULL) { printf("Error - %s\n", strerror(errno)); return 1; } walked_fields = 0; walk_test(au); auparse_destroy(au); if (walked_fields != FIELDS_EXPECTED) { printf("Error: %i fields expected, but %i read!\n", FIELDS_EXPECTED, walked_fields); } printf("Test 11 Done\n\n"); puts("Finished non-admin tests\n"); return 0; } audit-4.0.2/auparse/recvtab.h0000644001034500103450000000313614655201403011546 /* recvtab.h -- * Copyright 2012-14 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb * Location: include/linux/socket.h */ _S(0x00000001, "MSG_OOB") _S(0x00000002, "MSG_PEEK") _S(0x00000004, "MSG_DONTROUTE") _S(0x00000008, "MSG_CTRUNC") _S(0x00000010, "MSG_PROXY") _S(0x00000020, "MSG_TRUNC") _S(0x00000040, "MSG_DONTWAIT") _S(0x00000080, "MSG_EOR") _S(0x00000100, "MSG_WAITALL") _S(0x00000200, "MSG_FIN") _S(0x00000400, "MSG_SYN") _S(0x00000800, "MSG_CONFIRM") _S(0x00001000, "MSG_RST") _S(0x00002000, "MSG_ERRQUEUE") _S(0x00004000, "MSG_NOSIGNAL") _S(0x00008000, "MSG_MORE") _S(0x00010000, "MSG_WAITFORONE") _S(0x00020000, "MSG_SENDPAGE_NOTLAST") _S(0x00040000, "MSG_BATCH") _S(0x20000000, "MSG_FASTOPEN") _S(0x40000000, "MSG_CMSG_CLOEXEC") _S(0x80000000, "MSG_CMSG_COMPAT") audit-4.0.2/auparse/persontab.h0000644001034500103450000000345314655201403012117 /* persontab.h -- * Copyright 2012-13 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb * Location: include/uapi/linux/personality.h */ _S(0x0000, "PER_LINUX") _S(0x0000 | ADDR_LIMIT_32BIT, "PER_LINUX_32BIT") _S(0x0001 | STICKY_TIMEOUTS | MMAP_PAGE_ZERO, "PER_SVR4") _S(0x0002 | STICKY_TIMEOUTS | SHORT_INODE, "PER_SVR3") _S(0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS | SHORT_INODE, "PER_SCOSVR3") _S(0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS, "PER_OSR5") _S(0x0004 | STICKY_TIMEOUTS | SHORT_INODE, "PER_WYSEV386") _S(0x0005 | STICKY_TIMEOUTS, "PER_ISCR4") _S(0x0006, "PER_BSD") _S(0x0006 | STICKY_TIMEOUTS, "PER_SUNOS") _S(0x0007 | STICKY_TIMEOUTS | SHORT_INODE, "PER_XENIX") _S(0x0008, "PER_LINUX32") _S(0x0008 | ADDR_LIMIT_3GB, "PER_LINUX32_3GB") _S(0x0009 | STICKY_TIMEOUTS, "PER_IRIX32") _S(0x000a | STICKY_TIMEOUTS, "PER_IRIXN32") _S(0x000b | STICKY_TIMEOUTS, "PER_IRIX64") _S(0x000c, "PER_RISCOS") _S(0x000d | STICKY_TIMEOUTS, "PER_SOLARIS") _S(0x000e | STICKY_TIMEOUTS | MMAP_PAGE_ZERO, "PER_UW7") _S(0x000f, "PER_OSF4") _S(0x0010, "PER_HPUX") audit-4.0.2/auparse/data_buf.c0000644001034500103450000002565014655201403011665 /* data_buf.c -- * Copyright 2007,2011 Red Hat Inc., Durham, North Carolina. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * John Dennis */ /* * gcc -DTEST -g data_buf.c -o data_buf * gcc -DTEST -g data_buf.c -o data_buf && valgrind --leak-check=yes ./data_buf */ /*****************************************************************************/ /******************************** Documentation ******************************/ /*****************************************************************************/ /*****************************************************************************/ /******************************* Include Files *******************************/ /*****************************************************************************/ #include #include #include // for memmove() #include #include #include #include "data_buf.h" /*****************************************************************************/ /****************************** Internal Defines *****************************/ /*****************************************************************************/ #ifndef MIN #define MIN(a,b) (((a)<=(b))?(a):(b)) #endif #ifndef MAX #define MAX(a,b) (((a)>=(b))?(a):(b)) #endif //#define DEBUG 1 #ifdef DEBUG #define DATABUF_VALIDATE(db) \ { \ if (db->alloc_ptr == NULL || db->alloc_size == 0) { \ assert(db->alloc_ptr == NULL); \ assert(db->alloc_size == 0); \ assert(db->len == 0); \ } else { \ assert(db->offset <= db->alloc_size); \ assert(db->len <= db->alloc_size); \ assert(db->offset+db->len <= db->alloc_size); \ } \ } #else #define DATABUF_VALIDATE(db) #endif /*****************************************************************************/ /************************** Internal Type Definitions ************************/ /*****************************************************************************/ /*****************************************************************************/ /********************** External Function Declarations *********************/ /*****************************************************************************/ /*****************************************************************************/ /********************** Internal Function Declarations *********************/ /*****************************************************************************/ static int databuf_shift_data_to_beginning(DataBuf *db); /*****************************************************************************/ /************************* External Global Variables ***********************/ /*****************************************************************************/ /*****************************************************************************/ /************************* Internal Global Variables ***********************/ /*****************************************************************************/ #ifdef DEBUG static int debug = 0; #endif /*****************************************************************************/ /**************************** Inline Functions *****************************/ /*****************************************************************************/ static inline char *databuf_end(const DataBuf *db) {return (db->alloc_ptr == NULL) ? NULL : db->alloc_ptr+db->offset+db->len;} static inline unsigned databuf_tail_size(const DataBuf *db) {return db->alloc_size - (db->offset+db->len);} static inline unsigned databuf_tail_available(DataBuf *db, size_t append_len) {return append_len <= databuf_tail_size(db);} /*****************************************************************************/ /*************************** Internal Functions ****************************/ /*****************************************************************************/ static int databuf_shift_data_to_beginning(DataBuf *db) { DATABUF_VALIDATE(db); if (db->flags & DATABUF_FLAG_PRESERVE_HEAD) return -1; if (databuf_beg(db) == NULL) return 1; if (db->offset) { memmove(db->alloc_ptr, databuf_beg(db), db->len); db->offset = 0; } DATABUF_VALIDATE(db); return 1; } /*****************************************************************************/ /**************************** Exported Functions ***************************/ /*****************************************************************************/ void databuf_print(const DataBuf *db, int print_data, char *fmt, ...) { va_list ap; va_start(ap, fmt); if (fmt) { vprintf(fmt, ap); } printf("%salloc_size=%zu alloc_ptr=%p offset=%zu beg=%p len=%zu max_len=%zu flags=[", fmt?" ":"", db->alloc_size, db->alloc_ptr, db->offset, databuf_beg(db), db->len, db->max_len); if (db->flags & DATABUF_FLAG_PRESERVE_HEAD) printf("PRESERVE_HEAD "); printf("]"); if (print_data) { printf(" ["); fwrite(databuf_beg(db), 1, db->len, stdout); printf("]"); } printf("\n"); va_end(ap); } int databuf_init(DataBuf *db, size_t size, unsigned flags) { db->alloc_ptr = NULL; db->alloc_size = 0; db->offset = 0; db->len = 0; db->max_len = 0; db->flags = flags; if (size) { if ((db->alloc_ptr = malloc(size))) { db->alloc_size = size; return 1; } else { return -1; } } return 1; } void databuf_free(DataBuf *db) { DATABUF_VALIDATE(db); if (db->alloc_ptr != NULL) { free(db->alloc_ptr); } db->alloc_ptr = NULL; db->alloc_size = 0; db->offset = 0; db->len = 0; db->max_len = 0; DATABUF_VALIDATE(db); } int databuf_append(DataBuf *db, const char *src, size_t src_size) { size_t new_size; DATABUF_VALIDATE(db); if (src == NULL || src_size == 0) return 0; new_size = db->len+src_size; #ifdef DEBUG if (debug) databuf_print(db, 1, "databuf_append() size=%zd", src_size); #endif if ((new_size > db->alloc_size) || ((db->flags & DATABUF_FLAG_PRESERVE_HEAD) && !databuf_tail_available(db, src_size))) { /* not enough room, we must realloc */ void *new_alloc; databuf_shift_data_to_beginning(db); if ((new_alloc = realloc(db->alloc_ptr, new_size))) { db->alloc_ptr = new_alloc; db->alloc_size = new_size; } else { return -1; /* realloc failed */ } } else { /* we can fit within current allocation, but can we append? */ if (!databuf_tail_available(db, src_size)) { /* we can't append in place, must create room at tail by shifting data forward to the beginning of the allocation block */ databuf_shift_data_to_beginning(db); } } #ifdef DEBUG if (debug) databuf_print(db, 1, "databuf_append() about to memmove()"); #endif /* pointers all set up and room available, move the data and update */ memmove(databuf_end(db), src, src_size); db->len = new_size; db->max_len = MAX(db->max_len, new_size); #ifdef DEBUG if (debug) databuf_print(db, 1, "databuf_append() conclusion"); #endif DATABUF_VALIDATE(db); return 1; } int databuf_replace(DataBuf *db, const char *src, size_t src_size) { DATABUF_VALIDATE(db); if (src == NULL || src_size == 0) return 0; db->len = 0; return databuf_append(db, src, src_size); } int databuf_advance(DataBuf *db, size_t advance) { size_t actual_advance; DATABUF_VALIDATE(db); #ifdef DEBUG if (debug) databuf_print(db, 1, "databuf_advance() enter, advance=%zd", advance); #endif actual_advance = MIN(advance, db->len); db->offset += actual_advance; db->len -= actual_advance; #ifdef DEBUG if (debug) databuf_print(db, 1, "databuf_advance() leave, actual_advance=%zd", actual_advance); #endif DATABUF_VALIDATE(db); if (advance == actual_advance) { return 1; } else { errno = ESPIPE; // Illegal seek return -1; } } int databuf_reset(DataBuf *db) { #ifdef DEBUG if (debug) databuf_print(db, 1, "databuf_reset() entry"); #endif if (!(db->flags & DATABUF_FLAG_PRESERVE_HEAD)) return -1; db->offset = 0; db->len = MIN(db->alloc_size, db->max_len); #ifdef DEBUG if (debug) databuf_print(db, 1, "databuf_reset() exit"); #endif return 1; } /*****************************************************************************/ /******************************* Test Program ******************************/ /*****************************************************************************/ #ifdef TEST static char *make_data(size_t size, const char *fill) { int n=0; char *data = malloc(size); if (data == NULL) { fprintf(stderr, "ERROR: make_data malloc failed\n"); exit(1); } n += snprintf(data, size, "%d", size); while (n < size) { n += snprintf(data+n, size-n, "%s", fill); } return data; } int main(int argc, char **argv) { size_t size = 0; DataBuf buf; char *data; int rc; rc = databuf_init(&buf, size, 0); assert(rc); databuf_print(&buf, 1, "after init size=%d", size); databuf_free(&buf); #if 0 assert(databuf_init(&buf, size, 0)); databuf_print(&buf, 1, "after init size=%d", size); size = 8; data = make_data(size, "a"); assert(databuf_append(&buf, data, size)); databuf_print(&buf, 1, "after append size=%d", size); assert(databuf_append(&buf, data, size)); free(data); databuf_print(&buf, 1, "after append size=%d", size); assert(databuf_advance(&buf, 4)); databuf_print(&buf, 1, "after databuf_advance(%d", 4); size = 5; data = make_data(size, "b"); assert(databuf_append(&buf, data, size)); free(data); databuf_print(&buf, 1, "after append size=%d", size); size = 7; data = make_data(size, "c"); assert(databuf_append(&buf, data, size)); free(data); databuf_print(&buf, 1, "after append size=%d", size); databuf_free(&buf); #endif exit(0); } #endif audit-4.0.2/auparse/famtab.h0000644001034500103450000000361014655201403011347 /* famtab.h -- * Copyright 2007,2012-23 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb * Location: include/linux/socket.h */ _S(AF_LOCAL, "local" ) _S(AF_INET, "inet" ) _S(AF_AX25, "ax25" ) _S(AF_IPX, "ipx" ) _S(AF_APPLETALK, "appletalk" ) _S(AF_NETROM, "netrom" ) _S(AF_BRIDGE, "bridge" ) _S(AF_ATMPVC, "atmpvc" ) _S(AF_X25, "x25" ) _S(AF_INET6, "inet6" ) _S(AF_ROSE, "rose" ) _S(AF_DECnet, "decnet" ) _S(AF_NETBEUI, "netbeui" ) _S(AF_SECURITY, "security" ) _S(AF_KEY, "key" ) _S(AF_NETLINK, "netlink" ) _S(AF_PACKET, "packet" ) _S(AF_ASH, "ash" ) _S(AF_ECONET, "econet" ) _S(AF_ATMSVC, "atmsvc" ) _S(AF_RDS, "rds" ) _S(AF_SNA, "sna" ) _S(AF_IRDA, "irda" ) _S(AF_PPPOX, "pppox" ) _S(AF_WANPIPE, "wanpipe" ) _S(AF_LLC, "llc" ) _S(AF_CAN, "can" ) _S(AF_TIPC, "tipc" ) _S(AF_BLUETOOTH, "bluetooth" ) _S(AF_IUCV, "iucv" ) _S(AF_RXRPC, "rxrpc" ) _S(AF_ISDN, "isdn" ) _S(AF_PHONET, "phonet" ) _S(AF_IEEE802154, "ieee802154" ) _S(37, "caif" ) _S(38, "alg" ) _S(39, "nfc" ) _S(40, "vsock" ) _S(41, "kcm" ) _S(42, "qipcrtr" ) _S(43, "smc" ) _S(44, "xdp" ) _S(45, "mctp" ) audit-4.0.2/auparse/expression.c0000644001034500103450000006650314655201403012321 /* * expression.c - Expression parsing and handling * Copyright (C) 2008,2014,2016 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Miloslav Trmač * Steve Grubb extended timestamp */ #include #include #include #include #include #include "expression.h" #include "interpret.h" /* Utilities */ /* Free EXPR and all its subexpressions. */ void expr_free(struct expr *expr) { switch (expr->op) { case EO_NOT: expr_free(expr->v.sub[0]); break; case EO_AND: case EO_OR: expr_free(expr->v.sub[0]); expr_free(expr->v.sub[1]); break; case EO_RAW_EQ: case EO_RAW_NE: case EO_INTERPRETED_EQ: case EO_INTERPRETED_NE: case EO_VALUE_EQ: case EO_VALUE_NE: case EO_VALUE_LT: case EO_VALUE_LE: case EO_VALUE_GT: case EO_VALUE_GE: if (expr->virtual_field == 0) free(expr->v.p.field.name); if (expr->precomputed_value == 0) free(expr->v.p.value.string); break; case EO_FIELD_EXISTS: assert(expr->virtual_field == 0); free(expr->v.p.field.name); break; case EO_REGEXP_MATCHES: regfree(expr->v.regexp); free(expr->v.regexp); break; default: abort(); } free(expr); } /* Expression parsing. */ /* The formal grammar: start: or-expression or-expression: and-expression or-expression: or-expression || and-expression and-expression: primary-expression and-expression: and-expression && primary-expression primary-expression: ! primary-expression primary-expression: ( or-expression ) primary-expression: comparison-expression comparison-expression: field op value comparison-expression: field-escape "regexp" regexp-value field: string field: field-escape string value: string regexp-value: string regexp-value: regexp */ /* Token types */ enum token_type { /* EO_* */ T_LEFT_PAREN = NUM_EO_VALUES, T_RIGHT_PAREN, T_STRING, T_REGEXP, T_FIELD_ESCAPE, T_UNKNOWN, T_EOF }; /* Expression parsing status */ struct parsing { char **error; /* Error message destination. */ enum token_type token; const char *token_start; /* Original "src" value */ int token_len; /* int because it must be usable in %.*s */ char *token_value; /* Non-NULL only for T_STRING, until used */ const char *src; /* Expression source, after the current token */ }; static struct expr *parse_or(struct parsing *p); /* Allocate SIZE bytes. On error, return NULL and try to set *P->ERROR. */ static void * parser_malloc(struct parsing *p, size_t size) { void *res; res = malloc(size); if (res) return res; *p->error = strdup("Out of memory"); return NULL; } /* Reallocate PTR to SIZE bytes. On error, free(PTR), return NULL and try to set *P->ERROR. NOTE: realloc() does not free(PTR), this function does. */ static void * parser_realloc(struct parsing *p, void *ptr, size_t size) { void *res; if (size == 0) { free(ptr); return NULL; } res = realloc(ptr, size); if (res) return res; free(ptr); *p->error = strdup("Out of memory"); return NULL; } /* Discard P->token_value, if any, and parse the next token in P->src. On success, return 0. On error, set *P->ERROR to an error string (for free()) or NULL, and return -1. */ static int lex(struct parsing *p) { free(p->token_value); p->token_value = NULL; while (*p->src == ' ' || *p->src == '\t' || *p->src == '\n') p->src++; p->token_start = p->src; switch (*p->src) { case '\0': p->token = T_EOF; break; case '!': p->src++; if (*p->src == '=' && p->src[1] == '=') { p->src += 2; p->token = EO_VALUE_NE; break; } p->token = EO_NOT; break; case '"': case '/': { char *buf, delimiter; size_t dest, buf_size; delimiter = *p->src; buf_size = 8; buf = parser_malloc(p, buf_size); if (buf == NULL) return -1; p->src++; dest = 0; while (*p->src != delimiter) { if (*p->src == '\0') { *p->error = strdup("Terminating delimiter " "missing"); free(buf); return -1; } if (*p->src == '\\') { p->src++; if (*p->src != '\\' && *p->src != delimiter) { if (asprintf(p->error, "Unknown escape " "sequence ``\\%c''", *p->src) < 0) *p->error = NULL; free(buf); return -1; } } /* +1: make sure there is space for the terminating NUL. */ if (dest + 1 >= buf_size) { if (buf_size > SIZE_MAX / 2) { *p->error = strdup("Delimited string " "too long"); free(buf); return -1; } buf_size *= 2; buf = parser_realloc(p, buf, buf_size); if (buf == NULL) { *p->error = strdup("Out of memory"); return -1; } } buf[dest] = *p->src; dest++; p->src++; } p->src++; buf[dest] = '\0'; p->token_value = parser_realloc(p, buf, dest + 1); if (p->token_value == NULL) return -1; p->token = delimiter == '/' ? T_REGEXP : T_STRING; break; } case '&': p->src++; if (*p->src == '&') { p->src++; p->token = EO_AND; break; } p->token = T_UNKNOWN; break; case '(': p->src++; p->token = T_LEFT_PAREN; break; case ')': p->src++; p->token = T_RIGHT_PAREN; break; case '<': p->src++; if (*p->src == '=') { p->src++; p->token = EO_VALUE_LE; break; } p->token = EO_VALUE_LT; break; case '=': p->src++; if (*p->src == '=') { p->src++; p->token = EO_VALUE_EQ; break; } p->token = T_UNKNOWN; break; case '>': p->src++; if (*p->src == '=') { p->src++; p->token = EO_VALUE_GE; break; } p->token = EO_VALUE_GT; break; case '\\': p->src++; p->token = T_FIELD_ESCAPE; break; case '|': p->src++; if (*p->src == '|') { p->src++; p->token = EO_OR; break; } p->token = T_UNKNOWN; break; case 'i': if (p->src[1] == '=') { p->src += 2; p->token = EO_INTERPRETED_EQ; break; } else if (p->src[1] == '!' && p->src[2] == '=') { p->src += 3; p->token = EO_INTERPRETED_NE; break; } goto unquoted_string; case 'r': if (p->src[1] == '=') { p->src += 2; p->token = EO_RAW_EQ; break; } else if (p->src[1] == '!' && p->src[2] == '=') { p->src += 3; p->token = EO_RAW_NE; break; } goto unquoted_string; default: /* This assumes ASCII */ assert ('Z' == 'A' + 25 && 'z' == 'a' + 25); #define IS_UNQUOTED_STRING_CHAR(C) \ (((C) >= 'a' && (C) <= 'z') \ || ((C) >= 'A' && (C) <= 'Z') \ || ((C) >= '0' && (C) <= '9') \ || (C) == '_' || (C) == '-') if (IS_UNQUOTED_STRING_CHAR(*p->src)) { size_t len; unquoted_string: do p->src++; while (IS_UNQUOTED_STRING_CHAR(*p->src)); len = p->src - p->token_start; p->token_value = parser_malloc(p, len + 1); if (p->token_value == NULL) return -1; memcpy(p->token_value, p->token_start, len); p->token_value[len] = '\0'; p->token = T_STRING; break; } p->src++; p->token = T_UNKNOWN; break; } if (p->src - p->token_start > INT_MAX) { *p->error = strdup("Token too long"); return -1; } p->token_len = p->src - p->token_start; return 0; } /* Parse an escaped field NAME to DEST. Return 0 on success, -1 if NAME is unknown. */ static int parse_escaped_field_name(enum field_id *dest, const char *name) { if (strcmp(name, "timestamp") == 0) *dest = EF_TIMESTAMP; else if (strcmp(name, "record_type") == 0) *dest = EF_RECORD_TYPE; else if (strcmp(name, "timestamp_ex") == 0) *dest = EF_TIMESTAMP_EX; else return -1; return 0; } /* Parse a \timestamp field value in P->token_value to DEST. On success, return 0. On error, set *P->ERROR to an error string (for free()) or NULL, and return -1. */ static int parse_timestamp_value(struct expr *dest, struct parsing *p) { intmax_t sec; assert(p->token == T_STRING); /* * On a timestamp field we will do all the parsing ourselves * rather than use lex(). At the end we will move the internal cursor. */ if (sscanf(p->token_start, "ts:%jd.%u:%u", &sec, &dest->v.p.value.timestamp_ex.milli, &dest->v.p.value.timestamp_ex.serial) != 3) { if (sscanf(p->token_start, "ts:%jd.%u", &sec, &dest->v.p.value.timestamp.milli) != 2) { if (asprintf(p->error, "Invalid timestamp value `%.*s'", p->token_len, p->token_start) < 0) *p->error = NULL; return -1; } } /* Move the cursor past what we parsed. */ size_t num = strspn(p->token_start, "ts:0123456789."); p->src = p->token_start + num; /* FIXME: validate milli */ dest->v.p.value.timestamp.sec = sec; if (dest->v.p.value.timestamp.sec != sec) { if (asprintf(p->error, "Timestamp overflow in `%.*s'", p->token_len, p->token_start) < 0) *p->error = NULL; return -1; } dest->precomputed_value = 1; return 0; } /* Parse a \record_type field value in P->token_value to DEST. On success, return 0. On error, set *P->ERROR to an error string (for free()) or NULL, and return -1. */ static int parse_record_type_value(struct expr *dest, struct parsing *p) { int type; assert(p->token == T_STRING); type = audit_name_to_msg_type(p->token_value); if (type < 0) { if (asprintf(p->error, "Invalid record type `%.*s'", p->token_len, p->token_start) < 0) *p->error = NULL; return -1; } dest->v.p.value.int_value = type; dest->precomputed_value = 1; return 0; } /* Parse a uid/gid field value in P->token_value to DEST. On success, return 0. On error, set *P->ERROR to an error string (for free()) or NULL, and return -1. */ static int parse_unsigned_value(struct expr *dest, struct parsing *p) { uint32_t val; assert(p->token == T_STRING); errno = 0; val = strtoul(p->token_value, NULL, 10); if (errno) { if (asprintf(p->error, "Error converting number `%.*s'", p->token_len, p->token_start) < 0) *p->error = NULL; return -1; } dest->v.p.unsigned_val = val; dest->precomputed_value = 1; return 0; } /* Parse a virtual field value in P->token_value to DEST. On success, return 0. On error, set *P->ERROR to an error string (for free()) or NULL, and return NULL. */ static int parse_virtual_field_value(struct expr *dest, struct parsing *p) { switch (dest->v.p.field.id) { case EF_TIMESTAMP: return parse_timestamp_value(dest, p); case EF_RECORD_TYPE: return parse_record_type_value(dest, p); case EF_TIMESTAMP_EX: return parse_timestamp_value(dest, p); default: abort(); } } /* Parse a \regexp comparison-expression string in *P, with \regexp parsed. Use or free EXPR. On success, return the parsed comparison-expression. On error, set *P->ERROR to an error string (for free()) or NULL, and return NULL. */ static struct expr * parse_comparison_regexp(struct parsing *p, struct expr *res) { int err; if (lex(p) != 0) goto err_res; if (p->token != T_STRING && p->token != T_REGEXP) { if (asprintf(p->error, "Regexp expected, got `%.*s'", p->token_len, p->token_start) < 0) *p->error = NULL; goto err_res; } res->v.regexp = parser_malloc(p, sizeof(*res->v.regexp)); if (res->v.regexp == NULL) goto err_res; err = regcomp(res->v.regexp, p->token_value, REG_EXTENDED | REG_NOSUB); if (err != 0) { size_t err_size; char *err_msg; err_size = regerror(err, res->v.regexp, NULL, 0); err_msg = parser_malloc(p, err_size); if (err_msg == NULL) goto err_res_regexp; regerror(err, res->v.regexp, err_msg, err_size); if (asprintf(p->error, "Invalid regexp: %s", err_msg) < 0) *p->error = NULL; free(err_msg); goto err_res_regexp; } res->op = EO_REGEXP_MATCHES; if (lex(p) != 0) { expr_free(res); return NULL; } return res; err_res_regexp: free(res->v.regexp); err_res: free(res); return NULL; } /* Parse a comparison-expression string in *P. On success, return the parsed comparison-expression. On error, set *P->ERROR to an error string (for free()) or NULL, and return NULL. */ static struct expr * parse_comparison(struct parsing *p) { struct expr *res; res = parser_malloc(p, sizeof(*res)); if (res == NULL) return NULL; res->numeric_field = 0; if (p->token == T_FIELD_ESCAPE) { if (lex(p) != 0) goto err_res; if (p->token != T_STRING) { *p->error = strdup("Field name expected after field " "escape"); goto err_res; } if (strcmp(p->token_value, "regexp") == 0) return parse_comparison_regexp(p, res); res->virtual_field = 1; res->numeric_field = 1; if (parse_escaped_field_name(&res->v.p.field.id, p->token_value) != 0) { if (asprintf(p->error, "Unknown escaped field name `%.*s'", p->token_len, p->token_start) < 0) *p->error = NULL; goto err_res; } } else { assert(p->token == T_STRING); res->virtual_field = 0; res->v.p.field.name = p->token_value; int type = lookup_type(p->token_value); if (type == AUPARSE_TYPE_UID || type == AUPARSE_TYPE_GID) res->numeric_field = 1; p->token_value = NULL; } if (lex(p) != 0) goto err_field; switch (p->token) { case EO_RAW_EQ: case EO_RAW_NE: case EO_INTERPRETED_EQ: case EO_INTERPRETED_NE: res->op = p->token; if (lex(p) != 0) goto err_field; if (p->token != T_STRING) { if (asprintf(p->error, "Value expected, got `%.*s'", p->token_len, p->token_start) < 0) *p->error = NULL; goto err_field; } res->precomputed_value = 0; res->v.p.value.string = p->token_value; p->token_value = NULL; if (lex(p) != 0) { expr_free(res); return NULL; } break; case EO_VALUE_EQ: case EO_VALUE_NE: case EO_VALUE_LT: case EO_VALUE_LE: case EO_VALUE_GT: case EO_VALUE_GE: res->op = p->token; if (lex(p) != 0) goto err_field; if (p->token != T_STRING) { if (asprintf(p->error, "Value expected, got `%.*s'", p->token_len, p->token_start) < 0) *p->error = NULL; goto err_field; } if (res->numeric_field == 0) { if (asprintf(p->error, "Field `%s' does not support " "value comparison", res->v.p.field.name) < 0) *p->error = NULL; goto err_field; } else { if (res->virtual_field) { if (parse_virtual_field_value(res, p) != 0) goto err_field; } else { if (parse_unsigned_value(res, p) != 0) goto err_field; } } if (lex(p) != 0) { expr_free(res); return NULL; } break; default: if (asprintf(p->error, "Operator expected, got `%.*s'", p->token_len, p->token_start) < 0) *p->error = NULL; goto err_field; } return res; err_field: if (res->virtual_field == 0) free(res->v.p.field.name); err_res: free(res); return NULL; } /* Parse a primary-expression string in *P. On success, return the parsed primary-expression. On error, set *P->ERROR to an error string (for free()) or NULL, and return NULL. */ static struct expr * parse_primary(struct parsing *p) { struct expr *e; switch (p->token) { case EO_NOT: { struct expr *res; if (lex(p) != 0) return NULL; e = parse_primary(p); if (e == NULL) return NULL; res = parser_malloc(p, sizeof(*res)); if (res == NULL) goto err_e; res->op = EO_NOT; res->v.sub[0] = e; return res; } case T_LEFT_PAREN: { if (lex(p) != 0) return NULL; e = parse_or(p); if (e == NULL) return NULL; if (p->token != T_RIGHT_PAREN) { if (asprintf(p->error, "Right paren expected, got `%.*s'", p->token_len, p->token_start) < 0) *p->error = NULL; goto err_e; } if (lex(p) != 0) goto err_e; return e; } case T_FIELD_ESCAPE: case T_STRING: return parse_comparison(p); default: if (asprintf(p->error, "Unexpected token `%.*s'", p->token_len, p->token_start) < 0) *p->error = NULL; return NULL; } err_e: expr_free(e); return NULL; } /* Parse an and-expression string in *P. On success, return the parsed and-expression. On error, set *P->ERROR to an error string (for free()) or NULL, and return NULL. */ static struct expr * parse_and(struct parsing *p) { struct expr *res; res = parse_primary(p); if (res == NULL) return NULL; while (p->token == EO_AND) { struct expr *e2, *e; if (lex(p) != 0) goto err_res; e2 = parse_primary(p); if (e2 == NULL) goto err_res; e = parser_malloc(p, sizeof(*e)); if (e == NULL) { expr_free(e2); goto err_res; } e->op = EO_AND; e->v.sub[0] = res; e->v.sub[1] = e2; res = e; } return res; err_res: expr_free(res); return NULL; } /* Parse an or-expression string in *P. On success, return the parsed or-expression. On error, set *P->ERROR to an error string (for free()) or NULL, and return NULL. */ static struct expr * parse_or(struct parsing *p) { struct expr *res; res = parse_and(p); if (res == NULL) return NULL; while (p->token == EO_OR) { struct expr *e2, *e; if (lex(p) != 0) goto err_res; e2 = parse_and(p); if (e2 == NULL) goto err_res; e = parser_malloc(p, sizeof(*e)); if (e == NULL) { expr_free(e2); goto err_res; } e->op = EO_OR; e->v.sub[0] = res; e->v.sub[1] = e2; res = e; } return res; err_res: expr_free(res); return NULL; } /* Parse STRING. On success, return the parsed expression tree. On error, set *ERROR to an error string (for free()) or NULL, and return NULL. (*ERROR == NULL is allowed to handle out-of-memory errors) */ struct expr * expr_parse(const char *string, char **error) { struct parsing p; struct expr *res; p.error = error; p.token_value = NULL; p.src = string; if (lex(&p) != 0) goto err; if (p.token == T_EOF) { *error = strdup("Empty expression"); goto err; } res = parse_or(&p); if (res != NULL && p.token != T_EOF) { expr_free(res); if (asprintf(error, "Unexpected trailing token `%.*s'", p.token_len, p.token_start) < 0) *error = NULL; goto err; } free(p.token_value); return res; err: free(p.token_value); return NULL; } /* Manual expression creation */ /* Create a comparison-expression for FIELD, OP and VALUE. On success, return the created expression. On error, set errno and return NULL. */ struct expr * expr_create_comparison(const char *field, unsigned op, const char *value) { struct expr *res; res = calloc(sizeof(struct expr), 1); if (res == NULL) goto err; assert(op == EO_RAW_EQ || op == EO_RAW_NE || op == EO_INTERPRETED_EQ || op == EO_INTERPRETED_NE); res->op = op; res->virtual_field = 0; res->precomputed_value = 0; res->v.p.field.name = strdup(field); if (res->v.p.field.name == NULL) goto err_res; res->v.p.value.string = strdup(value); if (res->v.p.value.string == NULL) goto err_field; return res; err_field: free(res->v.p.field.name); err_res: free(res); err: return NULL; } /* Create an extended timestamp comparison-expression for with OP, SEC, MILLI, and SERIAL. On success, return the created expression. On error, set errno and return NULL. */ struct expr * expr_create_timestamp_comparison_ex(unsigned op, time_t sec, unsigned milli, unsigned serial) { struct expr *res; res = calloc(sizeof(struct expr), 1); if (res == NULL) return NULL; assert(op == EO_VALUE_EQ || op == EO_VALUE_NE || op == EO_VALUE_LT || op == EO_VALUE_LE || op == EO_VALUE_GT || op == EO_VALUE_GE); res->op = op; res->virtual_field = 1; res->numeric_field = 1; res->v.p.field.id = EF_TIMESTAMP_EX; res->precomputed_value = 1; res->v.p.value.timestamp_ex.sec = sec; assert(milli < 1000); res->v.p.value.timestamp_ex.milli = milli; res->v.p.value.timestamp_ex.serial = serial; return res; } /* Create a timestamp comparison-expression for with OP, SEC, MILLI. On success, return the created expression. On error, set errno and return NULL. */ struct expr * expr_create_timestamp_comparison(unsigned op, time_t sec, unsigned milli) { return expr_create_timestamp_comparison_ex(op, sec, milli, 0); } /* Create an EO_FIELD_EXISTS-expression for FIELD. On success, return the created expression. On error, set errno and return NULL. */ struct expr * expr_create_field_exists(const char *field) { struct expr *res; res = calloc(sizeof(struct expr), 1); if (res == NULL) goto err; res->op = EO_FIELD_EXISTS; res->virtual_field = 0; res->v.p.field.name = strdup(field); if (res->v.p.field.name == NULL) goto err_res; return res; err_res: free(res); err: return NULL; } /* Create a \regexp expression for regexp comparison. On success, return the created expression. On error, set errno and return NULL. */ struct expr * expr_create_regexp_expression(const char *regexp) { struct expr *res; res = calloc(sizeof(struct expr), 1); if (res == NULL) goto err; res->v.regexp = malloc(sizeof(*res->v.regexp)); if (res->v.regexp == NULL) goto err_res; if (regcomp(res->v.regexp, regexp, REG_EXTENDED | REG_NOSUB) != 0) { errno = EINVAL; goto err_res_regexp; } res->op = EO_REGEXP_MATCHES; return res; err_res_regexp: free(res->v.regexp); err_res: free(res); err: return NULL; } /* Create a binary expression for OP and subexpressions E1 and E2. On success, return the created expression. On error, set errno and return NULL. */ struct expr * expr_create_binary(unsigned op, struct expr *e1, struct expr *e2) { struct expr *res; res = calloc(sizeof(struct expr), 1); if (res == NULL) return NULL; assert(op == EO_AND || op ==EO_OR); res->op = op; res->v.sub[0] = e1; res->v.sub[1] = e2; return res; } /* Expression evaluation */ /* Return the "raw" value of the field in EXPR for RECORD in AU->le. Set *FREE_IT to 1 if the return value should free()'d. Return NULL on error. */ static char * eval_raw_value(rnode *record, const struct expr *expr, int *free_it) { if (expr->virtual_field == 0) { nvlist_first(&record->nv); if (nvlist_find_name(&record->nv, expr->v.p.field.name) == 0) return NULL; *free_it = 0; return (char *)nvlist_get_cur_val(&record->nv); } switch (expr->v.p.field.id) { case EF_TIMESTAMP: case EF_RECORD_TYPE: case EF_TIMESTAMP_EX: return NULL; default: abort(); } } /* Return the "int" value of the field in EXPR for RECORD in AU->le. Set valid to 1 if the return value is valid. Valid is set to 0 on error. */ static uint32_t eval_unsigned_value(rnode *record, const struct expr *expr, int *valid) { *valid = 0; if (expr->virtual_field == 0) { nvlist_first(&record->nv); if (nvlist_find_name(&record->nv, expr->v.p.field.name) == 0) return 0; const char *val = nvlist_get_cur_val(&record->nv); if (val) { uint32_t v = strtoul(val, NULL, 10); *valid = 1; return v; } } else abort(); return 0; } /* Return the "interpreted" value of the field in EXPR for RECORD in AU->le. Set *FREE_IT to 1 if the return value should free()'d. Return NULL on *error. */ static char * eval_interpreted_value(const auparse_state_t *au, rnode *record, const struct expr *expr, int *free_it) { if (expr->virtual_field == 0) { const char *res; nvlist_first(&record->nv); if (nvlist_find_name(&record->nv, expr->v.p.field.name) == 0) return NULL; *free_it = 0; res = nvlist_interp_cur_val(record, au->escape_mode); if (res == NULL) res = nvlist_get_cur_val(&record->nv); return (char *)res; } switch (expr->v.p.field.id) { case EF_TIMESTAMP: case EF_RECORD_TYPE: case EF_TIMESTAMP_EX: return NULL; default: abort(); } } static int compare_unsigned_values(uint32_t one, uint32_t two) { if (one < two) return -1; else if (one > two) return 1; return 0; } /* Return -1, 0, 1 depending on comparing the field in EXPR with RECORD in AU. Set *ERROR to 0 if OK, non-zero otherwise. */ static int compare_values(const auparse_state_t *au, const rnode *record, const struct expr *expr, int *error) { int res; if (expr->numeric_field == 0) { *error = 1; return 0; } switch (expr->v.p.field.id) { case EF_TIMESTAMP: if (au->le->e.sec < expr->v.p.value.timestamp.sec) res = -1; else if (au->le->e.sec > expr->v.p.value.timestamp.sec) res = 1; else if (au->le->e.milli < expr->v.p.value.timestamp.milli) res = -1; else if (au->le->e.milli > expr->v.p.value.timestamp.milli) res = 1; else res = 0; break; case EF_RECORD_TYPE: if (record->type < expr->v.p.value.int_value) res = -1; else if (record->type > expr->v.p.value.int_value) res = 1; else res = 0; break; case EF_TIMESTAMP_EX: if (au->le->e.sec < expr->v.p.value.timestamp.sec) res = -1; else if (au->le->e.sec > expr->v.p.value.timestamp.sec) res = 1; else if (au->le->e.milli < expr->v.p.value.timestamp.milli) res = -1; else if (au->le->e.milli > expr->v.p.value.timestamp.milli) res = 1; else if (au->le->e.serial < expr->v.p.value.timestamp_ex.serial) res = -1; else if (au->le->e.serial > expr->v.p.value.timestamp_ex.serial) res = 1; else res = 0; break; default: abort(); } *error = 0; return res; } /* Evaluate EXPR on RECORD in AU->le. Return 1 if EXPR is true, 0 if it false or if it fails. (No error reporting facility is provided; an invalid term is considered to be false; e.g. !invalid is true.) */ int expr_eval(auparse_state_t *au, rnode *record, const struct expr *expr) { int res; switch (expr->op) { case EO_NOT: res = !expr_eval(au, record, expr->v.sub[0]); break; case EO_AND: res = (expr_eval(au, record, expr->v.sub[0]) && expr_eval(au, record, expr->v.sub[1])); break; case EO_OR: res = (expr_eval(au, record, expr->v.sub[0]) || expr_eval(au, record, expr->v.sub[1])); break; case EO_RAW_EQ: case EO_RAW_NE: { int free_it, ne; char *value; value = eval_raw_value(record, expr, &free_it); if (value == NULL) return 0; assert(expr->precomputed_value == 0); ne = strcmp(expr->v.p.value.string, value); if (free_it != 0) free(value); res = expr->op == EO_RAW_EQ ? ne == 0 : ne != 0; break; } case EO_INTERPRETED_EQ: case EO_INTERPRETED_NE: { int free_it, ne; char *value; value = eval_interpreted_value(au, record, expr, &free_it); if (value == NULL) return 0; assert(expr->precomputed_value == 0); ne = strcmp(expr->v.p.value.string, value); if (free_it != 0) free(value); res = expr->op == EO_INTERPRETED_EQ ? ne == 0 : ne != 0; break; } case EO_VALUE_EQ: case EO_VALUE_NE: case EO_VALUE_LT: case EO_VALUE_LE: case EO_VALUE_GT: case EO_VALUE_GE: { int err = 0, cmp; if (expr->virtual_field == 0) { // UID & GID here int valid; uint32_t val = eval_unsigned_value(record,expr,&valid); if (valid == 0) return 0; cmp = compare_unsigned_values(val, expr->v.p.unsigned_val); } else // virtual fields here cmp = compare_values(au, record, expr, &err); if (err != 0) return 0; switch (expr->op) { case EO_VALUE_EQ: res = cmp == 0; break; case EO_VALUE_NE: res = cmp != 0; break; case EO_VALUE_LT: res = cmp < 0; break; case EO_VALUE_LE: res = cmp <= 0; break; case EO_VALUE_GT: res = cmp > 0; break; case EO_VALUE_GE: res = cmp >= 0; break; default: abort(); } } break; case EO_FIELD_EXISTS: assert(expr->virtual_field == 0); nvlist_first(&record->nv); res = nvlist_find_name(&record->nv, expr->v.p.field.name) != 0; break; case EO_REGEXP_MATCHES: res = regexec(expr->v.regexp, record->record, 0, NULL, 0) == 0; break; default: abort(); } return res; } audit-4.0.2/auparse/clocktab.h0000644001034500103450000000237414655201403011705 /* clocktab.h -- * Copyright 2012,2014 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb * Location: include/uapi/linux/time.h */ _S(0, "CLOCK_REALTIME" ) _S(1, "CLOCK_MONOTONIC" ) _S(2, "CLOCK_PROCESS_CPUTIME_ID" ) _S(3, "CLOCK_THREAD_CPUTIME_ID" ) _S(4, "CLOCK_MONOTONIC_RAW" ) _S(5, "CLOCK_REALTIME_COARSE" ) _S(6, "CLOCK_MONOTONIC_COARSE" ) _S(7, "CLOCK_BOOTTIME" ) _S(8, "CLOCK_REALTIME_ALARM" ) _S(9, "CLOCK_BOOTTIME_ALARM" ) _S(10, "CLOCK_SGI_CYCLE" ) _S(11, "CLOCK_TAI" ) audit-4.0.2/auparse/seccomptab.h0000644001034500103450000000217614655201403012243 /* seccomptab.h -- * Copyright 2012-13,2018,2020 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb * Location: include/uapi/linux/seccomp.h */ _S(0x80000000U, "kill-process") _S(0x00000000U, "kill-thread") _S(0x00030000U, "trap" ) _S(0x00050000U, "errno" ) _S(0x7fc00000U, "user-notify") _S(0x7ff00000U, "trace" ) _S(0x7ffc0000U, "log" ) _S(0x7fff0000U, "allow" ) audit-4.0.2/auparse/normalize-llist.c0000644001034500103450000000371414655201403013242 /* * normalize-llist.c - Minimal linked list library * Copyright (c) 2016-17 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb */ #include #include "normalize-llist.h" void cllist_create(cllist *l, void (*cleanup)(void *)) { l->head = NULL; l->cur = NULL; l->cleanup = cleanup; l->cnt = 0; } void cllist_clear(cllist *l) { data_node *nextnode; register data_node *current; if (l == NULL) return; current = l->head; while (current) { nextnode = current->next; if (l->cleanup) l->cleanup(current->data); free(current); current=nextnode; } l->head = NULL; l->cur = NULL; l->cnt = 0; } data_node *cllist_next(cllist *l) { if (l->cur == NULL) return NULL; l->cur = l->cur->next; return l->cur; } // Returns 0 on success and 1 on error int cllist_append(cllist *l, uint32_t num, void *data) { data_node *newnode; newnode = malloc(sizeof(data_node)); if (newnode == NULL) return 1; newnode->num = num; newnode->data = data; newnode->next = NULL; // if we are at top, fix this up if (l->head == NULL) l->head = newnode; else // Otherwise add pointer to newnode l->cur->next = newnode; // make newnode current l->cur = newnode; l->cnt++; return 0; } audit-4.0.2/auparse/netactiontab.h0000644001034500103450000000171714655201403012576 /* netactiontab.h -- * Copyright 2016 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb * Location: include/uapi/linux/netfilter/xt_AUDIT.h */ _S(0, "ACCEPT") _S(1, "DROP") _S(2, "REJECT") audit-4.0.2/auparse/signaltab.h0000644001034500103450000000275314655201403012070 /* signaltab.h -- * Copyright 2012-13 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb * Location: include/uapi/asm-generic/signal.h */ _S(0, "SIG0" ) _S(1, "SIGHUP" ) _S(2, "SIGINT" ) _S(3, "SIGQUIT" ) _S(4, "SIGILL" ) _S(5, "SIGTRAP" ) _S(6, "SIGABRT" ) _S(7, "SIGBUS" ) _S(8, "SIGFPE" ) _S(9, "SIGKILL" ) _S(10, "SIGUSR1" ) _S(11, "SIGSEGV" ) _S(12, "SIGUSR2" ) _S(13, "SIGPIPE" ) _S(14, "SIGALRM" ) _S(15, "SIGTERM" ) _S(16, "SIGSTKFLT" ) _S(17, "SIGCHLD" ) _S(18, "SIGCONT" ) _S(19, "SIGSTOP" ) _S(20, "SIGTSTP" ) _S(21, "SIGTTIN" ) _S(22, "SIGTTOU" ) _S(23, "SIGURG" ) _S(24, "SIGXCPU" ) _S(25, "SIGXFSZ" ) _S(26, "SIGVTALRM" ) _S(27, "SIGPROF" ) _S(28, "SIGWINCH" ) _S(29, "SIGIO" ) _S(30, "IGPWR" ) _S(31, "SIGSYS" ) audit-4.0.2/auparse/seektab.h0000644001034500103450000000175014655201403011536 /* seektab.h -- * Copyright 2013 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb * Location: include/uapi/linux/fs.h */ _S(0, "SEEK_SET") _S(1, "SEEK_CUR") _S(2, "SEEK_END") _S(3, "SEEK_DATA") _S(4, "SEEK_HOLE") audit-4.0.2/auparse/rlimittab.h0000644001034500103450000000242014655201403012102 /* rlimittab.h -- * Copyright 2012-13 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb * Location: include/uapi/asm-generic/resource.h */ _S(0, "RLIMIT_CPU") _S(1, "RLIMIT_FSIZE") _S(2, "RLIMIT_DATA") _S(3, "RLIMIT_STACK") _S(4, "RLIMIT_CORE") _S(5, "RLIMIT_RSS") _S(6, "RLIMIT_NPROC") _S(7, "RLIMIT_NOFILE") _S(8, "RLIMIT_MEMLOCK") _S(9, "RLIMIT_AS") _S(10,"RLIMIT_LOCKS") _S(11,"RLIMIT_SIGPENDING") _S(12,"RLIMIT_MSGQUEUE") _S(13,"RLIMIT_NICE") _S(14,"RLIMIT_RTPRIO") _S(15,"RLIMIT_RTTIME") audit-4.0.2/auparse/fcntl-cmdtab.h0000644001034500103450000000324614655201403012460 /* fcntl-cmdtab.h -- * Copyright 2007,2012-13 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb * Location: include/uapi/asm-generic/fcntl.h <17 * include/uapi/linux/fcntl.h >= 1024 */ _S(0, "F_DUPFD" ) _S(1, "F_GETFD" ) _S(2, "F_SETFD" ) _S(3, "F_GETFL" ) _S(4, "F_SETFL" ) _S(5, "F_GETLK" ) _S(6, "F_SETLK" ) _S(7, "F_SETLKW" ) _S(8, "F_SETOWN" ) _S(9, "F_GETOWN" ) _S(10, "F_SETSIG" ) _S(11, "F_GETSIG" ) _S(12, "F_GETLK64" ) _S(13, "F_SETLK64" ) _S(14, "F_SETLKW64" ) _S(15, "F_SETOWN_EX" ) _S(16, "F_GETOWN_EX" ) _S(17, "F_GETOWNER_UIDS" ) _S(1024, "F_SETLEASE" ) _S(1025, "F_GETLEASE" ) _S(1026, "F_NOTIFY" ) _S(1029, "F_CANCELLK" ) _S(1030, "F_DUPFD_CLOEXEC" ) _S(1031, "F_SETPIPE_SZ" ) _S(1032, "F_GETPIPE_SZ" ) _S(1033, "F_ADD_SEALS" ) _S(1034, "F_GET_SEALS" ) _S(1035, "F_GET_RW_HINT" ) _S(1036, "F_SET_RW_HINT" ) _S(1037, "F_GET_FILE_RW_HINT" ) _S(1038, "F_SET_FILE_RW_HINT" ) audit-4.0.2/auparse/sockoptnametab.h0000644001034500103450000000570314655201403013134 /* sockoptnametab.h -- * Copyright 2013-16,2020 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb * File: include/uapi/asm-generic/socket.h */ _S(1, "SO_DEBUG") _S(2, "SO_REUSEADDR") _S(3, "SO_TYPE") _S(4, "SO_ERROR") _S(5, "SO_DONTROUTE") _S(6, "SO_BROADCAST") _S(7, "SO_SNDBUF") _S(8, "SO_RCVBUF") _S(9, "SO_KEEPALIVE") _S(10, "SO_OOBINLINE") _S(11, "SO_NO_CHECK") _S(12, "SO_PRIORITY") _S(13, "SO_LINGER") _S(14, "SO_BSDCOMPAT") _S(15, "SO_REUSEPORT") _S(16, "SO_PASSCRED") _S(17, "SO_PEERCRED") _S(18, "SO_RCVLOWAT") _S(19, "SO_SNDLOWAT") _S(20, "SO_RCVTIMEO") _S(21, "SO_SNDTIMEO") _S(22, "SO_SECURITY_AUTHENTICATION") _S(23, "SO_SECURITY_ENCRYPTION_TRANSPORT") _S(24, "SO_SECURITY_ENCRYPTION_NETWORK") _S(25, "SO_BINDTODEVICE") _S(26, "SO_ATTACH_FILTER") _S(27, "SO_DETACH_FILTER") _S(28, "SO_PEERNAME") _S(29, "SO_TIMESTAMP") _S(30, "SO_ACCEPTCONN") _S(31, "SO_PEERSEC") _S(32, "SO_SNDBUFFORCE") _S(33, "SO_RCVBUFFORCE") _S(34, "SO_PASSSEC") _S(35, "SO_TIMESTAMPNS") _S(36, "SO_MARK") _S(37, "SO_TIMESTAMPING") _S(38, "SO_PROTOCOL") _S(39, "SO_DOMAIN") _S(40, "SO_RXQ_OVFL") _S(41, "SO_WIFI_STATUS") _S(42, "SO_PEEK_OFF") _S(43, "SO_NOFCS") _S(44, "SO_LOCK_FILTER") _S(45, "SO_SELECT_ERR_QUEUE") _S(46, "SO_BUSY_POLL") _S(47, "SO_MAX_PACING_RATE") _S(48, "SO_BPF_EXTENSIONS") _S(49, "SO_INCOMING_CPU") _S(50, "SO_ATTACH_BPF") _S(51, "SO_ATTACH_REUSEPORT_CBPF") _S(52, "SO_ATTACH_REUSEPORT_EBPF") _S(53, "SO_CNX_ADVICE") _S(54, "SCM_TIMESTAMPING_OPT_STATS") _S(55, "SO_MEMINFO") _S(56, "SO_INCOMING_NAPI_ID") _S(57, "SO_COOKIE") _S(58, "SCM_TIMESTAMPING_PKTINFO") _S(59, "SO_PEERGROUPS") _S(60, "SO_ZEROCOPY") _S(61, "SO_TXTIME") _S(62, "SO_BINDTOIFINDEX") _S(63, "SO_TIMESTAMP_NEW") _S(64, "SO_TIMESTAMPNS_NEW") _S(65, "SO_TIMESTAMPING_NEW") _S(66, "SO_RCVTIMEO_NEW") _S(67, "SO_SNDTIMEO_NEW") _S(68, "SO_DETACH_REUSEPORT_BPF") _S(69, "SO_PREFER_BUSY_POLL") _S(70, "SO_BUSY_POLL_BUDGET") _S(71, "SO_NETNS_COOKIE") _S(72, "SO_BUF_LOCK") _S(73, "SO_RESERVE_MEM") _S(74, "SO_TXREHASH") _S(75, "SO_RCVMARK") _S(76, "SO_PASSPIDFD") _S(77, "SO_PEERPIDFD") // PPC has these different _S(116, "SO_RCVLOWAT") _S(117, "SO_SNDLOWAT") _S(118, "SO_RCVTIMEO") _S(119, "SO_SNDTIMEO") _S(120, "SO_PASSCRED") _S(121, "SO_PEERCRED") audit-4.0.2/auparse/captab.h0000644001034500103450000000352014655201403011347 /* captab.h -- * Copyright 2007,2008,2012-14,2021 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb * Location: include/uapi/linux/capability.h */ _S(0, "chown" ) _S(1, "dac_override" ) _S(2, "dac_read_search" ) _S(3, "fowner" ) _S(4, "fsetid" ) _S(5, "kill" ) _S(6, "setgid" ) _S(7, "setuid" ) _S(8, "setpcap" ) _S(9, "linux_immutable" ) _S(10, "net_bind_service" ) _S(11, "net_broadcast" ) _S(12, "net_admin" ) _S(13, "net_raw" ) _S(14, "ipc_lock" ) _S(15, "ipc_owner" ) _S(16, "sys_module" ) _S(17, "sys_rawio" ) _S(18, "sys_chroot" ) _S(19, "sys_ptrace" ) _S(20, "sys_pacct" ) _S(21, "sys_admin" ) _S(22, "sys_boot" ) _S(23, "sys_nice" ) _S(24, "sys_resource" ) _S(25, "sys_time" ) _S(26, "sys_tty_config" ) _S(27, "mknod" ) _S(28, "lease" ) _S(29, "audit_write" ) _S(30, "audit_control" ) _S(31, "setfcap" ) _S(32, "mac_override" ) _S(33, "mac_admin" ) _S(34, "syslog" ) _S(35, "wake_alarm" ) _S(36, "block_suspend" ) _S(37, "audit_read" ) _S(38, "perfmon" ) _S(39, "bpf" ) _S(40, "checkpoint_restore" ) audit-4.0.2/auparse/tcpoptnametab.h0000644001034500103450000000364414655201403012765 /* tcpoptnametab.h -- * Copyright 2013-14,2018 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA * * Authors: * Steve Grubb * Location: include/uapi/linux/tcp.h */ _S(1, "TCP_NODELAY") _S(2, "TCP_MAXSEG") _S(3, "TCP_CORK") _S(4, "TCP_KEEPIDLE") _S(5, "TCP_KEEPINTVL") _S(6, "TCP_KEEPCNT") _S(7, "TCP_SYNCNT") _S(8, "TCP_LINGER2") _S(9, "TCP_DEFER_ACCEPT") _S(10, "TCP_WINDOW_CLAMP") _S(11, "TCP_INFO") _S(12, "TCP_QUICKACK") _S(13, "TCP_CONGESTION") _S(14, "TCP_MD5SIG") _S(15, "TCP_COOKIE_TRANSACTIONS") _S(16, "TCP_THIN_LINEAR_TIMEOUTS") _S(17, "TCP_THIN_DUPACK") _S(18, "TCP_USER_TIMEOUT") _S(19, "TCP_REPAIR") _S(20, "TCP_REPAIR_QUEUE") _S(21, "TCP_QUEUE_SEQ") _S(22, "TCP_REPAIR_OPTIONS") _S(23, "TCP_FASTOPEN") _S(24, "TCP_TIMESTAMP") _S(25, "TCP_NOTSENT_LOWAT") _S(26, "TCP_CC_INFO") _S(27, "TCP_SAVE_SYN") _S(28, "TCP_SAVED_SYN") _S(29, "TCP_REPAIR_WINDOW") _S(30, "TCP_FASTOPEN_CONNECT") _S(31, "TCP_ULP") _S(32, "TCP_MD5SIG_EXT") _S(33, "TCP_FASTOPEN_KEY") _S(34, "TCP_FASTOPEN_NO_COOKIE") _S(35, "TCP_ZEROCOPY_RECEIVE") _S(36, "TCP_INQ") _S(37, "TCP_TX_DELAY") _S(38, "TCP_AO_ADD_KEY") _S(39, "TCP_AO_DEL_KEY") _S(40, "TCP_AO_INFO") _S(41, "TCP_AO_GET_KEYS") _S(42, "TCP_AO_REPAIR") audit-4.0.2/auparse/normalize_record_map.h0000644001034500103450000001551714655201403014321 /* * normalize_record_map.h * Copyright (c) 2016-18,2021 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb */ #include "libaudit.h" _S(AUDIT_USER, "sent-message") _S(AUDIT_LOGIN, "changed-login-id-to") _S(AUDIT_USER_AUTH, "authenticated") _S(AUDIT_USER_ACCT, "was-authorized") _S(AUDIT_USER_MGMT, "modified-user-account") _S(AUDIT_CRED_ACQ, "acquired-credentials") _S(AUDIT_CRED_DISP, "disposed-credentials") _S(AUDIT_USER_START, "started-session") _S(AUDIT_USER_END, "ended-session") _S(AUDIT_USER_AVC, "accessed-mac-policy-controlled-object") _S(AUDIT_USER_CHAUTHTOK, "changed-password") _S(AUDIT_USER_ERR, "caused-account-error") _S(AUDIT_CRED_REFR, "refreshed-credentials") _S(AUDIT_USYS_CONFIG, "changed-configuration") _S(AUDIT_USER_LOGIN, "logged-in") _S(AUDIT_USER_LOGOUT, "logged-out") _S(AUDIT_ADD_USER, "added-user-account") _S(AUDIT_DEL_USER, "deleted-user-account") _S(AUDIT_ADD_GROUP, "added-group-account-to") _S(AUDIT_DEL_GROUP, "deleted-group-account-from") _S(AUDIT_DAC_CHECK, "access-result") _S(AUDIT_CHGRP_ID, "changed-group") _S(AUDIT_TEST, "sent-test") _S(AUDIT_TRUSTED_APP, "unknown") _S(AUDIT_USER_SELINUX_ERR, "access-error") _S(AUDIT_USER_CMD, "ran-command") _S(AUDIT_USER_TTY, "typed") _S(AUDIT_CHUSER_ID, "changed-user-id") _S(AUDIT_GRP_AUTH, "authenticated-to-group") _S(AUDIT_SYSTEM_BOOT, "booted-system") _S(AUDIT_SYSTEM_SHUTDOWN, "shutdown-system") _S(AUDIT_SYSTEM_RUNLEVEL, "changed-to-runlevel") _S(AUDIT_SERVICE_START, "started-service") _S(AUDIT_SERVICE_STOP, "stopped-service") _S(AUDIT_GRP_MGMT, "modified-group-account") _S(AUDIT_GRP_CHAUTHTOK, "changed-group-password") _S(AUDIT_MAC_CHECK, "mac-permission") _S(AUDIT_ACCT_LOCK, "locked-account") _S(AUDIT_ACCT_UNLOCK, "unlocked-account") _S(AUDIT_USER_DEVICE, "configured-device") _S(AUDIT_SOFTWARE_UPDATE, "installed-software") _S(AUDIT_DAEMON_START, "started-audit") _S(AUDIT_DAEMON_END, "shutdown-audit") _S(AUDIT_DAEMON_ABORT, "aborted-auditd-startup") _S(AUDIT_DAEMON_CONFIG, "changed-auditd-configuration") _S(AUDIT_DAEMON_RECONFIG, "reconfigured-auditd") _S(AUDIT_DAEMON_ROTATE, "rotated-audit-logs") _S(AUDIT_DAEMON_RESUME, "resumed-audit-logging") _S(AUDIT_DAEMON_ACCEPT, "remote-audit-connected") _S(AUDIT_DAEMON_CLOSE, "remote-audit-disconnected") _S(AUDIT_DAEMON_ERR, "audit-error") _S(AUDIT_CONFIG_CHANGE, "changed-audit-configuration") //_S(AUDIT_KERNEL_OTHER,"") _S(AUDIT_TTY, "typed") //_S(AUDIT_NETFILTER_PKT,"") //_S(AUDIT_NETFILTER_CFG,"") _S(AUDIT_SECCOMP, "called-seccomp-controlled-syscall") _S(AUDIT_FEATURE_CHANGE, "changed-audit-feature") //_S(AUDIT_REPLACE,"") _S(AUDIT_KERN_MODULE, "loaded-kernel-module") _S(AUDIT_FANOTIFY, "accessed-policy-controlled-file") //_S(AUDIT_BPF, "") //_S(AUDIT_EVENT_LISTENER, "") //_S(AUDIT_OPENAT2, "") _S(AUDIT_URINGOP, "io_uring-operation") _S(AUDIT_AVC, "accessed-mac-policy-controlled-object") _S(AUDIT_MAC_POLICY_LOAD, "loaded-selinux-policy") _S(AUDIT_MAC_STATUS, "changed-selinux-enforcement-to") _S(AUDIT_MAC_CONFIG_CHANGE, "changed-selinux-boolean") //_S(AUDIT_MAC_UNLBL_ALLOW, "") _S(AUDIT_MAC_MAP_ADD, "added-mac-network-domain-mapping-to") _S(AUDIT_MAC_MAP_DEL, "deleted-mac-network-domain-mapping-from") _S(AUDIT_ANOM_PROMISCUOUS, "changed-socket-promiscuous-mode") _S(AUDIT_ANOM_ABEND, "crashed-program") _S(AUDIT_ANOM_LINK, "used-suspcious-link") _S(AUDIT_ANOM_CREAT, "created-suspicious-file") //_S(AUDIT_INTEGRITY_DATA,"") //_S(AUDIT_INTEGRITY_METADATA,"") //_S(AUDIT_INTEGRITY_STATUS,"") //_S(AUDIT_INTEGRITY_HASH,"") //_S(AUDIT_INTEGRITY_PCR,"") //_S(AUDIT_INTEGRITY_RULE,"") //_S(AUDIT_INTEGRITY_EVM_XATTR,"") _S(AUDIT_KERNEL, "initialized-audit-subsystem") _S(AUDIT_ANOM_LOGIN_FAILURES, "failed-log-in-too-many-times-to") _S(AUDIT_ANOM_LOGIN_TIME, "attempted-log-in-during-unusual-hour-to") _S(AUDIT_ANOM_LOGIN_SESSIONS, "opened-too-many-sessions-to") //_S(AUDIT_ANOM_LOGIN_ACCT, "") _S(AUDIT_ANOM_LOGIN_LOCATION, "attempted-log-in-from-unusual-place-to") //_S(AUDIT_ANOM_MAX_DAC, "") //_S(AUDIT_ANOM_MAX_MAC, "") //_S(AUDIT_ANOM_AMTU_FAIL, "") //_S(AUDIT_ANOM_RBAC_FAIL, "") _S(AUDIT_ANOM_RBAC_INTEGRITY_FAIL, "tested-file-system-integrity-of") //_S(AUDIT_ANOM_CRYPTO_FAIL, "") //_S(AUDIT_ANOM_ACCESS_FS, "") _S(AUDIT_ANOM_EXEC, "attempted-execution-of-forbidden-program") //_S(AUDIT_ANOM_MK_EXEC, "") //_S(AUDIT_ANOM_ADD_ACCT, "") //_S(AUDIT_ANOM_DEL_ACCT, "") //_S(AUDIT_ANOM_MOD_ACCT, "") //_S(AUDIT_ANOM_ROOT_TRANS, "") //_S(AUDIT_RESP_ANOMALY, "") //_S(AUDIT_RESP_ALERT, "") //_S(AUDIT_RESP_KILL_PROC, "") //_S(AUDIT_RESP_TERM_ACCESS, "") //_S(AUDIT_RESP_ACCT_REMOTE, "") //_S(AUDIT_RESP_ACCT_LOCK_TIMED, "") //_S(AUDIT_RESP_ACCT_UNLOCK_TIMED, "") //_S(AUDIT_RESP_ACCT_LOCK, "") //_S(AUDIT_RESP_TERM_LOCK, "") //_S(AUDIT_RESP_SEBOOL, "") //_S(AUDIT_RESP_EXEC, "") //_S(AUDIT_RESP_SINGLE, "") //_S(AUDIT_RESP_HALT, "") _S(AUDIT_USER_ROLE_CHANGE, "changed-role-to") _S(AUDIT_ROLE_ASSIGN, "assigned-user-role-to") _S(AUDIT_ROLE_REMOVE, "removed-use-role-from") _S(AUDIT_LABEL_OVERRIDE, "overrode-label-of") _S(AUDIT_LABEL_LEVEL_CHANGE, "modified-level-of") //_S(AUDIT_USER_LABELED_EXPORT, "") //_S(AUDIT_USER_UNLABELED_EXPORT, "") //_S(AUDIT_DEV_ALLOC, "") //_S(AUDIT_DEV_DEALLOC, "") _S(AUDIT_FS_RELABEL, "relabeled-filesystem") _S(AUDIT_USER_MAC_POLICY_LOAD, "loaded-mac-policy") _S(AUDIT_ROLE_MODIFY, "modified-role") _S(AUDIT_USER_MAC_CONFIG_CHANGE, "changed-mac-configuration") _S(AUDIT_USER_MAC_STATUS, "changed-selinux-enforcement-to") //_S(AUDIT_CRYPTO_TEST_USER, "") //_S(AUDIT_CRYPTO_PARAM_CHANGE_USER, "") _S(AUDIT_CRYPTO_LOGIN, "crypto-officer-logged-in") _S(AUDIT_CRYPTO_LOGOUT, "crypto-officer-logged-out") _S(AUDIT_CRYPTO_KEY_USER, "negotiated-crypto-key") //_S(AUDIT_CRYPTO_FAILURE_USER, "") //_S(AUDIT_CRYPTO_REPLAY_USER, "") _S(AUDIT_CRYPTO_SESSION, "started-crypto-session") //_S(AUDIT_CRYPTO_IKE_SA, "") //_S(AUDIT_CRYPTO_IPSEC_SA, "") _S(AUDIT_VIRT_CONTROL, "issued-vm-control") _S(AUDIT_VIRT_RESOURCE, "assigned-vm-resource") _S(AUDIT_VIRT_MACHINE_ID, "assigned-vm-id") _S(AUDIT_VIRT_INTEGRITY_CHECK, "checked-integrity-of") _S(AUDIT_VIRT_CREATE, "created-vm-image") _S(AUDIT_VIRT_DESTROY, "deleted-vm-image") _S(AUDIT_VIRT_MIGRATE_IN, "migrated-vm-from") _S(AUDIT_VIRT_MIGRATE_OUT, "migrated-vm-to") //_S(,"") audit-4.0.2/auparse/normalize_obj_kind_map.h0000644001034500103450000000346014655201403014614 /* * normalize_obj_kind_map.h * Copyright (c) 2016-24 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb */ #include "normalize-internal.h" _S(NORM_WHAT_UNKNOWN, "unknown") _S(NORM_WHAT_FIFO, "fifo") _S(NORM_WHAT_CHAR_DEV, "character-device") _S(NORM_WHAT_DIRECTORY, "directory") _S(NORM_WHAT_BLOCK_DEV, "block-device") _S(NORM_WHAT_FILE, "file") _S(NORM_WHAT_FILESYSTEM, "file-system") _S(NORM_WHAT_LINK, "symlink") _S(NORM_WHAT_SOCKET, "socket") _S(NORM_WHAT_PROCESS, "process") _S(NORM_WHAT_FIREWALL, "firewall") _S(NORM_WHAT_SERVICE, "service") _S(NORM_WHAT_ACCT, "account") _S(NORM_WHAT_USER_SESSION, "user-session") _S(NORM_WHAT_VM, "virtual-machine") _S(NORM_WHAT_PRINTER, "printer") _S(NORM_WHAT_SYSTEM, "system") _S(NORM_WHAT_AUDIT_RULE, "admin-defined-rule") _S(NORM_WHAT_AUDIT_CONFIG, "audit-config") _S(NORM_WHAT_SECURITY_POLICY, "security-policy") _S(NORM_WHAT_MEMORY, "memory") _S(NORM_WHAT_KEYSTROKES, "keystrokes") _S(NORM_WHAT_DEVICE, "device") _S(NORM_WHAT_SOFTWARE, "software") _S(NORM_WHAT_INTEGRITY_POLICY, "integrity-policy") //_S(, "") audit-4.0.2/auparse/prctl-opt-tab.h0000644001034500103450000000527414655201403012615 /* prctl-opt-tab.h -- * Copyright 2013-16,2018,2020-23 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb * Location: include/uapi/linux/prctl.h */ _S(1, "PR_SET_PDEATHSIG") _S(2, "PR_GET_PDEATHSIG") _S(3, "PR_GET_DUMPABLE") _S(4, "PR_SET_DUMPABLE") _S(5, "PR_GET_UNALIGN") _S(6, "PR_SET_UNALIGN") _S(7, "PR_GET_KEEPCAPS") _S(8, "PR_SET_KEEPCAPS") _S(9, "PR_GET_FPEMU") _S(10, "PR_SET_FPEMU") _S(11, "PR_GET_FPEXC") _S(12, "PR_SET_FPEXC") _S(13, "PR_GET_TIMING") _S(14, "PR_SET_TIMING") _S(15, "PR_SET_NAME") _S(16, "PR_GET_NAME") _S(19, "PR_GET_ENDIAN") _S(20, "PR_SET_ENDIAN") _S(21, "PR_GET_SECCOMP") _S(22, "PR_SET_SECCOMP") _S(23, "PR_CAPBSET_READ") _S(24, "PR_CAPBSET_DROP") _S(25, "PR_GET_TSC") _S(26, "PR_SET_TSC") _S(27, "PR_GET_SECUREBITS") _S(28, "PR_SET_SECUREBITS") _S(29, "PR_SET_TIMERSLACK") _S(30, "PR_GET_TIMERSLACK") _S(31, "PR_TASK_PERF_EVENTS_DISABLE") _S(32, "PR_TASK_PERF_EVENTS_ENABLE") _S(33, "PR_MCE_KILL") _S(34, "PR_MCE_KILL_GET") _S(35, "PR_SET_MM") _S(36, "PR_SET_CHILD_SUBREAPER") _S(37, "PR_GET_CHILD_SUBREAPER") _S(38, "PR_SET_NO_NEW_PRIVS") _S(39, "PR_GET_NO_NEW_PRIVS") _S(40, "PR_GET_TID_ADDRESS") _S(41, "PR_SET_THP_DISABLE") _S(42, "PR_GET_THP_DISABLE") _S(43, "PR_MPX_ENABLE_MANAGEMENT") _S(44, "PR_MPX_DISABLE_MANAGEMENT") _S(45, "PR_SET_FP_MODE") _S(46, "PR_GET_FP_MODE") _S(47, "PR_CAP_AMBIENT") _S(50, "PR_SVE_SET_VL") _S(51, "PR_SVE_GET_VL") _S(52, "PR_GET_SPECULATION_CTRL") _S(53, "PR_SET_SPECULATION_CTRL") _S(54, "PR_PAC_RESET_KEYS") _S(55, "PR_SET_TAGGED_ADDR_CTRL") _S(56, "PR_GET_TAGGED_ADDR_CTRL") _S(57, "PR_SET_IO_FLUSHER") _S(58, "PR_GET_IO_FLUSHER") _S(59, "PR_SET_SYSCALL_USER_DISPATCH") _S(60, "PR_PAC_SET_ENABLED_KEYS") _S(61, "PR_PAC_GET_ENABLED_KEYS") _S(62, "PR_SCHED_CORE") _S(63, "PR_SME_SET_VL") _S(64, "PR_SME_GET_VL") _S(65, "PR_SET_MDWE") _S(66, "PR_GET_MDWE") _S(67, "PR_SET_MEMORY_MERGE") _S(68, "PR_GET_MEMORY_MERGE") _S(69, "PR_RISCV_V_SET_CONTROL") _S(70, "PR_RISCV_V_GET_CONTROL") audit-4.0.2/auparse/nfprototab.h0000644001034500103450000000205014655201403012270 /* nfprototab.h -- * Copyright 2011-14,2018 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb * Location: include/uapi/linux/netfilter.h */ _S(0, "unspecified" ) _S(1, "inet" ) _S(2, "ipv4" ) _S(3, "arp" ) _S(5, "netdev" ) _S(7, "bridge" ) _S(10, "ipv6" ) _S(12, "decnet" ) audit-4.0.2/auparse/inethooktab.h0000644001034500103450000000201514655201403012422 /* inethooktab.h -- * Copyright 2016 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb * Location: net/netfilter/x_tables.c textify_hooks() */ _S(0, "PREROUTING") _S(1, "INPUT") _S(2, "FORWARD") _S(3, "OUTPUT") _S(4, "POSTROUTING") _S(5, "BROUTING") audit-4.0.2/auparse/ipoptnametab.h0000644001034500103450000000430014655201403012575 /* ipoptnametab.h -- * Copyright 2013,2015,2018,2020 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb * Location: include/uapi/linux/in.h * include/uapi/linux/netfilter_ipv4/ip_tables.h */ _S(1, "IP_TOS") _S(2, "IP_TTL") _S(3, "IP_HDRINCL") _S(4, "IP_OPTIONS") _S(5, "IP_ROUTER_ALERT") _S(6, "IP_RECVOPTS") _S(7, "IP_RETOPTS") _S(8, "IP_PKTINFO") _S(9, "IP_PKTOPTIONS") _S(10, "IP_MTU_DISCOVER") _S(11, "IP_RECVERR") _S(12, "IP_RECVTTL") _S(13, "IP_RECVTOS") _S(14, "IP_MTU") _S(15, "IP_FREEBIND") _S(16, "IP_IPSEC_POLICY") _S(17, "IP_XFRM_POLICY") _S(18, "IP_PASSSEC") _S(19, "IP_TRANSPARENT") _S(20, "IP_ORIGDSTADDR") _S(21, "IP_MINTTL") _S(22, "IP_NODEFRAG") _S(23, "IP_CHECKSUM") _S(24, "IP_BIND_ADDRESS_NO_PORT") _S(25, "IP_RECVFRAGSIZE") _S(32, "IP_MULTICAST_IF") _S(33, "IP_MULTICAST_TTL") _S(34, "IP_MULTICAST_LOOP") _S(35, "IP_ADD_MEMBERSHIP") _S(36, "IP_DROP_MEMBERSHIP") _S(37, "IP_UNBLOCK_SOURCE") _S(38, "IP_BLOCK_SOURCE") _S(39, "IP_ADD_SOURCE_MEMBERSHIP") _S(40, "IP_DROP_SOURCE_MEMBERSHIP") _S(41, "IP_MSFILTER") _S(42, "MCAST_JOIN_GROUP") _S(43, "MCAST_BLOCK_SOURCE") _S(44, "MCAST_UNBLOCK_SOURCE") _S(45, "MCAST_LEAVE_GROUP") _S(46, "MCAST_JOIN_SOURCE_GROUP") _S(47, "MCAST_LEAVE_SOURCE_GROUP") _S(48, "MCAST_MSFILTER") _S(49, "IP_MULTICAST_ALL") _S(50, "IP_UNICAST_IF") _S(51, "IP_LOCAL_PORT_RANGE") _S(52, "IP_PROTOCOL") _S(64, "IPT_SO_SET_REPLACE") _S(65, "IPT_SO_SET_ADD_COUNTERS") _S(66, "IPT_SO_GET_REVISION_TARGET") audit-4.0.2/auparse/auparse-defs.h0000644001034500103450000000772714655201403012511 /* auparse-defs.h -- * Copyright 2006-07,09,2011-12,2014-17,2023 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb */ #ifndef AUPARSE_DEFS_HEADER #define AUPARSE_DEFS_HEADER #include #ifdef __cplusplus extern "C" { #endif /* Library type definitions */ /* This tells the library where the data source is located */ typedef enum { AUSOURCE_LOGS, AUSOURCE_FILE, AUSOURCE_FILE_ARRAY, AUSOURCE_BUFFER, AUSOURCE_BUFFER_ARRAY, AUSOURCE_DESCRIPTOR, AUSOURCE_FILE_POINTER, AUSOURCE_FEED } ausource_t; /* This used to define the types of searches that can be done. It is not used any more. */ typedef enum { AUSEARCH_UNSET, AUSEARCH_EXISTS, AUSEARCH_EQUAL, AUSEARCH_NOT_EQUAL, AUSEARCH_TIME_LT, AUSEARCH_TIME_LE, AUSEARCH_TIME_GE, AUSEARCH_TIME_GT, AUSEARCH_TIME_EQ, AUSEARCH_INTERPRETED = 0x40000000 } ausearch_op_t; /* This determines where to position the cursor when a search completes */ typedef enum { AUSEARCH_STOP_EVENT, AUSEARCH_STOP_RECORD, AUSEARCH_STOP_FIELD } austop_t; /* This defines how search rule pieces are treated to decide when * to stop a search */ typedef enum { AUSEARCH_RULE_CLEAR, AUSEARCH_RULE_OR, AUSEARCH_RULE_AND, AUSEARCH_RULE_REGEX } ausearch_rule_t; typedef struct { time_t sec; // Event seconds unsigned int milli; // millisecond of the timestamp unsigned long serial; // Serial number of the event const char *host; // Machine's name } au_event_t; /* This indicates why the user supplied callback was invoked */ typedef enum {AUPARSE_CB_EVENT_READY} auparse_cb_event_t; /* This determines the type of field at current cursor location * ONLY APPEND - DO NOT DELETE or it will break ABI */ typedef enum { AUPARSE_TYPE_UNCLASSIFIED, AUPARSE_TYPE_UID, AUPARSE_TYPE_GID, AUPARSE_TYPE_SYSCALL, AUPARSE_TYPE_ARCH, AUPARSE_TYPE_EXIT, AUPARSE_TYPE_ESCAPED, AUPARSE_TYPE_PERM, AUPARSE_TYPE_MODE, AUPARSE_TYPE_SOCKADDR, AUPARSE_TYPE_FLAGS, AUPARSE_TYPE_PROMISC, AUPARSE_TYPE_CAPABILITY, AUPARSE_TYPE_SUCCESS, AUPARSE_TYPE_A0, AUPARSE_TYPE_A1, AUPARSE_TYPE_A2, AUPARSE_TYPE_A3, AUPARSE_TYPE_SIGNAL, AUPARSE_TYPE_LIST, AUPARSE_TYPE_TTY_DATA, AUPARSE_TYPE_SESSION, AUPARSE_TYPE_CAP_BITMAP, AUPARSE_TYPE_NFPROTO, AUPARSE_TYPE_ICMPTYPE, AUPARSE_TYPE_PROTOCOL, AUPARSE_TYPE_ADDR, AUPARSE_TYPE_PERSONALITY, AUPARSE_TYPE_SECCOMP, AUPARSE_TYPE_OFLAG, AUPARSE_TYPE_MMAP, AUPARSE_TYPE_MODE_SHORT, AUPARSE_TYPE_MAC_LABEL, AUPARSE_TYPE_PROCTITLE, AUPARSE_TYPE_HOOK, AUPARSE_TYPE_NETACTION, AUPARSE_TYPE_MACPROTO, AUPARSE_TYPE_IOCTL_REQ, AUPARSE_TYPE_ESCAPED_KEY, AUPARSE_TYPE_ESCAPED_FILE, AUPARSE_TYPE_FANOTIFY, AUPARSE_TYPE_NLMCGRP, AUPARSE_TYPE_RESOLVE, AUPARSE_TYPE_TRUST, AUPARSE_TYPE_FAN_TYPE, AUPARSE_TYPE_FAN_INFO, AUPARSE_TYPE_ERRNO } auparse_type_t; /* This type determines what escaping if any gets applied to interpreted fields */ typedef enum { AUPARSE_ESC_RAW, AUPARSE_ESC_TTY, AUPARSE_ESC_SHELL, AUPARSE_ESC_SHELL_QUOTE } auparse_esc_t; /* This type determines what to destroy with the extended destroy function */ typedef enum { AUPARSE_DESTROY_ALL, AUPARSE_DESTROY_COMMON } auparse_destroy_what_t; /* auparse_normalize options */ typedef enum { NORM_OPT_ALL, NORM_OPT_NO_ATTRS} normalize_option_t; #ifdef __cplusplus } #endif #endif audit-4.0.2/auparse/auparse.c0000644001034500103450000014522614655201403011562 /* auparse.c -- * Copyright 2006-08,2012-23 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; see the file COPYING. If not, write to the * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor * Boston, MA 02110-1335, USA. * * Authors: * Steve Grubb */ #include "config.h" #include "expression.h" #include "internal.h" #include "auparse.h" #include "interpret.h" #include "auparse-idata.h" #include "libaudit.h" #include #include #include #include #include #include #include #include "common.h" //#define LOL_EVENTS_DEBUG01 1 // add debug for list of list event // processing #ifdef LOL_EVENTS_DEBUG01 static int debug = 0; #endif static time_t eoe_timeout = EOE_TIMEOUT; static void init_lib(void) __attribute__ ((constructor)); static void init_lib(void) { init_interpretation_list(); } /* like strchr except string is delimited by length, not null byte */ static char *strnchr(const char *s, int c, size_t n) { char *p_char; const char *p_end = s + n; for (p_char = (char *)s; p_char < p_end && *p_char != c; p_char++); if (p_char == p_end) return NULL; return p_char; } static int access_ok(const char *filename) { int rc = access(filename, R_OK); if (rc == 0) return rc; #ifdef HAVE_FACCESSAT // If we have faccessat, let's try effective ids. return faccessat(AT_FDCWD, filename, R_OK, AT_EACCESS); #else // If we don't, return what we have from access() return rc; #endif } static int setup_log_file_array(auparse_state_t *au) { struct daemon_conf config; char *filename, **tmp; int len, num = 0, i = 0; /* Load config so we know where logs are */ if (secure_getenv("AUPARSE_DEBUG")) set_aumessage_mode(au, MSG_STDERR, DBG_NO); aup_load_config(au, &config, TEST_SEARCH); /* for each file */ len = strlen(config.log_file) + 16; filename = malloc(len); if (!filename) { fprintf(stderr, "No memory\n"); aup_free_config(&config); return 1; } /* Find oldest log file */ snprintf(filename, len, "%s", config.log_file); do { if (access_ok(filename) != 0) break; num++; snprintf(filename, len, "%s.%d", config.log_file, num); } while (1); if (num == 0) { fprintf(stderr, "No log file\n"); aup_free_config(&config); free(filename); return 1; } num--; tmp = malloc((num+2)*sizeof(char *)); if (!tmp) { fprintf(stderr, "Out of memory. Check %s file, %d line", __FILE__, __LINE__); aup_free_config(&config); free(filename); return 1; } /* Got it, now process logs from last to first */ if (num > 0) snprintf(filename, len, "%s.%d", config.log_file, num); else snprintf(filename, len, "%s", config.log_file); do { tmp[i++] = strdup(filename); /* Get next log file */ num--; if (num > 0) snprintf(filename, len, "%s.%d", config.log_file, num); else if (num == 0) snprintf(filename, len, "%s", config.log_file); else break; } while (1); aup_free_config(&config); free(filename); // Terminate the list tmp[i] = NULL; au->source_list = tmp; return 0; } /* * au_lol_create - Create and initialise the base List of List event structure * Args: * lol - pointer to memory holding structure (eg the static au_lo variable) * Rtns: * NULL - no memory * ptr - pointer to array of event nodes (au_lolnode) */ static au_lolnode *au_lol_create(au_lol *lol) { int sz = ARRAY_LIMIT * sizeof(au_lolnode); lol->maxi = -1; if ((lol->array = (au_lolnode *)malloc(sz)) == NULL) return NULL; lol->limit = ARRAY_LIMIT; memset(lol->array, 0x00, sz); return lol->array; } /* * au_lol_clear - Free or rest the base List of List event structure * * Args: * lol - pointer to memory holding structure (eg the static au_lo variable) * reset - flag to indicate a reset of the structure, or the complete * freeing of memory * Rtns: * void */ static void au_lol_clear(au_lol *lol, int reset) { int i; if (lol->array) { for (i = 0; i <= lol->maxi; i++) { if (lol->array[i].l) { aup_list_clear(lol->array[i].l); free(lol->array[i].l); } } } if (reset) { /* If resetting, we just zero fields */ if (lol->array) memset(lol->array, 0x00, lol->limit * sizeof(au_lolnode)); lol->maxi = -1; } else { /* If not resetting, we free everything */ if (lol->array) free(lol->array); lol->array = NULL; lol->maxi = -1; } } /* * au_lol_append - Add a new event to our base List of List structure * * Args: * lol - pointer to memory holding structure (eg the static au_lo variable) * l - event list structure (which contains an event's constituent records) * Rtns: * ptr - pointer to au_lolnode which holds the event list structure * NULL - failed to reallocate memory */ static au_lolnode *au_lol_append(au_lol *lol, event_list_t *l) { int i; size_t new_size; au_lolnode *ptr; for (i = 0; i < lol->limit; i++) { au_lolnode *cur = &lol->array[i]; if (cur->status == EBS_EMPTY) { cur->l = l; cur->status = EBS_BUILDING; if (i > lol->maxi) lol->maxi = i; return cur; } } /* Over ran the array, make it bigger */ new_size = sizeof(au_lolnode) * (lol->limit + ARRAY_LIMIT); ptr = realloc(lol->array, new_size); if (ptr) { lol->array = ptr; memset(&lol->array[lol->limit], 0x00, sizeof(au_lolnode) * ARRAY_LIMIT); lol->array[i].l = l; lol->array[i].status = EBS_BUILDING; lol->maxi = i; lol->limit += ARRAY_LIMIT; } return ptr; } /* * au_get_ready_event - Find the next COMPLETE event in our list and mark EMPTY * * Args: * lol - pointer to memory holding structure (eg the static au_lo variable) * is_test - do not mark the node EMPTY * Rtns: * ptr - pointer to complete node (possibly just marked empty) * NULL - no complete nodes exist */ static event_list_t *au_get_ready_event(auparse_state_t *au, int is_test) { int i; au_lol *lol = au->au_lo; au_lolnode *lowest = NULL; if (au->au_ready == 0) { //if (debug) printf("No events ready\n"); return NULL; } for (i=0; i<=lol->maxi; i++) { // Look for the event with the lowest timestamp au_lolnode *cur = &(lol->array[i]); if (cur->status == EBS_EMPTY) continue; // If we are just testing for a complete event, return if (is_test && cur->status == EBS_COMPLETE) return cur->l; if (lowest == NULL) lowest = cur; else if (auparse_timestamp_compare(&(lowest->l->e), &(cur->l->e)) == 1) lowest = cur; } if (lowest && lowest->status == EBS_COMPLETE) { lowest->status = EBS_EMPTY; au->au_ready--; return lowest->l; } return NULL; } /* * au_check_events - Run though all events marking those we can mark COMPLETE * * Args: * lol - pointer to memory holding structure (eg the static au_lo variable) * sec - time of current event from stream being processed. We use this to see * how old the events are we have in our list * Rtns: * void */ static void au_check_events(auparse_state_t *au, time_t sec) { rnode *r; int i; au_lol *lol = au->au_lo; for(i=0; i<=lol->maxi; i++) { au_lolnode *cur = &lol->array[i]; if (cur->status == EBS_BUILDING) { if ((r = aup_list_get_cur(cur->l)) == NULL) continue; // If eoe_timeout seconds have elapsed, we are done if (cur->l->e.sec + eoe_timeout <= sec) { cur->status = EBS_COMPLETE; au->au_ready++; } else if (audit_is_last_record(r->type)) { // If known to be 1 record event, we are done cur->status = EBS_COMPLETE; au->au_ready++; } } } } /* * au_terminate_all_events - Mark all events in 'BUILD' state to be COMPLETE * * Args: * lol - pointer to memory holding structure (eg the static au_lo variable) * Rtns: * void */ static void au_terminate_all_events(auparse_state_t *au) { int i; au_lol *lol = au->au_lo; for (i=0; i<=lol->maxi; i++) { au_lolnode *cur = &lol->array[i]; if (cur->status == EBS_BUILDING) { cur->status = EBS_COMPLETE; au->au_ready++; //if (debug) printf("%d events complete\n", au->au_ready); } } } #ifdef LOL_EVENTS_DEBUG01 /* * print_list_t - Print summary of event's records * Args: * l - event_list to print * Rtns: * void */ void print_list_t(event_list_t *l) { rnode *r; if (l == NULL) { printf("\n"); return; } printf("0x%p: %ld.%3.3u:%lu %s", l, l->e.sec, l->e.milli, l->e.serial, l->e.host ? l->e.host : ""); printf(" cnt=%u", l->cnt); for (r = l->head; r != NULL; r = r->next) { printf(" {%d %d %u}", r->type, r->list_idx, r->line_number); } printf("\n"); } /* * lol_status - return type of event state as a character * Args: * s - event state * Rtns: * char - E, B or C for EMPTY, BUILDING or COMPLETE, or '*' for unknown */ static char lol_status(au_lol_t s) { switch(s) { case EBS_EMPTY: return 'E'; break; case EBS_BUILDING: return 'B'; break; case EBS_COMPLETE: return 'C'; break; } return '*'; } /* * print_lol - Print a list of list events and their records * Args: * label - String to act as label when printing * lol - pointer to memory holding structure (eg the static au_lo variable) * Rtns: * void */ void print_lol(char *label, au_lol *lol) { int i; printf("%s 0x%p: a: 0x%p, %d, %d\n", label, lol, lol->array, lol->maxi, lol->limit); if (debug > 1) for (i = 0; i <= lol->maxi; i++) { printf("{%2d 0x%p %c } ", i, (&lol->array[i]), lol_status(lol->array[i].status)); print_list_t(lol->array[i].l); } if (lol->maxi >= 0) printf("\n"); } #endif /* LOL_EVENTS_DEBUG01 */ /* General functions that affect operation of the library */ /* * au_setup_userspace_configitems - load userspace configuration items from auditd.conf * * Args: * au - pointer to auparseing state structure * * Rtns: * void */ static void au_setup_userspace_configitems(auparse_state_t *au) { struct daemon_conf config; /* Load config so we know where logs are */ if (secure_getenv("AUPARSE_DEBUG")) set_aumessage_mode(au, MSG_STDERR, DBG_NO); aup_load_config(au, &config, TEST_SEARCH); eoe_timeout = (time_t)config.end_of_event_timeout; aup_free_config(&config); } auparse_state_t *auparse_init(ausource_t source, const void *b) { char **tmp, **bb = (char **)b, *buf = (char *)b; int n, i; size_t size, len; auparse_state_t *au = malloc(sizeof(auparse_state_t)); if (au == NULL) { errno = ENOMEM; return NULL; } au->le = NULL; /* * Set up the List of List events base structure */ au->au_lo = calloc(sizeof(au_lol), 1); if (au->au_lo == NULL) { free(au); errno = ENOMEM; return NULL; } au_lol_clear(au->au_lo, 0); // python doesn't call auparse_destroy if (au_lol_create(au->au_lo) == NULL) { free(au->au_lo); free(au); errno = ENOMEM; return NULL; } au->au_ready = 0; au->escape_mode = AUPARSE_ESC_TTY; au->message_mode = MSG_QUIET; au->debug_message = DBG_NO; au->in = NULL; au->source_list = NULL; databuf_init(&au->databuf, 0, 0); au->callback = NULL; au->callback_user_data = NULL; au->callback_user_data_destroy = NULL; au_setup_userspace_configitems(au); switch (source) { case AUSOURCE_LOGS: if (setup_log_file_array(au)) goto bad_exit; break; case AUSOURCE_FILE: if (b == NULL) goto bad_exit; if (access_ok(b)) goto bad_exit; tmp = malloc(2*sizeof(char *)); if (tmp == NULL) goto bad_exit; tmp[0] = strdup(b); tmp[1] = NULL; au->source_list = tmp; break; case AUSOURCE_FILE_ARRAY: if (bb == NULL) goto bad_exit; n = 0; while (bb[n]) { if (access_ok(bb[n])) goto bad_exit; n++; } tmp = malloc((n+1)*sizeof(char *)); for (i=0; isource_list = tmp; break; case AUSOURCE_BUFFER: if (buf == NULL) goto bad_exit; len = strlen(buf); if (databuf_init(&au->databuf, len, DATABUF_FLAG_PRESERVE_HEAD) < 0) goto bad_exit; if (databuf_append(&au->databuf, buf, len) < 0) goto bad_exit; break; case AUSOURCE_BUFFER_ARRAY: if (bb == NULL) goto bad_exit; size = 0; for (n = 0; (buf = bb[n]); n++) { len = strlen(bb[n]); if (bb[n][len-1] != '\n') { size += len + 1; } else { size += len; } } if (databuf_init(&au->databuf, size, DATABUF_FLAG_PRESERVE_HEAD) < 0) goto bad_exit; for (n = 0; (buf = bb[n]); n++) { len = strlen(buf); if (databuf_append(&au->databuf, buf, len) < 0) goto bad_exit; } break; case AUSOURCE_DESCRIPTOR: n = (long)b; au->in = fdopen(n, "rm"); break; case AUSOURCE_FILE_POINTER: au->in = (FILE *)b; break; case AUSOURCE_FEED: if (databuf_init(&au->databuf, 0, 0) < 0) goto bad_exit; break; default: errno = EINVAL; goto bad_exit; break; } au->source = source; au->list_idx = 0; au->line_number = 0; au->next_buf = NULL; au->off = 0; au->cur_buf = NULL; au->line_pushed = 0; au->parse_state = EVENT_EMPTY; au->expr = NULL; au->find_field = NULL; au->search_where = AUSEARCH_STOP_EVENT; au->tmp_translation = NULL; init_normalizer(&au->norm_data); return au; bad_exit: databuf_free(&au->databuf); /* Free list of events list (au_lo) structure */ au_lol_clear(au->au_lo, 0); free(au->au_lo); free(au); return NULL; } void auparse_add_callback(auparse_state_t *au, auparse_callback_ptr callback, void *user_data, user_destroy user_destroy_func) { if (au == NULL) { errno = EINVAL; return; } if (au->callback_user_data_destroy) { (*au->callback_user_data_destroy)(au->callback_user_data); au->callback_user_data = NULL; } au->callback = callback; au->callback_user_data = user_data; au->callback_user_data_destroy = user_destroy_func; } static void consume_feed(auparse_state_t *au, int flush) { //if (debug) printf("consume feed, flush %d\n", flush); while (auparse_next_event(au) > 0) { if (au->callback) { (*au->callback)(au, AUPARSE_CB_EVENT_READY, au->callback_user_data); } } if (flush) { // FIXME: might need a call here to force auparse_next_event() // to consume any partial data not fully consumed. /* Terminate all outstanding events, as we are at end of input * (ie mark BUILDING events as COMPLETE events) then if we * have a callback execute the callback on each event * FIXME: Should we implement a 'checkpoint' concept as per * ausearch or accept these 'partial' events? */ event_list_t *l; //if (debug) printf("terminate all events in flush\n"); au_terminate_all_events(au); while ((l = au_get_ready_event(au, 0)) != NULL) { rnode *r; au->le = l; // make this current the event of interest aup_list_first(l); r = aup_list_get_cur(l); free_interpretation_list(); load_interpretation_list(r->interp); aup_list_first_field(l); if (au->callback) { (*au->callback)(au, AUPARSE_CB_EVENT_READY, au->callback_user_data); } } } } int auparse_new_buffer(auparse_state_t *au, const char *data, size_t data_len) { if (au->source != AUSOURCE_BUFFER) return 1; auparse_reset(au); if (databuf_replace(&au->databuf, data, data_len) < 0) return 1; return 0; } int auparse_feed(auparse_state_t *au, const char *data, size_t data_len) { if (databuf_append(&au->databuf, data, data_len) < 0) return -1; consume_feed(au, 0); return 0; } int auparse_flush_feed(auparse_state_t *au) { consume_feed(au, 1); return 0; } // If there is any data in the state machine, return 1. // Otherwise return 0 to indicate its empty int auparse_feed_has_data(const auparse_state_t *au) { if (!au) return 0; int i; au_lol *lol = au->au_lo; // An improvement would be to track how many events we have stored // to avoid a costly loop for (i=0; i <= lol->maxi; i++) { au_lolnode *cur = &(lol->array[i]); if (cur->status > EBS_EMPTY) return 1; } return 0; } // If there is a ready event in the state machine, return 1. // Otherwise return 0 to indicate its empty int auparse_feed_has_ready_event(auparse_state_t *au) { if (au_get_ready_event(au, 1) != NULL) return 1; return 0; } void auparse_feed_age_events(auparse_state_t *au) { time_t t = time(NULL); au_check_events(au, t); consume_feed(au, 0); } void auparse_set_escape_mode(auparse_state_t *au, auparse_esc_t mode) { if (au == NULL) return; au->escape_mode = mode; } /* * Non-public function. Subject to change. * buf is a string of name value pairs to be used for interpreting. * Calling this function automatically releases the previous list. */ void _auparse_load_interpretations(const char *buf) { free_interpretation_list(); if (buf == NULL) return; load_interpretation_list(buf); } /* * Non-public function. Subject to change. */ void _auparse_free_interpretations(void) { free_interpretation_list(); } int auparse_reset(auparse_state_t *au) { if (au == NULL) { errno = EINVAL; return -1; } /* Create or Free list of events list (au_lo) structure */ if (au->au_lo->array == NULL) au_lol_create(au->au_lo); else au_lol_clear(au->au_lo, 1); au->parse_state = EVENT_EMPTY; au->au_ready = 0; au->le = NULL; switch (au->source) { case AUSOURCE_LOGS: case AUSOURCE_FILE: case AUSOURCE_FILE_ARRAY: if (au->in) { fclose(au->in); au->in = NULL; } /* Fall through */ case AUSOURCE_DESCRIPTOR: case AUSOURCE_FILE_POINTER: if (au->in) rewind(au->in); /* Fall through */ case AUSOURCE_BUFFER: case AUSOURCE_BUFFER_ARRAY: au->list_idx = 0; au->line_number = 0; au->off = 0; databuf_reset(&au->databuf); break; default: return -1; } free_interpretation_list(); return 0; } char *auparse_metrics(const auparse_state_t *au) { char *metrics; unsigned int uid, gid; aulookup_metrics(&uid, &gid); if (asprintf(&metrics, "max lol available: %lu\n" "max lol used: %d\n" "pending lol: %d\n" "uid cache size: %u\n" "gid cache size: %u", au->au_lo->limit, au->au_lo->maxi, au->au_ready, uid, gid) < 0) metrics = NULL; return metrics; } /* Add EXPR to AU, using HOW to select the combining operator. On success, return 0. On error, free EXPR set errno and return -1. NOTE: EXPR is freed on error! */ static int add_expr(auparse_state_t *au, struct expr *expr, ausearch_rule_t how) { if (au->expr == NULL) au->expr = expr; else if (how == AUSEARCH_RULE_CLEAR) { expr_free(au->expr); au->expr = expr; } else { struct expr *e; e = expr_create_binary(how == AUSEARCH_RULE_OR ? EO_OR : EO_AND, au->expr, expr); if (e == NULL) { int err; err = errno; expr_free(expr); errno = err; return -1; } au->expr = e; } au->expr->started = 0; return 0; } static int ausearch_add_item_internal(auparse_state_t *au, const char *field, const char *op, const char *value, ausearch_rule_t how, unsigned op_eq, unsigned op_ne) { struct expr *expr; // Make sure there's a field if (field == NULL) goto err_out; // Make sure how is within range if (how < AUSEARCH_RULE_CLEAR || how > AUSEARCH_RULE_AND) goto err_out; // All pre-checks are done, build a rule if (strcmp(op, "exists") == 0) expr = expr_create_field_exists(field); else { unsigned t_op; if (strcmp(op, "=") == 0) t_op = op_eq; else if (strcmp(op, "!=") == 0) t_op = op_ne; else goto err_out; if (value == NULL) goto err_out; expr = expr_create_comparison(field, t_op, value); } if (expr == NULL) return -1; if (add_expr(au, expr, how) != 0) return -1; /* expr is freed by add_expr() */ return 0; err_out: errno = EINVAL; return -1; } int ausearch_add_item(auparse_state_t *au, const char *field, const char *op, const char *value, ausearch_rule_t how) { return ausearch_add_item_internal(au, field, op, value, how, EO_RAW_EQ, EO_RAW_NE); } int ausearch_add_interpreted_item(auparse_state_t *au, const char *field, const char *op, const char *value, ausearch_rule_t how) { return ausearch_add_item_internal(au, field, op, value, how, EO_INTERPRETED_EQ, EO_INTERPRETED_NE); } int ausearch_add_timestamp_item_ex(auparse_state_t *au, const char *op, time_t sec, unsigned milli, unsigned serial, ausearch_rule_t how) { static const struct { unsigned value; const char name[3]; } ts_tab[] = { {EO_VALUE_LT, "<"}, {EO_VALUE_LE, "<="}, {EO_VALUE_GE, ">="}, {EO_VALUE_GT, ">"}, {EO_VALUE_EQ, "="}, }; struct expr *expr; size_t i; unsigned t_op; for (i = 0; i < sizeof(ts_tab) / sizeof(*ts_tab); i++) { if (strcmp(ts_tab[i].name, op) == 0) goto found_op; } goto err_out; found_op: t_op = ts_tab[i].value; if (milli >= 1000) goto err_out; // Make sure how is within range if (how < AUSEARCH_RULE_CLEAR || how > AUSEARCH_RULE_AND) goto err_out; // All pre-checks are done, build a rule expr = expr_create_timestamp_comparison_ex(t_op, sec, milli, serial); if (expr == NULL) return -1; if (add_expr(au, expr, how) != 0) return -1; /* expr is freed by add_expr() */ return 0; err_out: errno = EINVAL; return -1; } int ausearch_add_timestamp_item(auparse_state_t *au, const char *op, time_t sec, unsigned milli, ausearch_rule_t how) { return ausearch_add_timestamp_item_ex(au, op, sec, milli, 0, how); } int ausearch_add_expression(auparse_state_t *au, const char *expression, char **error, ausearch_rule_t how) { struct expr *expr; if (how < AUSEARCH_RULE_CLEAR || how > AUSEARCH_RULE_AND) goto err_einval; expr = expr_parse(expression, error); if (expr == NULL) { errno = EINVAL; return -1; } if (add_expr(au, expr, how) != 0) goto err; /* expr is freed by add_expr() */ return 0; err_einval: errno = EINVAL; err: *error = NULL; return -1; } int ausearch_add_regex(auparse_state_t *au, const char *regexp) { struct expr *expr; // Make sure there's an expression if (regexp == NULL) goto err_out; expr = expr_create_regexp_expression(regexp); if (expr == NULL) return -1; if (add_expr(au, expr, AUSEARCH_RULE_AND) != 0) return -1; /* expr is freed by add_expr() */ return 0; err_out: errno = EINVAL; return -1; } int ausearch_set_stop(auparse_state_t *au, austop_t where) { if (where < AUSEARCH_STOP_EVENT || where > AUSEARCH_STOP_FIELD) { errno = EINVAL; return -1; } au->search_where = where; return 0; } void ausearch_clear(auparse_state_t *au) { if (au->expr != NULL) { expr_free(au->expr); au->expr = NULL; } au->search_where = AUSEARCH_STOP_EVENT; } static void auparse_destroy_common(auparse_state_t *au) { if (au == NULL) return; if (au->source_list) { int n = 0; while (au->source_list[n]) free(au->source_list[n++]); free(au->source_list); au->source_list = NULL; } au->next_buf = NULL; free(au->cur_buf); au->cur_buf = NULL; au->le = NULL; au->parse_state = EVENT_EMPTY; free(au->find_field); au->find_field = NULL; ausearch_clear(au); databuf_free(&au->databuf); if (au->callback_user_data_destroy) { (*au->callback_user_data_destroy)(au->callback_user_data); au->callback_user_data = NULL; } if (au->in) { fclose(au->in); au->in = NULL; } free_interpretation_list(); clear_normalizer(&au->norm_data); au_lol_clear(au->au_lo, 0); free((void *)au->tmp_translation); free(au->au_lo); free(au); } void auparse_destroy(auparse_state_t *au) { aulookup_destroy_uid_list(); aulookup_destroy_gid_list(); auparse_destroy_common(au); } void auparse_destroy_ext(auparse_state_t *au, auparse_destroy_what_t what) { if (what == AUPARSE_DESTROY_COMMON) auparse_destroy_common(au); else if (what == AUPARSE_DESTROY_ALL) auparse_destroy(au); return; } /* alloc a new buffer, cur_buf which contains a null terminated line * without a newline (note, this implies the line may be empty (strlen == 0)) if * successfully read a blank line (e.g. containing only a single newline). * cur_buf will have been newly allocated with malloc. * * Note: cur_buf will be freed the next time this routine is called if * cur_buf is not NULL, callers who retain a reference to the cur_buf * pointer will need to set cur_buf to NULL to cause the previous cur_buf * allocation to persist. * * Returns: * 1 if successful (errno == 0) * 0 if non-blocking input unavailable (errno == 0) * -1 if error (errno contains non-zero error code) * -2 if EOF (errno == 0) */ static int readline_file(auparse_state_t *au) { ssize_t rc; char *p_last_char; size_t n = 0; if (au->cur_buf != NULL) { free(au->cur_buf); au->cur_buf = NULL; } if (au->in == NULL) { errno = EBADF; return -1; } if ((rc = getline(&au->cur_buf, &n, au->in)) <= 0) { // Note: getline always malloc's if lineptr==NULL or n==0, // on failure malloc'ed memory is left uninitialized, // caller must free it. free(au->cur_buf); au->cur_buf = NULL; // Note: feof() does not set errno if (feof(au->in)) { // return EOF condition errno = 0; return -2; } // return error condition, error code in errno return -1; } p_last_char = au->cur_buf + (rc-1); if (*p_last_char == '\n') { /* nuke newline */ *p_last_char = 0; } // return success errno = 0; return 1; } /* malloc & copy a line into cur_buf from the internal buffer, * next_buf. cur_buf will contain a null terminated line without a * newline (note, this implies the line may be empty (strlen == 0)) if * successfully read a blank line (e.g. containing only a single * newline). * * Note: cur_buf will be freed the next time this routine is called if * cur_buf is not NULL, callers who retain a reference to the cur_buf * pointer will need to set cur_buf to NULL to cause the previous cur_buf * allocation to persist. * * Returns: * 1 if successful (errno == 0) * 0 if non-blocking input unavailable (errno == 0) * -1 if error (errno contains non-zero error code) * -2 if EOF (errno == 0) */ static int readline_buf(auparse_state_t *au) { char *p_newline=NULL; size_t line_len; if (au->cur_buf != NULL) { free(au->cur_buf); au->cur_buf = NULL; } //if (debug) databuf_print(&au->databuf, 1, "readline_buf"); if (au->databuf.len == 0) { // return EOF condition errno = 0; return -2; } if ((p_newline = strnchr(databuf_beg(&au->databuf), '\n', au->databuf.len)) != NULL) { line_len = p_newline - databuf_beg(&au->databuf); /* dup the line */ au->cur_buf = malloc(line_len+1); // +1 for null terminator if (au->cur_buf == NULL) return -1; // return error condition, errno set strncpy(au->cur_buf, databuf_beg(&au->databuf), line_len); au->cur_buf[line_len] = 0; if (databuf_advance(&au->databuf, line_len+1) < 0) return -1; // return success errno = 0; return 1; } else { // return no data available errno = 0; return 0; } } static int str2event(char *s, au_event_t *e) { char *ptr; errno = 0; e->sec = strtoul(s, NULL, 10); if (errno || e->sec > (LONG_MAX - eoe_timeout -1)) return -1; ptr = strchr(s, '.'); if (ptr) { ptr++; e->milli = strtoul(ptr, NULL, 10); if (errno || e->milli > 999) return -1; s = ptr; } else e->milli = 0; ptr = strchr(s, ':'); if (ptr) { ptr++; e->serial = strtoul(ptr, NULL, 10); if (errno) return -1; } else e->serial = 0; return 0; } #ifndef HAVE_STRNDUPA #define strndupa(s, n) \ ({ \ const char *__old = (s); \ size_t __len = strnlen (__old, (n)); \ char *__new = (char *) alloca(__len + 1); \ __new[__len] = '\0'; \ (char *) memcpy (__new, __old, __len); \ }) #endif /* Returns 0 on success and 1 on error */ static int extract_timestamp(const char *b, au_event_t *e) { char *ptr, *tmp; int rc = 1; e->host = NULL; if (*b == 'n') tmp = strndupa(b, 340); else tmp = strndupa(b, 80); ptr = audit_strsplit(tmp); if (ptr) { // Optionally grab the node - may or may not be included if (*ptr == 'n' && strnlen(ptr, 8) > 5) { e->host = strdup(ptr+5); (void)audit_strsplit(NULL);// Bump along to next one } // at this point we have type= ptr = audit_strsplit(NULL); // strlen is for fuzzers that make invalid lines if (ptr && strnlen(ptr, 20) > 18) { if (*(ptr+9) == '(') ptr+=9; else ptr = strchr(ptr, '('); if (ptr) { // now we should be pointed at the timestamp char *eptr; ptr++; eptr = strchr(ptr, ')'); if (eptr) *eptr = 0; if (str2event(ptr, e) == 0) rc = 0; } // else we have a bad line } // else we have a bad line } if (rc) free((void *)e->host); // else we have a bad line return rc; } static int events_are_equal(const au_event_t *e1, const au_event_t *e2) { // Check time & serial first since its most likely way // to spot 2 different events if (!(e1->serial == e2->serial && e1->milli == e2->milli && e1->sec == e2->sec)) return 0; // Hmm...same so far, check if both have a host, only a string // compare can tell if they are the same. Otherwise, if only one // of them have a host, they are definitely not the same. Its // a boundary on daemon config. if (e1->host && e2->host) { if (strcmp(e1->host, e2->host)) return 0; } else if (e1->host || e2->host) return 0; return 1; } /* This function will figure out how to get the next line of input. * storing it cur_buf. cur_buf will be NULL terminated but will not * contain a trailing newline. This implies a successful read * (result == 1) may result in a zero length cur_buf if a blank line * was read. * * cur_buf will have been allocated with malloc. The next time this * routine is called if cur_buf is non-NULL cur_buf will be freed, * thus if the caller wishes to retain a reference to malloc'ed * cur_buf data it should copy the cur_buf pointer and set cur_buf to * NULL. * * Returns: * 1 if successful (errno == 0) * 0 if non-blocking input unavailable (errno == 0) * -1 if error (errno contains non-zero error code) * -2 if EOF (errno == 0) */ static int retrieve_next_line(auparse_state_t *au) { int rc; // If line was pushed back for re-reading return that if (au->line_pushed) { // Starting new event, clear previous event data, // previous line is returned again for new parsing au->line_pushed = 0; au->line_number++; return 1; } switch (au->source) { case AUSOURCE_DESCRIPTOR: case AUSOURCE_FILE_POINTER: rc = readline_file(au); if (rc > 0) au->line_number++; return rc; case AUSOURCE_LOGS: case AUSOURCE_FILE: case AUSOURCE_FILE_ARRAY: // if the first time through, open file if (au->list_idx == 0 && au->in == NULL && au->source_list != NULL) { if (au->source_list[au->list_idx] == NULL) { errno = 0; return -2; } au->line_number = 0; au->in = fopen(au->source_list[au->list_idx], "rm"); if (au->in == NULL) return -1; __fsetlocking(au->in, FSETLOCKING_BYCALLER); } // loop reading lines from a file while (au->in) { if ((rc = readline_file(au)) == -2) { // end of file, open next file, // try readline again fclose(au->in); au->in = NULL; au->list_idx++; au->line_number = 0; if (au->source_list[au->list_idx]) { au->in = fopen( au->source_list[au->list_idx], "rm"); if (au->in == NULL) return -1; __fsetlocking(au->in, FSETLOCKING_BYCALLER); } } else { if (rc > 0) au->line_number++; return rc; } } return -2; // return EOF case AUSOURCE_BUFFER: case AUSOURCE_BUFFER_ARRAY: rc = readline_buf(au); if (rc > 0) au->line_number++; return rc; case AUSOURCE_FEED: rc = readline_buf(au); // No such thing as EOF for feed, translate EOF // to data not available if (rc == -2) return 0; else if (rc > 0) au->line_number++; return rc; default: return -1; } return -1; /* should never reach here */ } /******* * Functions that traverse events. ********/ static int ausearch_reposition_cursors(const auparse_state_t *au) { int rc = 0; switch (au->search_where) { case AUSEARCH_STOP_EVENT: aup_list_first(au->le); aup_list_first_field(au->le); break; case AUSEARCH_STOP_RECORD: aup_list_first_field(au->le); break; case AUSEARCH_STOP_FIELD: // do nothing - this is the normal stopping point break; default: rc = -1; break; } return rc; } /* This is called during search once per each record. It walks the list * of nvpairs and decides if a field matches. */ static int ausearch_compare(auparse_state_t *au) { rnode *r; if (au->le == NULL) return 0; r = aup_list_get_cur(au->le); if (r) { int res = expr_eval(au, r, au->expr); return res; } return 0; } // Returns < 0 on error, 0 no data, > 0 success int ausearch_cur_event(auparse_state_t* au) { int rc, records; if (au->expr == NULL) { errno = EINVAL; return -1; } records = auparse_get_num_records(au); for (int i = 0; i < records; i++) { if (auparse_goto_record_num(au, i) != 1) return -1; if ((rc = ausearch_compare(au)) > 0) { ausearch_reposition_cursors(au); return 1; } else if (rc < 0) return rc; } return 0; } // Returns < 0 on error, 0 no data, > 0 success int ausearch_next_event(auparse_state_t *au) { int rc; if (au->expr == NULL) { errno = EINVAL; return -1; } if (au->expr->started == 0) { if ((rc = auparse_first_record(au)) <= 0) return rc; au->expr->started = 1; } else { if ((rc = auparse_next_event(au)) <= 0) return rc; } do { do { if ((rc = ausearch_compare(au)) > 0) { ausearch_reposition_cursors(au); return 1; } else if (rc < 0) return rc; } while ((rc = auparse_next_record(au)) > 0); if (rc < 0) return rc; } while ((rc = auparse_next_event(au)) > 0); if (rc < 0) return rc; return 0; } /* * au_auparse_next_event - Get the next complete event * Args: * au - the parser state machine * Rtns: * < 0 - error * == 0 - no data * > 0 - we have an event and it's set to the 'current event' au->le */ static int au_auparse_next_event(auparse_state_t *au) { int rc, i, built; event_list_t *l; au_event_t e; /* * Deal with Python memory management issues where it issues a * auparse_destroy() call after an auparse_init() call but then wants * to still work with auparse data. Basically, we assume if the user * wants to parse for events (calling auparse_next_event()) we accept * that they expect the memory structures to exist. This is a bit * 'disconcerting' but the au_lol capability is a patch trying to * redress a singleton approach to event processing. */ if (au->au_lo->array == NULL && au->au_lo->maxi == -1) { #ifdef LOL_EVENTS_DEBUG01 if (debug) printf("Creating lol array\n"); #endif /* LOL_EVENTS_DEBUG01 */ au_lol_create(au->au_lo); } /* * First see if we have any empty events but with an allocated event * list. These would have just been processed, so we can free them */ for (i = 0; i <= au->au_lo->maxi; i++) { au_lolnode *cur = &au->au_lo->array[i]; if (cur->status == EBS_EMPTY && cur->l) { #ifdef LOL_EVENTS_DEBUG01 if (debug) { printf("Freeing at start "); print_list_t(cur->l); } #endif /* LOL_EVENTS_DEBUG01 */ aup_list_clear(cur->l); free(cur->l); au->le = NULL; // this should crash any usage // of au->le until reset cur->l = NULL; } } /* * Now see if we have completed events queued, and if so grab the * first one and set it to be the 'current' event of interest */ if ((l = au_get_ready_event(au, 0)) != NULL) { rnode *r; aup_list_first(l); r = aup_list_get_cur(l); free_interpretation_list(); load_interpretation_list(r->interp); aup_list_first_field(l); au->le = l; #ifdef LOL_EVENTS_DEBUG01 if (debug) print_lol("upfront", au->au_lo); #endif /* LOL_EVENTS_DEBUG01 */ return 1; } /* * If no complete events are available, lets ingest */ while (1) { for (i = 0; i <= au->au_lo->maxi; i++) { au_lolnode *cur = &au->au_lo->array[i]; if (cur->status == EBS_EMPTY && cur->l) { #ifdef LOL_EVENTS_DEBUG01 if (debug) { printf("Freeing at loop"); print_list_t(cur->l); } #endif /* LOL_EVENTS_DEBUG01 */ aup_list_clear(cur->l); free(cur->l); au->le = NULL; /* this should crash any usage of au->le until reset */ cur->l = NULL; } } rc = retrieve_next_line(au); #ifdef LOL_EVENTS_DEBUG01 if (debug) printf("next_line(%d) '%s'\n", rc, au->cur_buf); #endif /* LOL_EVENTS_DEBUG01 */ if (rc == 0) { #ifdef LOL_EVENTS_DEBUG01 if (debug) printf("Empty line\n"); #endif /* LOL_EVENTS_DEBUG01 */ return 0; /* NO data now */ } if (rc == -2) { /* * We are at EOF, so see if we have any accumulated * events. */ #ifdef LOL_EVENTS_DEBUG01 if (debug) printf("EOF\n"); #endif /* LOL_EVENTS_DEBUG01 */ au_terminate_all_events(au); if ((l = au_get_ready_event(au, 0)) != NULL) { rnode *r; aup_list_first(l); r = aup_list_get_cur(l); free_interpretation_list(); load_interpretation_list(r->interp); aup_list_first_field(l); au->le = l; #ifdef LOL_EVENTS_DEBUG01 if (debug) print_lol("eof termination", au->au_lo); #endif /* LOL_EVENTS_DEBUG01 */ return 1; } return 0; } else if (rc < 0) { #ifdef LOL_EVENTS_DEBUG01 /* Straight error */ if (debug) printf("Error %d\n", rc); #endif /* LOL_EVENTS_DEBUG01 */ return -1; } /* So we got a successful read ie rc > 0 */ if (extract_timestamp(au->cur_buf, &e)) { #ifdef LOL_EVENTS_DEBUG01 if (debug) printf("Malformed line:%s\n", au->cur_buf); #endif /* LOL_EVENTS_DEBUG01 */ continue; } /* * Is this an event we have already been building? */ built = 0; for (i = 0; i <= au->au_lo->maxi; i++) { au_lolnode *cur = &au->au_lo->array[i]; if (cur->status == EBS_BUILDING) { if (events_are_equal(&cur->l->e, &e)) { #ifdef LOL_EVENTS_DEBUG01 if (debug) printf("Adding event to building event\n"); #endif /* LOL_EVENTS_DEBUG01 */ if (aup_list_append(cur->l, au->cur_buf, au->list_idx, au->line_number) < 0) { au->cur_buf = NULL; continue; } au->cur_buf = NULL; free((char *)e.host); au_check_events(au, e.sec); #ifdef LOL_EVENTS_DEBUG01 if (debug) print_lol("building",au->au_lo); #endif /* LOL_EVENTS_DEBUG01 */ /* we built something, so break out */ built++; break; } } } if (built) continue; /* So create one */ #ifdef LOL_EVENTS_DEBUG01 if (debug) printf("First record in new event, initialize event\n"); #endif /* LOL_EVENTS_DEBUG01 */ if ((l=(event_list_t *)malloc(sizeof(event_list_t))) == NULL) { free((char *)e.host); return -1; } aup_list_create(l); aup_list_set_event(l, &e); if (aup_list_append(l, au->cur_buf, au->list_idx, au->line_number) < 0) { au->cur_buf = NULL; aup_list_clear(l); free(l); continue; } // Eat standalone EOE - main event was already marked complete if (l->head->type == AUDIT_EOE) { au->cur_buf = NULL; aup_list_clear(l); free(l); continue; } if (au_lol_append(au->au_lo, l) == NULL) { free((char *)e.host); au->cur_buf = NULL; aup_list_clear(l); free(l); #ifdef LOL_EVENTS_DEBUG01 if (debug) printf("error appending to lol\n"); #endif /* LOL_EVENTS_DEBUG01 */ return -1; } au->cur_buf = NULL; free((char *)e.host); au_check_events(au, e.sec); if ((l = au_get_ready_event(au, 0)) != NULL) { rnode *r; aup_list_first(l); r = aup_list_get_cur(l); free_interpretation_list(); load_interpretation_list(r->interp); aup_list_first_field(l); au->le = l; #ifdef LOL_EVENTS_DEBUG01 if (debug) print_lol("basic", au->au_lo); #endif /* LOL_EVENTS_DEBUG01 */ return 1; } } } // Brute force go to next event. Returns < 0 on error, 0 no data, > 0 success int auparse_next_event(auparse_state_t *au) { clear_normalizer(&au->norm_data); return au_auparse_next_event(au); } /* Accessors to event data */ const au_event_t *auparse_get_timestamp(const auparse_state_t *au) { if (au && au->le && au->le->e.sec != 0) return &au->le->e; else return NULL; } time_t auparse_get_time(const auparse_state_t *au) { if (au && au->le) return au->le->e.sec; else return 0; } unsigned int auparse_get_milli(const auparse_state_t *au) { if (au && au->le) return au->le->e.milli; else return 0; } unsigned long auparse_get_serial(const auparse_state_t *au) { if (au && au->le) return au->le->e.serial; else return 0; } // Gets the machine node name const char *auparse_get_node(const auparse_state_t *au) { if (au && au->le && au->le->e.host != NULL) return strdup(au->le->e.host); else return NULL; } int auparse_node_compare(const au_event_t *e1, const au_event_t *e2) { // If both have a host, only a string compare can tell if they // are the same. Otherwise, if only one of them have a host, they // are definitely not the same. Its a boundary on daemon config. if (e1->host && e2->host) return strcmp(e1->host, e2->host); else if (e1->host) return 1; else if (e2->host) return -1; return 0; } int auparse_timestamp_compare(const au_event_t *e1, const au_event_t *e2) { if (e1->sec > e2->sec) return 1; if (e1->sec < e2->sec) return -1; if (e1->milli > e2->milli) return 1; if (e1->milli < e2->milli) return -1; if (e1->serial > e2->serial) return 1; if (e1->serial < e2->serial) return -1; return 0; } unsigned int auparse_get_num_records(const auparse_state_t *au) { // Its OK if au->le == NULL because get_cnt handles it return aup_list_get_cnt(au->le); } unsigned int auparse_get_record_num(const auparse_state_t *au) { if (au->le == NULL) return 0; rnode *r = aup_list_get_cur(au->le); if (r) return r->item; return 0; } /* Functions that traverse records in the same event */ int auparse_first_record(auparse_state_t *au) { int rc; rnode *r; // Its OK if au->le == NULL because get_cnt handles it if (aup_list_get_cnt(au->le) == 0) { // This function loads interpretations rc = auparse_next_event(au); if (rc <= 0) return rc; } r = aup_list_get_cur(au->le); if (r && r->item == 0 && interpretation_list_cnt()) { // If we are on the first record and the list has previously // been loaded, just pull cursor back and avoid loading the // interpretation list. aup_list_first_field(au->le); return 1; } aup_list_first(au->le); r = aup_list_get_cur(au->le); free_interpretation_list(); load_interpretation_list(r->interp); aup_list_first_field(au->le); return 1; } /* * Returns: -1 if an error occurs, * 0 if no more records in current event, * 1 for success. */ int auparse_next_record(auparse_state_t *au) { rnode *r; free_interpretation_list(); // Its OK if au->le == NULL because get_cnt handles it if (aup_list_get_cnt(au->le) == 0) { int rc = auparse_first_record(au); if (rc <= 0) return rc; } r = aup_list_next(au->le); if (r) { load_interpretation_list(r->interp); return 1; } else return 0; } int auparse_goto_record_num(const auparse_state_t *au, unsigned int num) { rnode *r; r = aup_list_get_cur(au->le); if (r && r->item == num && interpretation_list_cnt()) { // If we are on the first record and the list has previously // been loaded, just pull cursor back and avoid loading the // interpretation list. aup_list_first_field(au->le); return 1; } /* Check if a request is out of range */ free_interpretation_list(); // Its OK if au->le == NULL because get_cnt handles it if (num >= aup_list_get_cnt(au->le)) return 0; r = aup_list_goto_rec(au->le, num); if (r != NULL) { load_interpretation_list(r->interp); aup_list_first_field(au->le); return 1; } else return 0; } /* Accessors to record data */ int auparse_get_type(const auparse_state_t *au) { if (au->le == NULL) return 0; rnode *r = aup_list_get_cur(au->le); if (r) return r->type; else return 0; } const char *auparse_get_type_name(const auparse_state_t *au) { if (au->le == NULL) return NULL; rnode *r = aup_list_get_cur(au->le); if (r) return audit_msg_type_to_name(r->type); else return NULL; } unsigned int auparse_get_line_number(const auparse_state_t *au) { if (au->le == NULL) return 0; rnode *r = aup_list_get_cur(au->le); if (r) return r->line_number; else return 0; } const char *auparse_get_filename(const auparse_state_t *au) { switch (au->source) { case AUSOURCE_FILE: case AUSOURCE_FILE_ARRAY: break; default: return NULL; } if (au->le == NULL) return NULL; rnode *r = aup_list_get_cur(au->le); if (r) { if (r->list_idx < 0) return NULL; return au->source_list[r->list_idx]; } else { return NULL; } } int auparse_first_field(const auparse_state_t *au) { if (au->le == NULL) return 0; return aup_list_first_field(au->le); } int auparse_next_field(const auparse_state_t *au) { if (au->le == NULL) return 0; rnode *r = aup_list_get_cur(au->le); if (r) { if (nvlist_next(&r->nv)) return 1; else return 0; } return 0; } unsigned int auparse_get_num_fields(const auparse_state_t *au) { if (au->le == NULL) return 0; rnode *r = aup_list_get_cur(au->le); if (r) return nvlist_get_cnt(&r->nv); else return 0; } const char *auparse_get_record_text(const auparse_state_t *au) { if (au->le == NULL) return NULL; rnode *r = aup_list_get_cur(au->le); if (r) return r->record; else return NULL; } const char *auparse_get_record_interpretations(const auparse_state_t *au) { if (au->le == NULL) return NULL; rnode *r = aup_list_get_cur(au->le); if (r) return r->interp; else return NULL; } /* scan from current location to end of event */ const char *auparse_find_field(auparse_state_t *au, const char *name) { if (au->le == NULL) return NULL; free(au->find_field); au->find_field = strdup(name); if (au->le->e.sec) { const char *cur_name; rnode *r; // look at current record before moving r = aup_list_get_cur(au->le); if (r == NULL) return NULL; cur_name = nvlist_get_cur_name(&r->nv); if (cur_name && strcmp(cur_name, name) == 0) return nvlist_get_cur_val(&r->nv); return auparse_find_field_next(au); } return NULL; } /* Increment 1 location and then scan for next field */ const char *auparse_find_field_next(const auparse_state_t *au) { if (au->le == NULL) return NULL; if (au->find_field == NULL) { errno = EINVAL; return NULL; } if (au->le->e.sec) { int moved = 0; rnode *r = aup_list_get_cur(au->le); while (r) { // For each record in the event... if (!moved) { if (nvlist_next(&r->nv) == NULL) return NULL; moved=1; } if (nvlist_find_name(&r->nv, au->find_field)) return nvlist_get_cur_val(&r->nv); r = aup_list_next(au->le); if (r) { aup_list_first_field(au->le); free_interpretation_list(); load_interpretation_list(r->interp); } } } return NULL; } /* Accessors to field data */ unsigned int auparse_get_field_num(const auparse_state_t *au) { if (au->le == NULL) return 0; rnode *r = aup_list_get_cur(au->le); if (r) { nvnode *n = nvlist_get_cur(&r->nv); if (n) return n->item; } return 0; } int auparse_goto_field_num(const auparse_state_t *au, unsigned int num) { if (au->le == NULL) return 0; rnode *r = aup_list_get_cur(au->le); if (r) { if (num >= r->nv.cnt) return 0; if ((nvlist_goto_rec(&r->nv, num))) return 1; } return 0; } const char *auparse_get_field_name(const auparse_state_t *au) { if (au->le == NULL) return NULL; if (au->le->e.sec) { rnode *r = aup_list_get_cur(au->le); if (r) return nvlist_get_cur_name(&r->nv); } return NULL; } const char *auparse_get_field_str(const auparse_state_t *au) { if (au->le == NULL) return NULL; if (au->le->e.sec) { rnode *r = aup_list_get_cur(au->le); if (r) return nvlist_get_cur_val(&r->nv); } return NULL; } int auparse_get_field_type(const auparse_state_t *au) { if (au->le == NULL) return AUPARSE_TYPE_UNCLASSIFIED; if (au->le->e.sec) { rnode *r = aup_list_get_cur(au->le); if (r) return nvlist_get_cur_type(r); } return AUPARSE_TYPE_UNCLASSIFIED; } int auparse_get_field_int(const auparse_state_t *au) { const char *v = auparse_get_field_str(au); if (v) { int val; errno = 0; val = strtol(v, NULL, 10); if (errno == 0) return val; } else errno = ENODATA; return -1; } const char *auparse_interpret_field(auparse_state_t *au) { if (au->le == NULL) return NULL; if (au->le->e.sec) { rnode *r = aup_list_get_cur(au->le); if (r) { r->cwd = NULL; return nvlist_interp_cur_val(r, au->escape_mode); } } return NULL; } const char *auparse_interpret_realpath(const auparse_state_t *au) { if (au->le == NULL) return NULL; if (au->le->e.sec) { rnode *r = aup_list_get_cur(au->le); if (r) { if (nvlist_get_cur_type(r) != AUPARSE_TYPE_ESCAPED_FILE) return NULL; // Tell it to make a realpath r->cwd = au->le->cwd; return nvlist_interp_cur_val(r, au->escape_mode); } } return NULL; } static const char *auparse_interpret_sock_parts(auparse_state_t *au, const char *field) { if (au->le == NULL) return NULL; if (au->le->e.sec) { rnode *r = aup_list_get_cur(au->le); if (r == NULL) return NULL; // This is limited to socket address fields if (nvlist_get_cur_type(r) != AUPARSE_TYPE_SOCKADDR) return NULL; // Get interpretation const char *val = nvlist_interp_cur_val(r, au->escape_mode); if (val == NULL) return NULL; // make a copy since we modify it char *tmp = strdup(val); if (tmp == NULL) return NULL; // Locate the address part val = strstr(tmp, field); if (val) { // Get past the = val += strlen(field); // find other side char *ptr = strchr(val, ' '); if (ptr) { // terminate, copy, and return it *ptr = 0; const char *final = strdup(val); free(tmp); free((void *)au->tmp_translation); au->tmp_translation = final; return final; } } free(tmp); } return NULL; } const char *auparse_interpret_sock_family(auparse_state_t *au) { return auparse_interpret_sock_parts(au, "fam="); } const char *auparse_interpret_sock_port(auparse_state_t *au) { return auparse_interpret_sock_parts(au, "lport="); } const char *auparse_interpret_sock_address(auparse_state_t *au) { return auparse_interpret_sock_parts(au, "laddr="); } /* * auparse_set_eoe_timeout - set the end of event timeout value * * Args * new_tmo - new timeout value * Rtns * 0 - correctly set * 1 - failed to set */ int auparse_set_eoe_timeout (time_t new_tmo) { if (new_tmo == 0) return 1; eoe_timeout = new_tmo; return 0; } audit-4.0.2/auparse/ellist.c0000644001034500103450000002543114655201403011411 /* * ellist.c - Minimal linked list library * Copyright (c) 2006-08,2014,2016-17,2023 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb */ #include #include #include #include #include "libaudit.h" #include "ellist.h" #include "interpret.h" #include "common.h" static const char key_sep[2] = { AUDIT_KEY_SEPARATOR, 0 }; void aup_list_create(event_list_t *l) { l->head = NULL; l->cur = NULL; l->cnt = 0; l->e.milli = 0L; l->e.sec = 0L; l->e.serial = 0L; l->e.host = NULL; l->cwd = NULL; } static void aup_list_last(event_list_t *l) { register rnode* node; if (l->head == NULL) return; node = l->head; while (node->next) node = node->next; l->cur = node; } rnode *aup_list_next(event_list_t *l) { if (l->cur) l->cur = l->cur->next; return l->cur; } /* * * This function does encoding of "untrusted" names just like the kernel * */ static char *_audit_c2x(char *final, const char *buf, unsigned int size) { unsigned int i; char *ptr = final; const char *hex = "0123456789ABCDEF"; for (i=0; i>4]; /* Upper nibble */ *ptr++ = hex[buf[i] & 0x0F]; /* Lower nibble */ } *ptr = 0; return final; } static char *escape(const char *tmp) { char *name; const unsigned char *p = (unsigned char *)tmp; while (*p) { if (*p == '"' || *p < 0x21 || *p > 0x7e) { int len = strlen(tmp); name = malloc((2*len)+1); return _audit_c2x(name, tmp, len); } p++; } if (asprintf(&name, "\"%s\"", tmp) < 0) name = NULL; return name; } /* This function does the heavy duty work of splitting a record into * its little tiny pieces */ static int parse_up_record(rnode* r) { char *ptr, *buf, *saved=NULL; unsigned int offset = 0, len; // Potentially cut the record in two ptr = strchr(r->record, AUDIT_INTERP_SEPARATOR); if (ptr) { *ptr = 0; ptr++; } r->interp = ptr; // Rather than call strndup, we will do it ourselves to reduce // the number of interactions across the record. // len includes the string terminator. len = strlen(r->record) + 1; r->nv.record = buf = malloc(len); if (r->nv.record == NULL) return -1; memcpy(r->nv.record, r->record, len); r->nv.end = r->nv.record + len; ptr = audit_strsplit_r(buf, &saved); // If no fields we have fuzzer induced problems, leave if (ptr == NULL) { free(buf); r->nv.record = NULL; return -1; } do { // If there's an '=' sign, its a keeper nvnode n; char *val = strchr(ptr, '='); if (val) { int vlen; // If name is 'msg=audit' throw it away if (*ptr == 'm' && strncmp(ptr, "msg=", 4) == 0) { if (ptr[4] == 'a') continue; // If name is 'msg='' chop off and see // if there is still a = in the string. else if (ptr[4] == '\'') { ptr += 5; val = strchr(ptr, '='); if (val == NULL) continue; } } // Split the string *val = 0; val++; // Remove beginning cruft of name if (*ptr == '(') ptr++; n.name = ptr; n.val = val; // Remove trailing punctuation vlen = strlen(n.val); // Check for invalid val if (!vlen) continue; if (n.val[vlen-1] == ':') { n.val[vlen-1] = 0; vlen--; } if (n.val[vlen-1] == ',') { n.val[vlen-1] = 0; vlen--; } if (n.val[vlen-1] == '\'') { n.val[vlen-1] = 0; vlen--; } if (n.val[vlen-1] == ')') { if (strcmp(n.val, "(none)") && strcmp(n.val, "(null)")) { n.val[vlen-1] = 0; vlen--; } } // Make virtual keys or just store it if (strcmp(n.name, "key") == 0 && *n.val != '(') { if (*n.val == '"') { // This is a normal single key. n.name = strdup("key"); char *t = strdup(n.val); n.val = t; if (nvlist_append(&r->nv, &n)) { free(n.name); free(n.val); continue; } } else { // Virtual keys char *key, *ptr2, *saved2; key = (char *)au_unescape(n.val); if (key == NULL) { n.name = strdup("key"); n.val = NULL; // Malformed key - save as is if (nvlist_append(&r->nv, &n)) { free(n.name); free(n.val); } continue; } ptr2 = strtok_r(key, key_sep, &saved2); while (ptr2) { n.name = strdup("key"); n.val = escape(ptr2); if (nvlist_append(&r->nv, &n)) { free(n.name); free(n.val); } ptr2 = strtok_r(NULL, key_sep, &saved2); } free(key); } continue; } else { if (strcmp(n.name, "key") == 0) { // This is a null key n.name = strdup("key"); char *t = strdup(n.val); n.val = t; if (nvlist_append(&r->nv, &n)) { free(n.name); free(n.val); continue; } } else // everything not a key nvlist_append(&r->nv, &n); } // Do some info gathering for use later if (r->nv.cnt == 1 && strcmp(n.name, "node") == 0) offset = 1; // if node, some positions changes // This has to account for seccomp records else if (r->nv.cnt == (1 + offset) && strcmp(n.name, "type") == 0) { r->type = audit_name_to_msg_type(n.val); if (r->type == AUDIT_URINGOP) r->machine = MACH_IO_URING; // This has to account for seccomp records } else if ((r->nv.cnt == (2 + offset) || r->nv.cnt == (11 + offset)) && strcmp(n.name, "arch")== 0){ unsigned int ival; errno = 0; ival = strtoul(n.val, NULL, 16); if (errno) r->machine = -2; else r->machine = audit_elf_to_machine(ival); } else if ((r->nv.cnt == (3 + offset) || r->nv.cnt == (12 + offset)) && strcmp(n.name, "syscall") == 0){ errno = 0; r->syscall = strtoul(n.val, NULL, 10); if (errno) r->syscall = -1; } else if (r->nv.cnt == (2 + offset) && strcmp(n.name, "uring_op") == 0) { errno = 0; r->syscall = strtoul(n.val, NULL, 10); if (errno) r->syscall = -1; } else if (r->nv.cnt == (6 + offset) && strcmp(n.name, "a0") == 0){ errno = 0; r->a0 = strtoull(n.val, NULL, 16); if (errno) r->a0 = -1LL; } else if (r->nv.cnt == (7 + offset) && strcmp(n.name, "a1") == 0){ errno = 0; r->a1 = strtoull(n.val, NULL, 16); if (errno) r->a1 = -1LL; } else if (r->type == AUDIT_CWD) { // most common fuzzing hit: duplicate cwds if (strcmp(n.name, "cwd") == 0 && !r->cwd) r->cwd = strdup(n.val); } } else if (r->type == AUDIT_AVC || r->type == AUDIT_USER_AVC) { // We special case these 2 fields because selinux // avc messages do not label these fields. n.name = NULL; if (nvlist_get_cnt(&r->nv) == (1 + offset)) { // skip over 'avc:' if (strncmp(ptr, "avc", 3) == 0) continue; n.name = strdup("seresult"); } else if (nvlist_get_cnt(&r->nv) == (2 + offset)) { // skip over open brace if (*ptr == '{') { int total = 0, clen; char tmpctx[256], *to; tmpctx[0] = 0; to = tmpctx; ptr = audit_strsplit_r(NULL, &saved); while (ptr && *ptr != '}') { clen = strlen(ptr); if ((clen+1) >= (256-total)) { if (nvlist_get_cnt(&r->nv) == 0) free(buf); return -1; } if (tmpctx[0]) { to = stpcpy(to, ","); total++; } to = stpcpy(to, ptr); total += clen; ptr = audit_strsplit_r(NULL, &saved); } n.name = strdup("seperms"); n.val = strdup(tmpctx); if (nvlist_append(&r->nv, &n)) { free(n.name); free(n.val); } continue; } } else continue; n.val = ptr; nvlist_append(&r->nv, &n); } } while((ptr = audit_strsplit_r(NULL, &saved))); // If for some reason it was useless, delete buf if (r->nv.cnt == 0) { free(buf); r->nv.record = NULL; r->nv.end = NULL; free((void *)r->cwd); r->cwd = NULL; } r->nv.cur = 0; // reset to beginning return 0; } int aup_list_append(event_list_t *l, char *record, int list_idx, unsigned int line_number) { int rc; rnode* r; if (record == NULL) return -1; // First step is build rnode r = malloc(sizeof(rnode)); if (r == NULL) return -1; r->record = record; r->interp = NULL; r->cwd = NULL; r->type = 0; r->a0 = 0LL; r->a1 = 0LL; r->machine = -1; r->syscall = -1; r->item = l->cnt; r->list_idx = list_idx; r->line_number = line_number; r->next = NULL; nvlist_create(&r->nv); // if we are at top, fix this up if (l->head == NULL) l->head = r; else { // Otherwise add pointer to newnode aup_list_last(l); l->cur->next = r; } // make newnode current l->cur = r; l->cnt++; // Then parse the record up into nvlist rc = parse_up_record(r); if (r->nv.cnt == 0) // This is fuzzer induced, return an error. rc = -1; if (r->cwd) { // Should never be 2 cwd records unless log is corrupted free((void *)l->cwd); l->cwd = r->cwd; } return rc; } void aup_list_clear(event_list_t* l) { rnode* nextnode; register rnode* current; if (l == NULL) return; current = l->head; while (current) { nextnode=current->next; nvlist_clear(¤t->nv, 1); free(current->record); free(current); current=nextnode; } l->head = NULL; l->cur = NULL; l->cnt = 0; l->e.milli = 0L; l->e.sec = 0L; l->e.serial = 0L; free((char *)l->e.host); l->e.host = NULL; free((void *)l->cwd); } /*int aup_list_get_event(event_list_t* l, au_event_t *e) { if (l == NULL || e == NULL) return 0; e->sec = l->e.sec; e->milli = l->e.milli; e->serial = l->e.serial; if (l->e.host) e->host = strdup(l->e.host); else e->host = NULL; return 1; } */ int aup_list_set_event(event_list_t* l, au_event_t *e) { if (l == NULL || e == NULL) return 0; l->e.sec = e->sec; l->e.milli = e->milli; l->e.serial = e->serial; l->e.host = e->host; // Take custody of the memory e->host = NULL; return 1; } rnode *aup_list_goto_rec(event_list_t *l, int i) { register rnode* node; node = l->head; /* start at the beginning */ while (node) { if (node->item == i) { l->cur = node; return node; } else node = node->next; } return NULL; } int aup_list_first_field(const event_list_t *l) { if (l && l->cur) { nvlist_first(&l->cur->nv); return 1; } else return 0; } audit-4.0.2/auparse/Makefile.in0000644001034500103450000066254114655201422012030 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am -- # Copyright 2006-08,2011-18 Red Hat Inc. # All Rights Reserved. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this program; see the file COPYING.lib. If not, write to # the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor # Boston, MA 02110-1335, USA. # # Authors: # Steve Grubb # Richard Guy Briggs # 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@ noinst_PROGRAMS = gen_accesstabs_h$(EXEEXT) gen_captabs_h$(EXEEXT) \ gen_clock_h$(EXEEXT) gen_clone-flagtabs_h$(EXEEXT) \ gen_epoll_ctls_h$(EXEEXT) gen_famtabs_h$(EXEEXT) \ gen_fcntl-cmdtabs_h$(EXEEXT) gen_flagtabs_h$(EXEEXT) \ gen_fsconfigs_h$(EXEEXT) gen_ioctlreqtabs_h$(EXEEXT) \ gen_icmptypetabs_h$(EXEEXT) gen_ipctabs_h$(EXEEXT) \ gen_ipccmdtabs_h$(EXEEXT) gen_ipoptnametabs_h$(EXEEXT) \ gen_ip6optnametabs_h$(EXEEXT) gen_nfprototabs_h$(EXEEXT) \ gen_mmaptabs_h$(EXEEXT) gen_mounttabs_h$(EXEEXT) \ gen_open-flagtabs_h$(EXEEXT) gen_persontabs_h$(EXEEXT) \ gen_prctl_opttabs_h$(EXEEXT) gen_pktoptnametabs_h$(EXEEXT) \ gen_prottabs_h$(EXEEXT) gen_recvtabs_h$(EXEEXT) \ gen_rlimit_h$(EXEEXT) gen_ptracetabs_h$(EXEEXT) \ gen_schedtabs_h$(EXEEXT) gen_seccomptabs_h$(EXEEXT) \ gen_seektabs_h$(EXEEXT) gen_shm_modetabs_h$(EXEEXT) \ gen_signals_h$(EXEEXT) gen_sockoptnametabs_h$(EXEEXT) \ gen_socktabs_h$(EXEEXT) gen_sockleveltabs_h$(EXEEXT) \ gen_socktypetabs_h$(EXEEXT) gen_tcpoptnametabs_h$(EXEEXT) \ gen_typetabs_h$(EXEEXT) gen_umounttabs_h$(EXEEXT) \ gen_inethooktabs_h$(EXEEXT) gen_netactiontabs_h$(EXEEXT) \ gen_normalize_record_map$(EXEEXT) \ gen_normalize_syscall_map$(EXEEXT) \ gen_normalize_obj_kind_map$(EXEEXT) \ gen_normalize_evtypetabs_h$(EXEEXT) gen_bpftabs_h$(EXEEXT) \ gen_openat2-resolvetabs_h$(EXEEXT) subdir = auparse ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prog_cc_for_build.m4 \ $(top_srcdir)/m4/cap-ng.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/src/libev/libev.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(include_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" \ "$(DESTDIR)$(includedir)" LTLIBRARIES = $(lib_LTLIBRARIES) am_libauparse_la_OBJECTS = lru.lo interpret.lo nvlist.lo ellist.lo \ auparse.lo auditd-config.lo message.lo data_buf.lo \ expression.lo normalize.lo normalize-llist.lo am__objects_1 = nodist_libauparse_la_OBJECTS = $(am__objects_1) libauparse_la_OBJECTS = $(am_libauparse_la_OBJECTS) \ $(nodist_libauparse_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libauparse_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libauparse_la_LDFLAGS) $(LDFLAGS) -o $@ am__dirstamp = $(am__leading_dot)dirstamp am_gen_accesstabs_h_OBJECTS = \ ../lib/gen_accesstabs_h-gen_tables.$(OBJEXT) gen_accesstabs_h_OBJECTS = $(am_gen_accesstabs_h_OBJECTS) gen_accesstabs_h_LDADD = $(LDADD) gen_accesstabs_h_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(gen_accesstabs_h_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ am_gen_bpftabs_h_OBJECTS = ../lib/gen_bpftabs_h-gen_tables.$(OBJEXT) gen_bpftabs_h_OBJECTS = $(am_gen_bpftabs_h_OBJECTS) gen_bpftabs_h_LDADD = $(LDADD) gen_bpftabs_h_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(gen_bpftabs_h_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_gen_captabs_h_OBJECTS = ../lib/gen_captabs_h-gen_tables.$(OBJEXT) gen_captabs_h_OBJECTS = $(am_gen_captabs_h_OBJECTS) gen_captabs_h_LDADD = $(LDADD) gen_captabs_h_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(gen_captabs_h_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_gen_clock_h_OBJECTS = ../lib/gen_clock_h-gen_tables.$(OBJEXT) gen_clock_h_OBJECTS = $(am_gen_clock_h_OBJECTS) gen_clock_h_LDADD = $(LDADD) gen_clock_h_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(gen_clock_h_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_gen_clone_flagtabs_h_OBJECTS = \ ../lib/gen_clone_flagtabs_h-gen_tables.$(OBJEXT) gen_clone_flagtabs_h_OBJECTS = $(am_gen_clone_flagtabs_h_OBJECTS) gen_clone_flagtabs_h_LDADD = $(LDADD) gen_clone_flagtabs_h_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(gen_clone_flagtabs_h_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ am_gen_epoll_ctls_h_OBJECTS = \ ../lib/gen_epoll_ctls_h-gen_tables.$(OBJEXT) gen_epoll_ctls_h_OBJECTS = $(am_gen_epoll_ctls_h_OBJECTS) gen_epoll_ctls_h_LDADD = $(LDADD) gen_epoll_ctls_h_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(gen_epoll_ctls_h_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ am_gen_famtabs_h_OBJECTS = ../lib/gen_famtabs_h-gen_tables.$(OBJEXT) gen_famtabs_h_OBJECTS = $(am_gen_famtabs_h_OBJECTS) gen_famtabs_h_LDADD = $(LDADD) gen_famtabs_h_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(gen_famtabs_h_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_gen_fcntl_cmdtabs_h_OBJECTS = \ ../lib/gen_fcntl_cmdtabs_h-gen_tables.$(OBJEXT) gen_fcntl_cmdtabs_h_OBJECTS = $(am_gen_fcntl_cmdtabs_h_OBJECTS) gen_fcntl_cmdtabs_h_LDADD = $(LDADD) gen_fcntl_cmdtabs_h_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(gen_fcntl_cmdtabs_h_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ am_gen_flagtabs_h_OBJECTS = \ ../lib/gen_flagtabs_h-gen_tables.$(OBJEXT) gen_flagtabs_h_OBJECTS = $(am_gen_flagtabs_h_OBJECTS) gen_flagtabs_h_LDADD = $(LDADD) gen_flagtabs_h_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(gen_flagtabs_h_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o \ $@ am_gen_fsconfigs_h_OBJECTS = \ ../lib/gen_fsconfigs_h-gen_tables.$(OBJEXT) gen_fsconfigs_h_OBJECTS = $(am_gen_fsconfigs_h_OBJECTS) gen_fsconfigs_h_LDADD = $(LDADD) gen_fsconfigs_h_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(gen_fsconfigs_h_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ am_gen_icmptypetabs_h_OBJECTS = \ ../lib/gen_icmptypetabs_h-gen_tables.$(OBJEXT) gen_icmptypetabs_h_OBJECTS = $(am_gen_icmptypetabs_h_OBJECTS) gen_icmptypetabs_h_LDADD = $(LDADD) gen_icmptypetabs_h_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(gen_icmptypetabs_h_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ am_gen_inethooktabs_h_OBJECTS = \ ../lib/gen_inethooktabs_h-gen_tables.$(OBJEXT) gen_inethooktabs_h_OBJECTS = $(am_gen_inethooktabs_h_OBJECTS) gen_inethooktabs_h_LDADD = $(LDADD) gen_inethooktabs_h_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(gen_inethooktabs_h_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ am_gen_ioctlreqtabs_h_OBJECTS = \ ../lib/gen_ioctlreqtabs_h-gen_tables.$(OBJEXT) gen_ioctlreqtabs_h_OBJECTS = $(am_gen_ioctlreqtabs_h_OBJECTS) gen_ioctlreqtabs_h_LDADD = $(LDADD) gen_ioctlreqtabs_h_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(gen_ioctlreqtabs_h_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ am_gen_ip6optnametabs_h_OBJECTS = \ ../lib/gen_ip6optnametabs_h-gen_tables.$(OBJEXT) gen_ip6optnametabs_h_OBJECTS = $(am_gen_ip6optnametabs_h_OBJECTS) gen_ip6optnametabs_h_LDADD = $(LDADD) gen_ip6optnametabs_h_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(gen_ip6optnametabs_h_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ am_gen_ipccmdtabs_h_OBJECTS = \ ../lib/gen_ipccmdtabs_h-gen_tables.$(OBJEXT) gen_ipccmdtabs_h_OBJECTS = $(am_gen_ipccmdtabs_h_OBJECTS) gen_ipccmdtabs_h_LDADD = $(LDADD) gen_ipccmdtabs_h_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(gen_ipccmdtabs_h_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ am_gen_ipctabs_h_OBJECTS = ../lib/gen_ipctabs_h-gen_tables.$(OBJEXT) gen_ipctabs_h_OBJECTS = $(am_gen_ipctabs_h_OBJECTS) gen_ipctabs_h_LDADD = $(LDADD) gen_ipctabs_h_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(gen_ipctabs_h_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_gen_ipoptnametabs_h_OBJECTS = \ ../lib/gen_ipoptnametabs_h-gen_tables.$(OBJEXT) gen_ipoptnametabs_h_OBJECTS = $(am_gen_ipoptnametabs_h_OBJECTS) gen_ipoptnametabs_h_LDADD = $(LDADD) gen_ipoptnametabs_h_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(gen_ipoptnametabs_h_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ am_gen_mmaptabs_h_OBJECTS = \ ../lib/gen_mmaptabs_h-gen_tables.$(OBJEXT) gen_mmaptabs_h_OBJECTS = $(am_gen_mmaptabs_h_OBJECTS) gen_mmaptabs_h_LDADD = $(LDADD) gen_mmaptabs_h_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(gen_mmaptabs_h_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o \ $@ am_gen_mounttabs_h_OBJECTS = \ ../lib/gen_mounttabs_h-gen_tables.$(OBJEXT) gen_mounttabs_h_OBJECTS = $(am_gen_mounttabs_h_OBJECTS) gen_mounttabs_h_LDADD = $(LDADD) gen_mounttabs_h_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(gen_mounttabs_h_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ am_gen_netactiontabs_h_OBJECTS = \ ../lib/gen_netactiontabs_h-gen_tables.$(OBJEXT) gen_netactiontabs_h_OBJECTS = $(am_gen_netactiontabs_h_OBJECTS) gen_netactiontabs_h_LDADD = $(LDADD) gen_netactiontabs_h_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(gen_netactiontabs_h_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ am_gen_nfprototabs_h_OBJECTS = \ ../lib/gen_nfprototabs_h-gen_tables.$(OBJEXT) gen_nfprototabs_h_OBJECTS = $(am_gen_nfprototabs_h_OBJECTS) gen_nfprototabs_h_LDADD = $(LDADD) gen_nfprototabs_h_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(gen_nfprototabs_h_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ am_gen_normalize_evtypetabs_h_OBJECTS = \ ../lib/gen_normalize_evtypetabs_h-gen_tables.$(OBJEXT) gen_normalize_evtypetabs_h_OBJECTS = \ $(am_gen_normalize_evtypetabs_h_OBJECTS) gen_normalize_evtypetabs_h_LDADD = $(LDADD) gen_normalize_evtypetabs_h_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(gen_normalize_evtypetabs_h_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ am_gen_normalize_obj_kind_map_OBJECTS = \ ../lib/gen_normalize_obj_kind_map-gen_tables.$(OBJEXT) gen_normalize_obj_kind_map_OBJECTS = \ $(am_gen_normalize_obj_kind_map_OBJECTS) gen_normalize_obj_kind_map_LDADD = $(LDADD) gen_normalize_obj_kind_map_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(gen_normalize_obj_kind_map_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ am_gen_normalize_record_map_OBJECTS = \ ../lib/gen_normalize_record_map-gen_tables.$(OBJEXT) gen_normalize_record_map_OBJECTS = \ $(am_gen_normalize_record_map_OBJECTS) gen_normalize_record_map_LDADD = $(LDADD) gen_normalize_record_map_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(gen_normalize_record_map_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ am_gen_normalize_syscall_map_OBJECTS = \ ../lib/gen_normalize_syscall_map-gen_tables.$(OBJEXT) gen_normalize_syscall_map_OBJECTS = \ $(am_gen_normalize_syscall_map_OBJECTS) gen_normalize_syscall_map_LDADD = $(LDADD) gen_normalize_syscall_map_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(gen_normalize_syscall_map_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ am_gen_open_flagtabs_h_OBJECTS = \ ../lib/gen_open_flagtabs_h-gen_tables.$(OBJEXT) gen_open_flagtabs_h_OBJECTS = $(am_gen_open_flagtabs_h_OBJECTS) gen_open_flagtabs_h_LDADD = $(LDADD) gen_open_flagtabs_h_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(gen_open_flagtabs_h_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ am_gen_openat2_resolvetabs_h_OBJECTS = \ ../lib/gen_openat2_resolvetabs_h-gen_tables.$(OBJEXT) gen_openat2_resolvetabs_h_OBJECTS = \ $(am_gen_openat2_resolvetabs_h_OBJECTS) gen_openat2_resolvetabs_h_LDADD = $(LDADD) gen_openat2_resolvetabs_h_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(gen_openat2_resolvetabs_h_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ am_gen_persontabs_h_OBJECTS = \ ../lib/gen_persontabs_h-gen_tables.$(OBJEXT) gen_persontabs_h_OBJECTS = $(am_gen_persontabs_h_OBJECTS) gen_persontabs_h_LDADD = $(LDADD) gen_persontabs_h_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(gen_persontabs_h_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ am_gen_pktoptnametabs_h_OBJECTS = \ ../lib/gen_pktoptnametabs_h-gen_tables.$(OBJEXT) gen_pktoptnametabs_h_OBJECTS = $(am_gen_pktoptnametabs_h_OBJECTS) gen_pktoptnametabs_h_LDADD = $(LDADD) gen_pktoptnametabs_h_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(gen_pktoptnametabs_h_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ am_gen_prctl_opttabs_h_OBJECTS = \ ../lib/gen_prctl_opttabs_h-gen_tables.$(OBJEXT) gen_prctl_opttabs_h_OBJECTS = $(am_gen_prctl_opttabs_h_OBJECTS) gen_prctl_opttabs_h_LDADD = $(LDADD) gen_prctl_opttabs_h_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(gen_prctl_opttabs_h_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ am_gen_prottabs_h_OBJECTS = \ ../lib/gen_prottabs_h-gen_tables.$(OBJEXT) gen_prottabs_h_OBJECTS = $(am_gen_prottabs_h_OBJECTS) gen_prottabs_h_LDADD = $(LDADD) gen_prottabs_h_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(gen_prottabs_h_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o \ $@ am_gen_ptracetabs_h_OBJECTS = \ ../lib/gen_ptracetabs_h-gen_tables.$(OBJEXT) gen_ptracetabs_h_OBJECTS = $(am_gen_ptracetabs_h_OBJECTS) gen_ptracetabs_h_LDADD = $(LDADD) gen_ptracetabs_h_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(gen_ptracetabs_h_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ am_gen_recvtabs_h_OBJECTS = \ ../lib/gen_recvtabs_h-gen_tables.$(OBJEXT) gen_recvtabs_h_OBJECTS = $(am_gen_recvtabs_h_OBJECTS) gen_recvtabs_h_LDADD = $(LDADD) gen_recvtabs_h_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(gen_recvtabs_h_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o \ $@ am_gen_rlimit_h_OBJECTS = ../lib/gen_rlimit_h-gen_tables.$(OBJEXT) gen_rlimit_h_OBJECTS = $(am_gen_rlimit_h_OBJECTS) gen_rlimit_h_LDADD = $(LDADD) gen_rlimit_h_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(gen_rlimit_h_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_gen_schedtabs_h_OBJECTS = \ ../lib/gen_schedtabs_h-gen_tables.$(OBJEXT) gen_schedtabs_h_OBJECTS = $(am_gen_schedtabs_h_OBJECTS) gen_schedtabs_h_LDADD = $(LDADD) gen_schedtabs_h_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(gen_schedtabs_h_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ am_gen_seccomptabs_h_OBJECTS = \ ../lib/gen_seccomptabs_h-gen_tables.$(OBJEXT) gen_seccomptabs_h_OBJECTS = $(am_gen_seccomptabs_h_OBJECTS) gen_seccomptabs_h_LDADD = $(LDADD) gen_seccomptabs_h_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(gen_seccomptabs_h_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ am_gen_seektabs_h_OBJECTS = \ ../lib/gen_seektabs_h-gen_tables.$(OBJEXT) gen_seektabs_h_OBJECTS = $(am_gen_seektabs_h_OBJECTS) gen_seektabs_h_LDADD = $(LDADD) gen_seektabs_h_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(gen_seektabs_h_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o \ $@ am_gen_shm_modetabs_h_OBJECTS = \ ../lib/gen_shm_modetabs_h-gen_tables.$(OBJEXT) gen_shm_modetabs_h_OBJECTS = $(am_gen_shm_modetabs_h_OBJECTS) gen_shm_modetabs_h_LDADD = $(LDADD) gen_shm_modetabs_h_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(gen_shm_modetabs_h_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ am_gen_signals_h_OBJECTS = ../lib/gen_signals_h-gen_tables.$(OBJEXT) gen_signals_h_OBJECTS = $(am_gen_signals_h_OBJECTS) gen_signals_h_LDADD = $(LDADD) gen_signals_h_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(gen_signals_h_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_gen_sockleveltabs_h_OBJECTS = \ ../lib/gen_sockleveltabs_h-gen_tables.$(OBJEXT) gen_sockleveltabs_h_OBJECTS = $(am_gen_sockleveltabs_h_OBJECTS) gen_sockleveltabs_h_LDADD = $(LDADD) gen_sockleveltabs_h_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(gen_sockleveltabs_h_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ am_gen_sockoptnametabs_h_OBJECTS = \ ../lib/gen_sockoptnametabs_h-gen_tables.$(OBJEXT) gen_sockoptnametabs_h_OBJECTS = $(am_gen_sockoptnametabs_h_OBJECTS) gen_sockoptnametabs_h_LDADD = $(LDADD) gen_sockoptnametabs_h_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(gen_sockoptnametabs_h_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ am_gen_socktabs_h_OBJECTS = \ ../lib/gen_socktabs_h-gen_tables.$(OBJEXT) gen_socktabs_h_OBJECTS = $(am_gen_socktabs_h_OBJECTS) gen_socktabs_h_LDADD = $(LDADD) gen_socktabs_h_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(gen_socktabs_h_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o \ $@ am_gen_socktypetabs_h_OBJECTS = \ ../lib/gen_socktypetabs_h-gen_tables.$(OBJEXT) gen_socktypetabs_h_OBJECTS = $(am_gen_socktypetabs_h_OBJECTS) gen_socktypetabs_h_LDADD = $(LDADD) gen_socktypetabs_h_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(gen_socktypetabs_h_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ am_gen_tcpoptnametabs_h_OBJECTS = \ ../lib/gen_tcpoptnametabs_h-gen_tables.$(OBJEXT) gen_tcpoptnametabs_h_OBJECTS = $(am_gen_tcpoptnametabs_h_OBJECTS) gen_tcpoptnametabs_h_LDADD = $(LDADD) gen_tcpoptnametabs_h_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(gen_tcpoptnametabs_h_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ am_gen_typetabs_h_OBJECTS = \ ../lib/gen_typetabs_h-gen_tables.$(OBJEXT) gen_typetabs_h_OBJECTS = $(am_gen_typetabs_h_OBJECTS) gen_typetabs_h_LDADD = $(LDADD) gen_typetabs_h_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(gen_typetabs_h_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o \ $@ am_gen_umounttabs_h_OBJECTS = \ ../lib/gen_umounttabs_h-gen_tables.$(OBJEXT) gen_umounttabs_h_OBJECTS = $(am_gen_umounttabs_h_OBJECTS) gen_umounttabs_h_LDADD = $(LDADD) gen_umounttabs_h_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(gen_umounttabs_h_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ../lib/$(DEPDIR)/gen_accesstabs_h-gen_tables.Po \ ../lib/$(DEPDIR)/gen_bpftabs_h-gen_tables.Po \ ../lib/$(DEPDIR)/gen_captabs_h-gen_tables.Po \ ../lib/$(DEPDIR)/gen_clock_h-gen_tables.Po \ ../lib/$(DEPDIR)/gen_clone_flagtabs_h-gen_tables.Po \ ../lib/$(DEPDIR)/gen_epoll_ctls_h-gen_tables.Po \ ../lib/$(DEPDIR)/gen_famtabs_h-gen_tables.Po \ ../lib/$(DEPDIR)/gen_fcntl_cmdtabs_h-gen_tables.Po \ ../lib/$(DEPDIR)/gen_flagtabs_h-gen_tables.Po \ ../lib/$(DEPDIR)/gen_fsconfigs_h-gen_tables.Po \ ../lib/$(DEPDIR)/gen_icmptypetabs_h-gen_tables.Po \ ../lib/$(DEPDIR)/gen_inethooktabs_h-gen_tables.Po \ ../lib/$(DEPDIR)/gen_ioctlreqtabs_h-gen_tables.Po \ ../lib/$(DEPDIR)/gen_ip6optnametabs_h-gen_tables.Po \ ../lib/$(DEPDIR)/gen_ipccmdtabs_h-gen_tables.Po \ ../lib/$(DEPDIR)/gen_ipctabs_h-gen_tables.Po \ ../lib/$(DEPDIR)/gen_ipoptnametabs_h-gen_tables.Po \ ../lib/$(DEPDIR)/gen_mmaptabs_h-gen_tables.Po \ ../lib/$(DEPDIR)/gen_mounttabs_h-gen_tables.Po \ ../lib/$(DEPDIR)/gen_netactiontabs_h-gen_tables.Po \ ../lib/$(DEPDIR)/gen_nfprototabs_h-gen_tables.Po \ ../lib/$(DEPDIR)/gen_normalize_evtypetabs_h-gen_tables.Po \ ../lib/$(DEPDIR)/gen_normalize_obj_kind_map-gen_tables.Po \ ../lib/$(DEPDIR)/gen_normalize_record_map-gen_tables.Po \ ../lib/$(DEPDIR)/gen_normalize_syscall_map-gen_tables.Po \ ../lib/$(DEPDIR)/gen_open_flagtabs_h-gen_tables.Po \ ../lib/$(DEPDIR)/gen_openat2_resolvetabs_h-gen_tables.Po \ ../lib/$(DEPDIR)/gen_persontabs_h-gen_tables.Po \ ../lib/$(DEPDIR)/gen_pktoptnametabs_h-gen_tables.Po \ ../lib/$(DEPDIR)/gen_prctl_opttabs_h-gen_tables.Po \ ../lib/$(DEPDIR)/gen_prottabs_h-gen_tables.Po \ ../lib/$(DEPDIR)/gen_ptracetabs_h-gen_tables.Po \ ../lib/$(DEPDIR)/gen_recvtabs_h-gen_tables.Po \ ../lib/$(DEPDIR)/gen_rlimit_h-gen_tables.Po \ ../lib/$(DEPDIR)/gen_schedtabs_h-gen_tables.Po \ ../lib/$(DEPDIR)/gen_seccomptabs_h-gen_tables.Po \ ../lib/$(DEPDIR)/gen_seektabs_h-gen_tables.Po \ ../lib/$(DEPDIR)/gen_shm_modetabs_h-gen_tables.Po \ ../lib/$(DEPDIR)/gen_signals_h-gen_tables.Po \ ../lib/$(DEPDIR)/gen_sockleveltabs_h-gen_tables.Po \ ../lib/$(DEPDIR)/gen_sockoptnametabs_h-gen_tables.Po \ ../lib/$(DEPDIR)/gen_socktabs_h-gen_tables.Po \ ../lib/$(DEPDIR)/gen_socktypetabs_h-gen_tables.Po \ ../lib/$(DEPDIR)/gen_tcpoptnametabs_h-gen_tables.Po \ ../lib/$(DEPDIR)/gen_typetabs_h-gen_tables.Po \ ../lib/$(DEPDIR)/gen_umounttabs_h-gen_tables.Po \ ./$(DEPDIR)/auditd-config.Plo ./$(DEPDIR)/auparse.Plo \ ./$(DEPDIR)/data_buf.Plo ./$(DEPDIR)/ellist.Plo \ ./$(DEPDIR)/expression.Plo ./$(DEPDIR)/interpret.Plo \ ./$(DEPDIR)/lru.Plo ./$(DEPDIR)/message.Plo \ ./$(DEPDIR)/normalize-llist.Plo ./$(DEPDIR)/normalize.Plo \ ./$(DEPDIR)/nvlist.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libauparse_la_SOURCES) $(nodist_libauparse_la_SOURCES) \ $(gen_accesstabs_h_SOURCES) $(gen_bpftabs_h_SOURCES) \ $(gen_captabs_h_SOURCES) $(gen_clock_h_SOURCES) \ $(gen_clone_flagtabs_h_SOURCES) $(gen_epoll_ctls_h_SOURCES) \ $(gen_famtabs_h_SOURCES) $(gen_fcntl_cmdtabs_h_SOURCES) \ $(gen_flagtabs_h_SOURCES) $(gen_fsconfigs_h_SOURCES) \ $(gen_icmptypetabs_h_SOURCES) $(gen_inethooktabs_h_SOURCES) \ $(gen_ioctlreqtabs_h_SOURCES) $(gen_ip6optnametabs_h_SOURCES) \ $(gen_ipccmdtabs_h_SOURCES) $(gen_ipctabs_h_SOURCES) \ $(gen_ipoptnametabs_h_SOURCES) $(gen_mmaptabs_h_SOURCES) \ $(gen_mounttabs_h_SOURCES) $(gen_netactiontabs_h_SOURCES) \ $(gen_nfprototabs_h_SOURCES) \ $(gen_normalize_evtypetabs_h_SOURCES) \ $(gen_normalize_obj_kind_map_SOURCES) \ $(gen_normalize_record_map_SOURCES) \ $(gen_normalize_syscall_map_SOURCES) \ $(gen_open_flagtabs_h_SOURCES) \ $(gen_openat2_resolvetabs_h_SOURCES) \ $(gen_persontabs_h_SOURCES) $(gen_pktoptnametabs_h_SOURCES) \ $(gen_prctl_opttabs_h_SOURCES) $(gen_prottabs_h_SOURCES) \ $(gen_ptracetabs_h_SOURCES) $(gen_recvtabs_h_SOURCES) \ $(gen_rlimit_h_SOURCES) $(gen_schedtabs_h_SOURCES) \ $(gen_seccomptabs_h_SOURCES) $(gen_seektabs_h_SOURCES) \ $(gen_shm_modetabs_h_SOURCES) $(gen_signals_h_SOURCES) \ $(gen_sockleveltabs_h_SOURCES) \ $(gen_sockoptnametabs_h_SOURCES) $(gen_socktabs_h_SOURCES) \ $(gen_socktypetabs_h_SOURCES) $(gen_tcpoptnametabs_h_SOURCES) \ $(gen_typetabs_h_SOURCES) $(gen_umounttabs_h_SOURCES) DIST_SOURCES = $(libauparse_la_SOURCES) $(gen_accesstabs_h_SOURCES) \ $(gen_bpftabs_h_SOURCES) $(gen_captabs_h_SOURCES) \ $(gen_clock_h_SOURCES) $(gen_clone_flagtabs_h_SOURCES) \ $(gen_epoll_ctls_h_SOURCES) $(gen_famtabs_h_SOURCES) \ $(gen_fcntl_cmdtabs_h_SOURCES) $(gen_flagtabs_h_SOURCES) \ $(gen_fsconfigs_h_SOURCES) $(gen_icmptypetabs_h_SOURCES) \ $(gen_inethooktabs_h_SOURCES) $(gen_ioctlreqtabs_h_SOURCES) \ $(gen_ip6optnametabs_h_SOURCES) $(gen_ipccmdtabs_h_SOURCES) \ $(gen_ipctabs_h_SOURCES) $(gen_ipoptnametabs_h_SOURCES) \ $(gen_mmaptabs_h_SOURCES) $(gen_mounttabs_h_SOURCES) \ $(gen_netactiontabs_h_SOURCES) $(gen_nfprototabs_h_SOURCES) \ $(gen_normalize_evtypetabs_h_SOURCES) \ $(gen_normalize_obj_kind_map_SOURCES) \ $(gen_normalize_record_map_SOURCES) \ $(gen_normalize_syscall_map_SOURCES) \ $(gen_open_flagtabs_h_SOURCES) \ $(gen_openat2_resolvetabs_h_SOURCES) \ $(gen_persontabs_h_SOURCES) $(gen_pktoptnametabs_h_SOURCES) \ $(gen_prctl_opttabs_h_SOURCES) $(gen_prottabs_h_SOURCES) \ $(gen_ptracetabs_h_SOURCES) $(gen_recvtabs_h_SOURCES) \ $(gen_rlimit_h_SOURCES) $(gen_schedtabs_h_SOURCES) \ $(gen_seccomptabs_h_SOURCES) $(gen_seektabs_h_SOURCES) \ $(gen_shm_modetabs_h_SOURCES) $(gen_signals_h_SOURCES) \ $(gen_sockleveltabs_h_SOURCES) \ $(gen_sockoptnametabs_h_SOURCES) $(gen_socktabs_h_SOURCES) \ $(gen_socktypetabs_h_SOURCES) $(gen_tcpoptnametabs_h_SOURCES) \ $(gen_typetabs_h_SOURCES) $(gen_umounttabs_h_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DATA = $(pkgconfig_DATA) HEADERS = $(include_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/auparse.pc.in \ $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILD_EXEEXT = @BUILD_EXEEXT@ BUILD_OBJEXT = @BUILD_OBJEXT@ CAPNG_LDADD = @CAPNG_LDADD@ CAPNG_PKG = @CAPNG_PKG@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_FOR_BUILD = @CC_FOR_BUILD@ CFLAGS = @CFLAGS@ CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ CPP_FOR_BUILD = @CPP_FOR_BUILD@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG = @DEBUG@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GOLANG = @GOLANG@ GOROOT = @GOROOT@ 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@ LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ LIBOBJS = @LIBOBJS@ LIBS = LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBWRAP_LIBS = @LIBWRAP_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PYTHON = @PYTHON@ PYTHON3_CFLAGS = @PYTHON3_CFLAGS@ PYTHON3_INCLUDES = @PYTHON3_INCLUDES@ PYTHON3_LIBS = @PYTHON3_LIBS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ VERSION = @VERSION@ WFLAGS = @WFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CC_FOR_BUILD = @ac_ct_CC_FOR_BUILD@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gss_libs = @gss_libs@ 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@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ use_python3 = @use_python3@ SUBDIRS = test EXTRA_DIST = expression-design.txt CLEANFILES = $(BUILT_SOURCES) CONFIG_CLEAN_FILES = *.loT *.rej *.orig AM_CFLAGS = -fPIC -DPIC -D_GNU_SOURCE -g ${DEBUG} -Wno-pointer-sign -Wno-enum-compare -Wno-switch ${WFLAGS} AM_CPPFLAGS = -I. -I${top_srcdir} -I${top_srcdir}/src -I${top_srcdir}/lib -I${top_srcdir}/common pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = auparse.pc DISTCLEANFILES = $(pkgconfig_DATA) lib_LTLIBRARIES = libauparse.la include_HEADERS = auparse.h auparse-defs.h libauparse_la_SOURCES = lru.c interpret.c nvlist.c ellist.c \ auparse.c auditd-config.c message.c data_buf.c \ auparse-defs.h auparse-idata.h data_buf.h \ nvlist.h auparse.h ellist.h \ internal.h lru.h rnode.h interpret.h \ private.h expression.c expression.h tty_named_keys.h \ normalize.c normalize-llist.c normalize-llist.h \ normalize-internal.h normalize_obj_kind_map.h \ normalize_record_map.h normalize_syscall_map.h nodist_libauparse_la_SOURCES = $(BUILT_SOURCES) libauparse_la_LIBADD = ${top_builddir}/lib/libaudit.la ${top_builddir}/common/libaucommon.la libauparse_la_DEPENDENCIES = $(libauparse_la_SOURCES) ${top_builddir}/config.h ${top_builddir}/common/libaucommon.la libauparse_la_LDFLAGS = -Wl,-z,relro BUILT_SOURCES = accesstabs.h captabs.h clocktabs.h clone-flagtabs.h \ epoll_ctls.h famtabs.h fcntl-cmdtabs.h fsconfigs.h \ flagtabs.h icmptypetabs.h ipctabs.h ipccmdtabs.h\ ioctlreqtabs.h ipoptnametabs.h ip6optnametabs.h \ mmaptabs.h mounttabs.h nfprototabs.h open-flagtabs.h \ persontabs.h prctl_opttabs.h pktoptnametabs.h \ prottabs.h ptracetabs.h \ rlimittabs.h recvtabs.h schedtabs.h seccomptabs.h \ seektabs.h shm_modetabs.h signaltabs.h sockoptnametabs.h \ socktabs.h sockleveltabs.h socktypetabs.h \ tcpoptnametabs.h typetabs.h umounttabs.h inethooktabs.h \ netactiontabs.h \ normalize_obj_kind_maps.h normalize_record_maps.h \ normalize_syscall_maps.h normalize_evtypetabs.h bpftabs.h \ openat2-resolvetabs.h gen_accesstabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h accesstab.h gen_accesstabs_h_CFLAGS = '-DTABLE_H="accesstab.h"' gen_captabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h captab.h gen_captabs_h_CFLAGS = '-DTABLE_H="captab.h"' gen_clock_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h clocktab.h gen_clock_h_CFLAGS = '-DTABLE_H="clocktab.h"' gen_clone_flagtabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h \ clone-flagtab.h gen_clone_flagtabs_h_CFLAGS = '-DTABLE_H="clone-flagtab.h"' gen_epoll_ctls_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h epoll_ctl.h gen_epoll_ctls_h_CFLAGS = '-DTABLE_H="epoll_ctl.h"' gen_famtabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h famtab.h gen_famtabs_h_CFLAGS = '-DTABLE_H="famtab.h"' gen_flagtabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h flagtab.h # ../auparse/ is used to avoid using ../lib/flagtab.h gen_flagtabs_h_CFLAGS = '-DTABLE_H="../auparse/flagtab.h"' gen_fcntl_cmdtabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h \ fcntl-cmdtab.h gen_fcntl_cmdtabs_h_CFLAGS = '-DTABLE_H="fcntl-cmdtab.h"' gen_fsconfigs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h fsconfig.h gen_fsconfigs_h_CFLAGS = '-DTABLE_H="fsconfig.h"' gen_icmptypetabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h icmptypetab.h gen_icmptypetabs_h_CFLAGS = '-DTABLE_H="icmptypetab.h"' gen_ioctlreqtabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h ioctlreqtab.h gen_ioctlreqtabs_h_CFLAGS = '-DTABLE_H="ioctlreqtab.h"' gen_ipctabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h ipctab.h gen_ipctabs_h_CFLAGS = '-DTABLE_H="ipctab.h"' gen_ipccmdtabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h ipccmdtab.h gen_ipccmdtabs_h_CFLAGS = '-DTABLE_H="ipccmdtab.h"' gen_ipoptnametabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h ipoptnametab.h gen_ipoptnametabs_h_CFLAGS = '-DTABLE_H="ipoptnametab.h"' gen_ip6optnametabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h ip6optnametab.h gen_ip6optnametabs_h_CFLAGS = '-DTABLE_H="ip6optnametab.h"' gen_mmaptabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h mmaptab.h gen_mmaptabs_h_CFLAGS = '-DTABLE_H="mmaptab.h"' gen_mounttabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h mounttab.h gen_mounttabs_h_CFLAGS = '-DTABLE_H="mounttab.h"' gen_nfprototabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h nfprototab.h gen_nfprototabs_h_CFLAGS = '-DTABLE_H="nfprototab.h"' gen_open_flagtabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h \ open-flagtab.h gen_open_flagtabs_h_CFLAGS = '-DTABLE_H="open-flagtab.h"' gen_persontabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h persontab.h gen_persontabs_h_CFLAGS = '-DTABLE_H="persontab.h"' gen_ptracetabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h ptracetab.h gen_ptracetabs_h_CFLAGS = '-DTABLE_H="ptracetab.h"' gen_prctl_opttabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h prctl-opt-tab.h gen_prctl_opttabs_h_CFLAGS = '-DTABLE_H="prctl-opt-tab.h"' gen_pktoptnametabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h pktoptnametab.h gen_pktoptnametabs_h_CFLAGS = '-DTABLE_H="pktoptnametab.h"' gen_prottabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h prottab.h gen_prottabs_h_CFLAGS = '-DTABLE_H="prottab.h"' gen_recvtabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h recvtab.h gen_recvtabs_h_CFLAGS = '-DTABLE_H="recvtab.h"' gen_rlimit_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h rlimittab.h gen_rlimit_h_CFLAGS = '-DTABLE_H="rlimittab.h"' gen_schedtabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h schedtab.h gen_schedtabs_h_CFLAGS = '-DTABLE_H="schedtab.h"' gen_seccomptabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h seccomptab.h gen_seccomptabs_h_CFLAGS = '-DTABLE_H="seccomptab.h"' gen_seektabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h seektab.h gen_seektabs_h_CFLAGS = '-DTABLE_H="seektab.h"' gen_shm_modetabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h shm_modetab.h gen_shm_modetabs_h_CFLAGS = '-DTABLE_H="shm_modetab.h"' gen_signals_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h signaltab.h gen_signals_h_CFLAGS = '-DTABLE_H="signaltab.h"' gen_sockleveltabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h sockleveltab.h gen_sockleveltabs_h_CFLAGS = '-DTABLE_H="sockleveltab.h"' gen_sockoptnametabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h sockoptnametab.h gen_sockoptnametabs_h_CFLAGS = '-DTABLE_H="sockoptnametab.h"' gen_socktabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h socktab.h gen_socktabs_h_CFLAGS = '-DTABLE_H="socktab.h"' gen_socktypetabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h socktypetab.h gen_socktypetabs_h_CFLAGS = '-DTABLE_H="socktypetab.h"' gen_tcpoptnametabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h tcpoptnametab.h gen_tcpoptnametabs_h_CFLAGS = '-DTABLE_H="tcpoptnametab.h"' gen_typetabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h typetab.h gen_typetabs_h_CFLAGS = '-DTABLE_H="typetab.h"' gen_umounttabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h umounttab.h gen_umounttabs_h_CFLAGS = '-DTABLE_H="umounttab.h"' gen_inethooktabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h inethooktab.h gen_inethooktabs_h_CFLAGS = '-DTABLE_H="inethooktab.h"' gen_netactiontabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h netactiontab.h gen_netactiontabs_h_CFLAGS = '-DTABLE_H="netactiontab.h"' gen_normalize_record_map_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h normalize_record_map.h gen_normalize_record_map_CFLAGS = '-DTABLE_H="normalize_record_map.h"' gen_normalize_syscall_map_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h normalize_syscall_map.h gen_normalize_syscall_map_CFLAGS = '-DTABLE_H="normalize_syscall_map.h"' gen_normalize_obj_kind_map_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h normalize_obj_kind_map.h gen_normalize_obj_kind_map_CFLAGS = '-DTABLE_H="normalize_obj_kind_map.h"' gen_normalize_evtypetabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h normalize_evtypetab.h gen_normalize_evtypetabs_h_CFLAGS = '-DTABLE_H="normalize_evtypetab.h"' gen_bpftabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h bpftab.h gen_bpftabs_h_CFLAGS = '-DTABLE_H="bpftab.h"' gen_openat2_resolvetabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h \ openat2-resolvetab.h gen_openat2_resolvetabs_h_CFLAGS = '-DTABLE_H="openat2-resolvetab.h"' all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu auparse/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu auparse/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): auparse.pc: $(top_builddir)/config.status $(srcdir)/auparse.pc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libauparse.la: $(libauparse_la_OBJECTS) $(libauparse_la_DEPENDENCIES) $(EXTRA_libauparse_la_DEPENDENCIES) $(AM_V_CCLD)$(libauparse_la_LINK) -rpath $(libdir) $(libauparse_la_OBJECTS) $(libauparse_la_LIBADD) $(LIBS) ../lib/$(am__dirstamp): @$(MKDIR_P) ../lib @: > ../lib/$(am__dirstamp) ../lib/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) ../lib/$(DEPDIR) @: > ../lib/$(DEPDIR)/$(am__dirstamp) ../lib/gen_accesstabs_h-gen_tables.$(OBJEXT): ../lib/$(am__dirstamp) \ ../lib/$(DEPDIR)/$(am__dirstamp) gen_accesstabs_h$(EXEEXT): $(gen_accesstabs_h_OBJECTS) $(gen_accesstabs_h_DEPENDENCIES) $(EXTRA_gen_accesstabs_h_DEPENDENCIES) @rm -f gen_accesstabs_h$(EXEEXT) $(AM_V_CCLD)$(gen_accesstabs_h_LINK) $(gen_accesstabs_h_OBJECTS) $(gen_accesstabs_h_LDADD) $(LIBS) ../lib/gen_bpftabs_h-gen_tables.$(OBJEXT): ../lib/$(am__dirstamp) \ ../lib/$(DEPDIR)/$(am__dirstamp) gen_bpftabs_h$(EXEEXT): $(gen_bpftabs_h_OBJECTS) $(gen_bpftabs_h_DEPENDENCIES) $(EXTRA_gen_bpftabs_h_DEPENDENCIES) @rm -f gen_bpftabs_h$(EXEEXT) $(AM_V_CCLD)$(gen_bpftabs_h_LINK) $(gen_bpftabs_h_OBJECTS) $(gen_bpftabs_h_LDADD) $(LIBS) ../lib/gen_captabs_h-gen_tables.$(OBJEXT): ../lib/$(am__dirstamp) \ ../lib/$(DEPDIR)/$(am__dirstamp) gen_captabs_h$(EXEEXT): $(gen_captabs_h_OBJECTS) $(gen_captabs_h_DEPENDENCIES) $(EXTRA_gen_captabs_h_DEPENDENCIES) @rm -f gen_captabs_h$(EXEEXT) $(AM_V_CCLD)$(gen_captabs_h_LINK) $(gen_captabs_h_OBJECTS) $(gen_captabs_h_LDADD) $(LIBS) ../lib/gen_clock_h-gen_tables.$(OBJEXT): ../lib/$(am__dirstamp) \ ../lib/$(DEPDIR)/$(am__dirstamp) gen_clock_h$(EXEEXT): $(gen_clock_h_OBJECTS) $(gen_clock_h_DEPENDENCIES) $(EXTRA_gen_clock_h_DEPENDENCIES) @rm -f gen_clock_h$(EXEEXT) $(AM_V_CCLD)$(gen_clock_h_LINK) $(gen_clock_h_OBJECTS) $(gen_clock_h_LDADD) $(LIBS) ../lib/gen_clone_flagtabs_h-gen_tables.$(OBJEXT): \ ../lib/$(am__dirstamp) ../lib/$(DEPDIR)/$(am__dirstamp) gen_clone-flagtabs_h$(EXEEXT): $(gen_clone_flagtabs_h_OBJECTS) $(gen_clone_flagtabs_h_DEPENDENCIES) $(EXTRA_gen_clone_flagtabs_h_DEPENDENCIES) @rm -f gen_clone-flagtabs_h$(EXEEXT) $(AM_V_CCLD)$(gen_clone_flagtabs_h_LINK) $(gen_clone_flagtabs_h_OBJECTS) $(gen_clone_flagtabs_h_LDADD) $(LIBS) ../lib/gen_epoll_ctls_h-gen_tables.$(OBJEXT): ../lib/$(am__dirstamp) \ ../lib/$(DEPDIR)/$(am__dirstamp) gen_epoll_ctls_h$(EXEEXT): $(gen_epoll_ctls_h_OBJECTS) $(gen_epoll_ctls_h_DEPENDENCIES) $(EXTRA_gen_epoll_ctls_h_DEPENDENCIES) @rm -f gen_epoll_ctls_h$(EXEEXT) $(AM_V_CCLD)$(gen_epoll_ctls_h_LINK) $(gen_epoll_ctls_h_OBJECTS) $(gen_epoll_ctls_h_LDADD) $(LIBS) ../lib/gen_famtabs_h-gen_tables.$(OBJEXT): ../lib/$(am__dirstamp) \ ../lib/$(DEPDIR)/$(am__dirstamp) gen_famtabs_h$(EXEEXT): $(gen_famtabs_h_OBJECTS) $(gen_famtabs_h_DEPENDENCIES) $(EXTRA_gen_famtabs_h_DEPENDENCIES) @rm -f gen_famtabs_h$(EXEEXT) $(AM_V_CCLD)$(gen_famtabs_h_LINK) $(gen_famtabs_h_OBJECTS) $(gen_famtabs_h_LDADD) $(LIBS) ../lib/gen_fcntl_cmdtabs_h-gen_tables.$(OBJEXT): \ ../lib/$(am__dirstamp) ../lib/$(DEPDIR)/$(am__dirstamp) gen_fcntl-cmdtabs_h$(EXEEXT): $(gen_fcntl_cmdtabs_h_OBJECTS) $(gen_fcntl_cmdtabs_h_DEPENDENCIES) $(EXTRA_gen_fcntl_cmdtabs_h_DEPENDENCIES) @rm -f gen_fcntl-cmdtabs_h$(EXEEXT) $(AM_V_CCLD)$(gen_fcntl_cmdtabs_h_LINK) $(gen_fcntl_cmdtabs_h_OBJECTS) $(gen_fcntl_cmdtabs_h_LDADD) $(LIBS) ../lib/gen_flagtabs_h-gen_tables.$(OBJEXT): ../lib/$(am__dirstamp) \ ../lib/$(DEPDIR)/$(am__dirstamp) gen_flagtabs_h$(EXEEXT): $(gen_flagtabs_h_OBJECTS) $(gen_flagtabs_h_DEPENDENCIES) $(EXTRA_gen_flagtabs_h_DEPENDENCIES) @rm -f gen_flagtabs_h$(EXEEXT) $(AM_V_CCLD)$(gen_flagtabs_h_LINK) $(gen_flagtabs_h_OBJECTS) $(gen_flagtabs_h_LDADD) $(LIBS) ../lib/gen_fsconfigs_h-gen_tables.$(OBJEXT): ../lib/$(am__dirstamp) \ ../lib/$(DEPDIR)/$(am__dirstamp) gen_fsconfigs_h$(EXEEXT): $(gen_fsconfigs_h_OBJECTS) $(gen_fsconfigs_h_DEPENDENCIES) $(EXTRA_gen_fsconfigs_h_DEPENDENCIES) @rm -f gen_fsconfigs_h$(EXEEXT) $(AM_V_CCLD)$(gen_fsconfigs_h_LINK) $(gen_fsconfigs_h_OBJECTS) $(gen_fsconfigs_h_LDADD) $(LIBS) ../lib/gen_icmptypetabs_h-gen_tables.$(OBJEXT): \ ../lib/$(am__dirstamp) ../lib/$(DEPDIR)/$(am__dirstamp) gen_icmptypetabs_h$(EXEEXT): $(gen_icmptypetabs_h_OBJECTS) $(gen_icmptypetabs_h_DEPENDENCIES) $(EXTRA_gen_icmptypetabs_h_DEPENDENCIES) @rm -f gen_icmptypetabs_h$(EXEEXT) $(AM_V_CCLD)$(gen_icmptypetabs_h_LINK) $(gen_icmptypetabs_h_OBJECTS) $(gen_icmptypetabs_h_LDADD) $(LIBS) ../lib/gen_inethooktabs_h-gen_tables.$(OBJEXT): \ ../lib/$(am__dirstamp) ../lib/$(DEPDIR)/$(am__dirstamp) gen_inethooktabs_h$(EXEEXT): $(gen_inethooktabs_h_OBJECTS) $(gen_inethooktabs_h_DEPENDENCIES) $(EXTRA_gen_inethooktabs_h_DEPENDENCIES) @rm -f gen_inethooktabs_h$(EXEEXT) $(AM_V_CCLD)$(gen_inethooktabs_h_LINK) $(gen_inethooktabs_h_OBJECTS) $(gen_inethooktabs_h_LDADD) $(LIBS) ../lib/gen_ioctlreqtabs_h-gen_tables.$(OBJEXT): \ ../lib/$(am__dirstamp) ../lib/$(DEPDIR)/$(am__dirstamp) gen_ioctlreqtabs_h$(EXEEXT): $(gen_ioctlreqtabs_h_OBJECTS) $(gen_ioctlreqtabs_h_DEPENDENCIES) $(EXTRA_gen_ioctlreqtabs_h_DEPENDENCIES) @rm -f gen_ioctlreqtabs_h$(EXEEXT) $(AM_V_CCLD)$(gen_ioctlreqtabs_h_LINK) $(gen_ioctlreqtabs_h_OBJECTS) $(gen_ioctlreqtabs_h_LDADD) $(LIBS) ../lib/gen_ip6optnametabs_h-gen_tables.$(OBJEXT): \ ../lib/$(am__dirstamp) ../lib/$(DEPDIR)/$(am__dirstamp) gen_ip6optnametabs_h$(EXEEXT): $(gen_ip6optnametabs_h_OBJECTS) $(gen_ip6optnametabs_h_DEPENDENCIES) $(EXTRA_gen_ip6optnametabs_h_DEPENDENCIES) @rm -f gen_ip6optnametabs_h$(EXEEXT) $(AM_V_CCLD)$(gen_ip6optnametabs_h_LINK) $(gen_ip6optnametabs_h_OBJECTS) $(gen_ip6optnametabs_h_LDADD) $(LIBS) ../lib/gen_ipccmdtabs_h-gen_tables.$(OBJEXT): ../lib/$(am__dirstamp) \ ../lib/$(DEPDIR)/$(am__dirstamp) gen_ipccmdtabs_h$(EXEEXT): $(gen_ipccmdtabs_h_OBJECTS) $(gen_ipccmdtabs_h_DEPENDENCIES) $(EXTRA_gen_ipccmdtabs_h_DEPENDENCIES) @rm -f gen_ipccmdtabs_h$(EXEEXT) $(AM_V_CCLD)$(gen_ipccmdtabs_h_LINK) $(gen_ipccmdtabs_h_OBJECTS) $(gen_ipccmdtabs_h_LDADD) $(LIBS) ../lib/gen_ipctabs_h-gen_tables.$(OBJEXT): ../lib/$(am__dirstamp) \ ../lib/$(DEPDIR)/$(am__dirstamp) gen_ipctabs_h$(EXEEXT): $(gen_ipctabs_h_OBJECTS) $(gen_ipctabs_h_DEPENDENCIES) $(EXTRA_gen_ipctabs_h_DEPENDENCIES) @rm -f gen_ipctabs_h$(EXEEXT) $(AM_V_CCLD)$(gen_ipctabs_h_LINK) $(gen_ipctabs_h_OBJECTS) $(gen_ipctabs_h_LDADD) $(LIBS) ../lib/gen_ipoptnametabs_h-gen_tables.$(OBJEXT): \ ../lib/$(am__dirstamp) ../lib/$(DEPDIR)/$(am__dirstamp) gen_ipoptnametabs_h$(EXEEXT): $(gen_ipoptnametabs_h_OBJECTS) $(gen_ipoptnametabs_h_DEPENDENCIES) $(EXTRA_gen_ipoptnametabs_h_DEPENDENCIES) @rm -f gen_ipoptnametabs_h$(EXEEXT) $(AM_V_CCLD)$(gen_ipoptnametabs_h_LINK) $(gen_ipoptnametabs_h_OBJECTS) $(gen_ipoptnametabs_h_LDADD) $(LIBS) ../lib/gen_mmaptabs_h-gen_tables.$(OBJEXT): ../lib/$(am__dirstamp) \ ../lib/$(DEPDIR)/$(am__dirstamp) gen_mmaptabs_h$(EXEEXT): $(gen_mmaptabs_h_OBJECTS) $(gen_mmaptabs_h_DEPENDENCIES) $(EXTRA_gen_mmaptabs_h_DEPENDENCIES) @rm -f gen_mmaptabs_h$(EXEEXT) $(AM_V_CCLD)$(gen_mmaptabs_h_LINK) $(gen_mmaptabs_h_OBJECTS) $(gen_mmaptabs_h_LDADD) $(LIBS) ../lib/gen_mounttabs_h-gen_tables.$(OBJEXT): ../lib/$(am__dirstamp) \ ../lib/$(DEPDIR)/$(am__dirstamp) gen_mounttabs_h$(EXEEXT): $(gen_mounttabs_h_OBJECTS) $(gen_mounttabs_h_DEPENDENCIES) $(EXTRA_gen_mounttabs_h_DEPENDENCIES) @rm -f gen_mounttabs_h$(EXEEXT) $(AM_V_CCLD)$(gen_mounttabs_h_LINK) $(gen_mounttabs_h_OBJECTS) $(gen_mounttabs_h_LDADD) $(LIBS) ../lib/gen_netactiontabs_h-gen_tables.$(OBJEXT): \ ../lib/$(am__dirstamp) ../lib/$(DEPDIR)/$(am__dirstamp) gen_netactiontabs_h$(EXEEXT): $(gen_netactiontabs_h_OBJECTS) $(gen_netactiontabs_h_DEPENDENCIES) $(EXTRA_gen_netactiontabs_h_DEPENDENCIES) @rm -f gen_netactiontabs_h$(EXEEXT) $(AM_V_CCLD)$(gen_netactiontabs_h_LINK) $(gen_netactiontabs_h_OBJECTS) $(gen_netactiontabs_h_LDADD) $(LIBS) ../lib/gen_nfprototabs_h-gen_tables.$(OBJEXT): ../lib/$(am__dirstamp) \ ../lib/$(DEPDIR)/$(am__dirstamp) gen_nfprototabs_h$(EXEEXT): $(gen_nfprototabs_h_OBJECTS) $(gen_nfprototabs_h_DEPENDENCIES) $(EXTRA_gen_nfprototabs_h_DEPENDENCIES) @rm -f gen_nfprototabs_h$(EXEEXT) $(AM_V_CCLD)$(gen_nfprototabs_h_LINK) $(gen_nfprototabs_h_OBJECTS) $(gen_nfprototabs_h_LDADD) $(LIBS) ../lib/gen_normalize_evtypetabs_h-gen_tables.$(OBJEXT): \ ../lib/$(am__dirstamp) ../lib/$(DEPDIR)/$(am__dirstamp) gen_normalize_evtypetabs_h$(EXEEXT): $(gen_normalize_evtypetabs_h_OBJECTS) $(gen_normalize_evtypetabs_h_DEPENDENCIES) $(EXTRA_gen_normalize_evtypetabs_h_DEPENDENCIES) @rm -f gen_normalize_evtypetabs_h$(EXEEXT) $(AM_V_CCLD)$(gen_normalize_evtypetabs_h_LINK) $(gen_normalize_evtypetabs_h_OBJECTS) $(gen_normalize_evtypetabs_h_LDADD) $(LIBS) ../lib/gen_normalize_obj_kind_map-gen_tables.$(OBJEXT): \ ../lib/$(am__dirstamp) ../lib/$(DEPDIR)/$(am__dirstamp) gen_normalize_obj_kind_map$(EXEEXT): $(gen_normalize_obj_kind_map_OBJECTS) $(gen_normalize_obj_kind_map_DEPENDENCIES) $(EXTRA_gen_normalize_obj_kind_map_DEPENDENCIES) @rm -f gen_normalize_obj_kind_map$(EXEEXT) $(AM_V_CCLD)$(gen_normalize_obj_kind_map_LINK) $(gen_normalize_obj_kind_map_OBJECTS) $(gen_normalize_obj_kind_map_LDADD) $(LIBS) ../lib/gen_normalize_record_map-gen_tables.$(OBJEXT): \ ../lib/$(am__dirstamp) ../lib/$(DEPDIR)/$(am__dirstamp) gen_normalize_record_map$(EXEEXT): $(gen_normalize_record_map_OBJECTS) $(gen_normalize_record_map_DEPENDENCIES) $(EXTRA_gen_normalize_record_map_DEPENDENCIES) @rm -f gen_normalize_record_map$(EXEEXT) $(AM_V_CCLD)$(gen_normalize_record_map_LINK) $(gen_normalize_record_map_OBJECTS) $(gen_normalize_record_map_LDADD) $(LIBS) ../lib/gen_normalize_syscall_map-gen_tables.$(OBJEXT): \ ../lib/$(am__dirstamp) ../lib/$(DEPDIR)/$(am__dirstamp) gen_normalize_syscall_map$(EXEEXT): $(gen_normalize_syscall_map_OBJECTS) $(gen_normalize_syscall_map_DEPENDENCIES) $(EXTRA_gen_normalize_syscall_map_DEPENDENCIES) @rm -f gen_normalize_syscall_map$(EXEEXT) $(AM_V_CCLD)$(gen_normalize_syscall_map_LINK) $(gen_normalize_syscall_map_OBJECTS) $(gen_normalize_syscall_map_LDADD) $(LIBS) ../lib/gen_open_flagtabs_h-gen_tables.$(OBJEXT): \ ../lib/$(am__dirstamp) ../lib/$(DEPDIR)/$(am__dirstamp) gen_open-flagtabs_h$(EXEEXT): $(gen_open_flagtabs_h_OBJECTS) $(gen_open_flagtabs_h_DEPENDENCIES) $(EXTRA_gen_open_flagtabs_h_DEPENDENCIES) @rm -f gen_open-flagtabs_h$(EXEEXT) $(AM_V_CCLD)$(gen_open_flagtabs_h_LINK) $(gen_open_flagtabs_h_OBJECTS) $(gen_open_flagtabs_h_LDADD) $(LIBS) ../lib/gen_openat2_resolvetabs_h-gen_tables.$(OBJEXT): \ ../lib/$(am__dirstamp) ../lib/$(DEPDIR)/$(am__dirstamp) gen_openat2-resolvetabs_h$(EXEEXT): $(gen_openat2_resolvetabs_h_OBJECTS) $(gen_openat2_resolvetabs_h_DEPENDENCIES) $(EXTRA_gen_openat2_resolvetabs_h_DEPENDENCIES) @rm -f gen_openat2-resolvetabs_h$(EXEEXT) $(AM_V_CCLD)$(gen_openat2_resolvetabs_h_LINK) $(gen_openat2_resolvetabs_h_OBJECTS) $(gen_openat2_resolvetabs_h_LDADD) $(LIBS) ../lib/gen_persontabs_h-gen_tables.$(OBJEXT): ../lib/$(am__dirstamp) \ ../lib/$(DEPDIR)/$(am__dirstamp) gen_persontabs_h$(EXEEXT): $(gen_persontabs_h_OBJECTS) $(gen_persontabs_h_DEPENDENCIES) $(EXTRA_gen_persontabs_h_DEPENDENCIES) @rm -f gen_persontabs_h$(EXEEXT) $(AM_V_CCLD)$(gen_persontabs_h_LINK) $(gen_persontabs_h_OBJECTS) $(gen_persontabs_h_LDADD) $(LIBS) ../lib/gen_pktoptnametabs_h-gen_tables.$(OBJEXT): \ ../lib/$(am__dirstamp) ../lib/$(DEPDIR)/$(am__dirstamp) gen_pktoptnametabs_h$(EXEEXT): $(gen_pktoptnametabs_h_OBJECTS) $(gen_pktoptnametabs_h_DEPENDENCIES) $(EXTRA_gen_pktoptnametabs_h_DEPENDENCIES) @rm -f gen_pktoptnametabs_h$(EXEEXT) $(AM_V_CCLD)$(gen_pktoptnametabs_h_LINK) $(gen_pktoptnametabs_h_OBJECTS) $(gen_pktoptnametabs_h_LDADD) $(LIBS) ../lib/gen_prctl_opttabs_h-gen_tables.$(OBJEXT): \ ../lib/$(am__dirstamp) ../lib/$(DEPDIR)/$(am__dirstamp) gen_prctl_opttabs_h$(EXEEXT): $(gen_prctl_opttabs_h_OBJECTS) $(gen_prctl_opttabs_h_DEPENDENCIES) $(EXTRA_gen_prctl_opttabs_h_DEPENDENCIES) @rm -f gen_prctl_opttabs_h$(EXEEXT) $(AM_V_CCLD)$(gen_prctl_opttabs_h_LINK) $(gen_prctl_opttabs_h_OBJECTS) $(gen_prctl_opttabs_h_LDADD) $(LIBS) ../lib/gen_prottabs_h-gen_tables.$(OBJEXT): ../lib/$(am__dirstamp) \ ../lib/$(DEPDIR)/$(am__dirstamp) gen_prottabs_h$(EXEEXT): $(gen_prottabs_h_OBJECTS) $(gen_prottabs_h_DEPENDENCIES) $(EXTRA_gen_prottabs_h_DEPENDENCIES) @rm -f gen_prottabs_h$(EXEEXT) $(AM_V_CCLD)$(gen_prottabs_h_LINK) $(gen_prottabs_h_OBJECTS) $(gen_prottabs_h_LDADD) $(LIBS) ../lib/gen_ptracetabs_h-gen_tables.$(OBJEXT): ../lib/$(am__dirstamp) \ ../lib/$(DEPDIR)/$(am__dirstamp) gen_ptracetabs_h$(EXEEXT): $(gen_ptracetabs_h_OBJECTS) $(gen_ptracetabs_h_DEPENDENCIES) $(EXTRA_gen_ptracetabs_h_DEPENDENCIES) @rm -f gen_ptracetabs_h$(EXEEXT) $(AM_V_CCLD)$(gen_ptracetabs_h_LINK) $(gen_ptracetabs_h_OBJECTS) $(gen_ptracetabs_h_LDADD) $(LIBS) ../lib/gen_recvtabs_h-gen_tables.$(OBJEXT): ../lib/$(am__dirstamp) \ ../lib/$(DEPDIR)/$(am__dirstamp) gen_recvtabs_h$(EXEEXT): $(gen_recvtabs_h_OBJECTS) $(gen_recvtabs_h_DEPENDENCIES) $(EXTRA_gen_recvtabs_h_DEPENDENCIES) @rm -f gen_recvtabs_h$(EXEEXT) $(AM_V_CCLD)$(gen_recvtabs_h_LINK) $(gen_recvtabs_h_OBJECTS) $(gen_recvtabs_h_LDADD) $(LIBS) ../lib/gen_rlimit_h-gen_tables.$(OBJEXT): ../lib/$(am__dirstamp) \ ../lib/$(DEPDIR)/$(am__dirstamp) gen_rlimit_h$(EXEEXT): $(gen_rlimit_h_OBJECTS) $(gen_rlimit_h_DEPENDENCIES) $(EXTRA_gen_rlimit_h_DEPENDENCIES) @rm -f gen_rlimit_h$(EXEEXT) $(AM_V_CCLD)$(gen_rlimit_h_LINK) $(gen_rlimit_h_OBJECTS) $(gen_rlimit_h_LDADD) $(LIBS) ../lib/gen_schedtabs_h-gen_tables.$(OBJEXT): ../lib/$(am__dirstamp) \ ../lib/$(DEPDIR)/$(am__dirstamp) gen_schedtabs_h$(EXEEXT): $(gen_schedtabs_h_OBJECTS) $(gen_schedtabs_h_DEPENDENCIES) $(EXTRA_gen_schedtabs_h_DEPENDENCIES) @rm -f gen_schedtabs_h$(EXEEXT) $(AM_V_CCLD)$(gen_schedtabs_h_LINK) $(gen_schedtabs_h_OBJECTS) $(gen_schedtabs_h_LDADD) $(LIBS) ../lib/gen_seccomptabs_h-gen_tables.$(OBJEXT): ../lib/$(am__dirstamp) \ ../lib/$(DEPDIR)/$(am__dirstamp) gen_seccomptabs_h$(EXEEXT): $(gen_seccomptabs_h_OBJECTS) $(gen_seccomptabs_h_DEPENDENCIES) $(EXTRA_gen_seccomptabs_h_DEPENDENCIES) @rm -f gen_seccomptabs_h$(EXEEXT) $(AM_V_CCLD)$(gen_seccomptabs_h_LINK) $(gen_seccomptabs_h_OBJECTS) $(gen_seccomptabs_h_LDADD) $(LIBS) ../lib/gen_seektabs_h-gen_tables.$(OBJEXT): ../lib/$(am__dirstamp) \ ../lib/$(DEPDIR)/$(am__dirstamp) gen_seektabs_h$(EXEEXT): $(gen_seektabs_h_OBJECTS) $(gen_seektabs_h_DEPENDENCIES) $(EXTRA_gen_seektabs_h_DEPENDENCIES) @rm -f gen_seektabs_h$(EXEEXT) $(AM_V_CCLD)$(gen_seektabs_h_LINK) $(gen_seektabs_h_OBJECTS) $(gen_seektabs_h_LDADD) $(LIBS) ../lib/gen_shm_modetabs_h-gen_tables.$(OBJEXT): \ ../lib/$(am__dirstamp) ../lib/$(DEPDIR)/$(am__dirstamp) gen_shm_modetabs_h$(EXEEXT): $(gen_shm_modetabs_h_OBJECTS) $(gen_shm_modetabs_h_DEPENDENCIES) $(EXTRA_gen_shm_modetabs_h_DEPENDENCIES) @rm -f gen_shm_modetabs_h$(EXEEXT) $(AM_V_CCLD)$(gen_shm_modetabs_h_LINK) $(gen_shm_modetabs_h_OBJECTS) $(gen_shm_modetabs_h_LDADD) $(LIBS) ../lib/gen_signals_h-gen_tables.$(OBJEXT): ../lib/$(am__dirstamp) \ ../lib/$(DEPDIR)/$(am__dirstamp) gen_signals_h$(EXEEXT): $(gen_signals_h_OBJECTS) $(gen_signals_h_DEPENDENCIES) $(EXTRA_gen_signals_h_DEPENDENCIES) @rm -f gen_signals_h$(EXEEXT) $(AM_V_CCLD)$(gen_signals_h_LINK) $(gen_signals_h_OBJECTS) $(gen_signals_h_LDADD) $(LIBS) ../lib/gen_sockleveltabs_h-gen_tables.$(OBJEXT): \ ../lib/$(am__dirstamp) ../lib/$(DEPDIR)/$(am__dirstamp) gen_sockleveltabs_h$(EXEEXT): $(gen_sockleveltabs_h_OBJECTS) $(gen_sockleveltabs_h_DEPENDENCIES) $(EXTRA_gen_sockleveltabs_h_DEPENDENCIES) @rm -f gen_sockleveltabs_h$(EXEEXT) $(AM_V_CCLD)$(gen_sockleveltabs_h_LINK) $(gen_sockleveltabs_h_OBJECTS) $(gen_sockleveltabs_h_LDADD) $(LIBS) ../lib/gen_sockoptnametabs_h-gen_tables.$(OBJEXT): \ ../lib/$(am__dirstamp) ../lib/$(DEPDIR)/$(am__dirstamp) gen_sockoptnametabs_h$(EXEEXT): $(gen_sockoptnametabs_h_OBJECTS) $(gen_sockoptnametabs_h_DEPENDENCIES) $(EXTRA_gen_sockoptnametabs_h_DEPENDENCIES) @rm -f gen_sockoptnametabs_h$(EXEEXT) $(AM_V_CCLD)$(gen_sockoptnametabs_h_LINK) $(gen_sockoptnametabs_h_OBJECTS) $(gen_sockoptnametabs_h_LDADD) $(LIBS) ../lib/gen_socktabs_h-gen_tables.$(OBJEXT): ../lib/$(am__dirstamp) \ ../lib/$(DEPDIR)/$(am__dirstamp) gen_socktabs_h$(EXEEXT): $(gen_socktabs_h_OBJECTS) $(gen_socktabs_h_DEPENDENCIES) $(EXTRA_gen_socktabs_h_DEPENDENCIES) @rm -f gen_socktabs_h$(EXEEXT) $(AM_V_CCLD)$(gen_socktabs_h_LINK) $(gen_socktabs_h_OBJECTS) $(gen_socktabs_h_LDADD) $(LIBS) ../lib/gen_socktypetabs_h-gen_tables.$(OBJEXT): \ ../lib/$(am__dirstamp) ../lib/$(DEPDIR)/$(am__dirstamp) gen_socktypetabs_h$(EXEEXT): $(gen_socktypetabs_h_OBJECTS) $(gen_socktypetabs_h_DEPENDENCIES) $(EXTRA_gen_socktypetabs_h_DEPENDENCIES) @rm -f gen_socktypetabs_h$(EXEEXT) $(AM_V_CCLD)$(gen_socktypetabs_h_LINK) $(gen_socktypetabs_h_OBJECTS) $(gen_socktypetabs_h_LDADD) $(LIBS) ../lib/gen_tcpoptnametabs_h-gen_tables.$(OBJEXT): \ ../lib/$(am__dirstamp) ../lib/$(DEPDIR)/$(am__dirstamp) gen_tcpoptnametabs_h$(EXEEXT): $(gen_tcpoptnametabs_h_OBJECTS) $(gen_tcpoptnametabs_h_DEPENDENCIES) $(EXTRA_gen_tcpoptnametabs_h_DEPENDENCIES) @rm -f gen_tcpoptnametabs_h$(EXEEXT) $(AM_V_CCLD)$(gen_tcpoptnametabs_h_LINK) $(gen_tcpoptnametabs_h_OBJECTS) $(gen_tcpoptnametabs_h_LDADD) $(LIBS) ../lib/gen_typetabs_h-gen_tables.$(OBJEXT): ../lib/$(am__dirstamp) \ ../lib/$(DEPDIR)/$(am__dirstamp) gen_typetabs_h$(EXEEXT): $(gen_typetabs_h_OBJECTS) $(gen_typetabs_h_DEPENDENCIES) $(EXTRA_gen_typetabs_h_DEPENDENCIES) @rm -f gen_typetabs_h$(EXEEXT) $(AM_V_CCLD)$(gen_typetabs_h_LINK) $(gen_typetabs_h_OBJECTS) $(gen_typetabs_h_LDADD) $(LIBS) ../lib/gen_umounttabs_h-gen_tables.$(OBJEXT): ../lib/$(am__dirstamp) \ ../lib/$(DEPDIR)/$(am__dirstamp) gen_umounttabs_h$(EXEEXT): $(gen_umounttabs_h_OBJECTS) $(gen_umounttabs_h_DEPENDENCIES) $(EXTRA_gen_umounttabs_h_DEPENDENCIES) @rm -f gen_umounttabs_h$(EXEEXT) $(AM_V_CCLD)$(gen_umounttabs_h_LINK) $(gen_umounttabs_h_OBJECTS) $(gen_umounttabs_h_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f ../lib/*.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@../lib/$(DEPDIR)/gen_accesstabs_h-gen_tables.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lib/$(DEPDIR)/gen_bpftabs_h-gen_tables.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lib/$(DEPDIR)/gen_captabs_h-gen_tables.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lib/$(DEPDIR)/gen_clock_h-gen_tables.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lib/$(DEPDIR)/gen_clone_flagtabs_h-gen_tables.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lib/$(DEPDIR)/gen_epoll_ctls_h-gen_tables.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lib/$(DEPDIR)/gen_famtabs_h-gen_tables.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lib/$(DEPDIR)/gen_fcntl_cmdtabs_h-gen_tables.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lib/$(DEPDIR)/gen_flagtabs_h-gen_tables.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lib/$(DEPDIR)/gen_fsconfigs_h-gen_tables.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lib/$(DEPDIR)/gen_icmptypetabs_h-gen_tables.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lib/$(DEPDIR)/gen_inethooktabs_h-gen_tables.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lib/$(DEPDIR)/gen_ioctlreqtabs_h-gen_tables.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lib/$(DEPDIR)/gen_ip6optnametabs_h-gen_tables.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lib/$(DEPDIR)/gen_ipccmdtabs_h-gen_tables.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lib/$(DEPDIR)/gen_ipctabs_h-gen_tables.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lib/$(DEPDIR)/gen_ipoptnametabs_h-gen_tables.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lib/$(DEPDIR)/gen_mmaptabs_h-gen_tables.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lib/$(DEPDIR)/gen_mounttabs_h-gen_tables.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lib/$(DEPDIR)/gen_netactiontabs_h-gen_tables.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lib/$(DEPDIR)/gen_nfprototabs_h-gen_tables.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lib/$(DEPDIR)/gen_normalize_evtypetabs_h-gen_tables.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lib/$(DEPDIR)/gen_normalize_obj_kind_map-gen_tables.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lib/$(DEPDIR)/gen_normalize_record_map-gen_tables.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lib/$(DEPDIR)/gen_normalize_syscall_map-gen_tables.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lib/$(DEPDIR)/gen_open_flagtabs_h-gen_tables.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lib/$(DEPDIR)/gen_openat2_resolvetabs_h-gen_tables.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lib/$(DEPDIR)/gen_persontabs_h-gen_tables.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lib/$(DEPDIR)/gen_pktoptnametabs_h-gen_tables.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lib/$(DEPDIR)/gen_prctl_opttabs_h-gen_tables.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lib/$(DEPDIR)/gen_prottabs_h-gen_tables.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lib/$(DEPDIR)/gen_ptracetabs_h-gen_tables.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lib/$(DEPDIR)/gen_recvtabs_h-gen_tables.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lib/$(DEPDIR)/gen_rlimit_h-gen_tables.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lib/$(DEPDIR)/gen_schedtabs_h-gen_tables.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lib/$(DEPDIR)/gen_seccomptabs_h-gen_tables.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lib/$(DEPDIR)/gen_seektabs_h-gen_tables.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lib/$(DEPDIR)/gen_shm_modetabs_h-gen_tables.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lib/$(DEPDIR)/gen_signals_h-gen_tables.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lib/$(DEPDIR)/gen_sockleveltabs_h-gen_tables.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lib/$(DEPDIR)/gen_sockoptnametabs_h-gen_tables.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lib/$(DEPDIR)/gen_socktabs_h-gen_tables.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lib/$(DEPDIR)/gen_socktypetabs_h-gen_tables.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lib/$(DEPDIR)/gen_tcpoptnametabs_h-gen_tables.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lib/$(DEPDIR)/gen_typetabs_h-gen_tables.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lib/$(DEPDIR)/gen_umounttabs_h-gen_tables.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/auditd-config.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/auparse.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/data_buf.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ellist.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/expression.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/interpret.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lru.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/message.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/normalize-llist.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/normalize.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nvlist.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< ../lib/gen_accesstabs_h-gen_tables.o: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_accesstabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_accesstabs_h-gen_tables.o -MD -MP -MF ../lib/$(DEPDIR)/gen_accesstabs_h-gen_tables.Tpo -c -o ../lib/gen_accesstabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_accesstabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_accesstabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_accesstabs_h-gen_tables.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_accesstabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_accesstabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c ../lib/gen_accesstabs_h-gen_tables.obj: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_accesstabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_accesstabs_h-gen_tables.obj -MD -MP -MF ../lib/$(DEPDIR)/gen_accesstabs_h-gen_tables.Tpo -c -o ../lib/gen_accesstabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_accesstabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_accesstabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_accesstabs_h-gen_tables.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_accesstabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_accesstabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` ../lib/gen_bpftabs_h-gen_tables.o: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_bpftabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_bpftabs_h-gen_tables.o -MD -MP -MF ../lib/$(DEPDIR)/gen_bpftabs_h-gen_tables.Tpo -c -o ../lib/gen_bpftabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_bpftabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_bpftabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_bpftabs_h-gen_tables.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_bpftabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_bpftabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c ../lib/gen_bpftabs_h-gen_tables.obj: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_bpftabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_bpftabs_h-gen_tables.obj -MD -MP -MF ../lib/$(DEPDIR)/gen_bpftabs_h-gen_tables.Tpo -c -o ../lib/gen_bpftabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_bpftabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_bpftabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_bpftabs_h-gen_tables.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_bpftabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_bpftabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` ../lib/gen_captabs_h-gen_tables.o: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_captabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_captabs_h-gen_tables.o -MD -MP -MF ../lib/$(DEPDIR)/gen_captabs_h-gen_tables.Tpo -c -o ../lib/gen_captabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_captabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_captabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_captabs_h-gen_tables.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_captabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_captabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c ../lib/gen_captabs_h-gen_tables.obj: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_captabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_captabs_h-gen_tables.obj -MD -MP -MF ../lib/$(DEPDIR)/gen_captabs_h-gen_tables.Tpo -c -o ../lib/gen_captabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_captabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_captabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_captabs_h-gen_tables.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_captabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_captabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` ../lib/gen_clock_h-gen_tables.o: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_clock_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_clock_h-gen_tables.o -MD -MP -MF ../lib/$(DEPDIR)/gen_clock_h-gen_tables.Tpo -c -o ../lib/gen_clock_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_clock_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_clock_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_clock_h-gen_tables.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_clock_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_clock_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c ../lib/gen_clock_h-gen_tables.obj: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_clock_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_clock_h-gen_tables.obj -MD -MP -MF ../lib/$(DEPDIR)/gen_clock_h-gen_tables.Tpo -c -o ../lib/gen_clock_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_clock_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_clock_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_clock_h-gen_tables.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_clock_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_clock_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` ../lib/gen_clone_flagtabs_h-gen_tables.o: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_clone_flagtabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_clone_flagtabs_h-gen_tables.o -MD -MP -MF ../lib/$(DEPDIR)/gen_clone_flagtabs_h-gen_tables.Tpo -c -o ../lib/gen_clone_flagtabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_clone_flagtabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_clone_flagtabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_clone_flagtabs_h-gen_tables.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_clone_flagtabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_clone_flagtabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c ../lib/gen_clone_flagtabs_h-gen_tables.obj: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_clone_flagtabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_clone_flagtabs_h-gen_tables.obj -MD -MP -MF ../lib/$(DEPDIR)/gen_clone_flagtabs_h-gen_tables.Tpo -c -o ../lib/gen_clone_flagtabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_clone_flagtabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_clone_flagtabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_clone_flagtabs_h-gen_tables.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_clone_flagtabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_clone_flagtabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` ../lib/gen_epoll_ctls_h-gen_tables.o: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_epoll_ctls_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_epoll_ctls_h-gen_tables.o -MD -MP -MF ../lib/$(DEPDIR)/gen_epoll_ctls_h-gen_tables.Tpo -c -o ../lib/gen_epoll_ctls_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_epoll_ctls_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_epoll_ctls_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_epoll_ctls_h-gen_tables.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_epoll_ctls_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_epoll_ctls_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c ../lib/gen_epoll_ctls_h-gen_tables.obj: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_epoll_ctls_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_epoll_ctls_h-gen_tables.obj -MD -MP -MF ../lib/$(DEPDIR)/gen_epoll_ctls_h-gen_tables.Tpo -c -o ../lib/gen_epoll_ctls_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_epoll_ctls_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_epoll_ctls_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_epoll_ctls_h-gen_tables.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_epoll_ctls_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_epoll_ctls_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` ../lib/gen_famtabs_h-gen_tables.o: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_famtabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_famtabs_h-gen_tables.o -MD -MP -MF ../lib/$(DEPDIR)/gen_famtabs_h-gen_tables.Tpo -c -o ../lib/gen_famtabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_famtabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_famtabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_famtabs_h-gen_tables.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_famtabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_famtabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c ../lib/gen_famtabs_h-gen_tables.obj: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_famtabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_famtabs_h-gen_tables.obj -MD -MP -MF ../lib/$(DEPDIR)/gen_famtabs_h-gen_tables.Tpo -c -o ../lib/gen_famtabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_famtabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_famtabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_famtabs_h-gen_tables.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_famtabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_famtabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` ../lib/gen_fcntl_cmdtabs_h-gen_tables.o: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_fcntl_cmdtabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_fcntl_cmdtabs_h-gen_tables.o -MD -MP -MF ../lib/$(DEPDIR)/gen_fcntl_cmdtabs_h-gen_tables.Tpo -c -o ../lib/gen_fcntl_cmdtabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_fcntl_cmdtabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_fcntl_cmdtabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_fcntl_cmdtabs_h-gen_tables.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_fcntl_cmdtabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_fcntl_cmdtabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c ../lib/gen_fcntl_cmdtabs_h-gen_tables.obj: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_fcntl_cmdtabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_fcntl_cmdtabs_h-gen_tables.obj -MD -MP -MF ../lib/$(DEPDIR)/gen_fcntl_cmdtabs_h-gen_tables.Tpo -c -o ../lib/gen_fcntl_cmdtabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_fcntl_cmdtabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_fcntl_cmdtabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_fcntl_cmdtabs_h-gen_tables.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_fcntl_cmdtabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_fcntl_cmdtabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` ../lib/gen_flagtabs_h-gen_tables.o: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_flagtabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_flagtabs_h-gen_tables.o -MD -MP -MF ../lib/$(DEPDIR)/gen_flagtabs_h-gen_tables.Tpo -c -o ../lib/gen_flagtabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_flagtabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_flagtabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_flagtabs_h-gen_tables.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_flagtabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_flagtabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c ../lib/gen_flagtabs_h-gen_tables.obj: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_flagtabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_flagtabs_h-gen_tables.obj -MD -MP -MF ../lib/$(DEPDIR)/gen_flagtabs_h-gen_tables.Tpo -c -o ../lib/gen_flagtabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_flagtabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_flagtabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_flagtabs_h-gen_tables.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_flagtabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_flagtabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` ../lib/gen_fsconfigs_h-gen_tables.o: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_fsconfigs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_fsconfigs_h-gen_tables.o -MD -MP -MF ../lib/$(DEPDIR)/gen_fsconfigs_h-gen_tables.Tpo -c -o ../lib/gen_fsconfigs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_fsconfigs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_fsconfigs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_fsconfigs_h-gen_tables.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_fsconfigs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_fsconfigs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c ../lib/gen_fsconfigs_h-gen_tables.obj: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_fsconfigs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_fsconfigs_h-gen_tables.obj -MD -MP -MF ../lib/$(DEPDIR)/gen_fsconfigs_h-gen_tables.Tpo -c -o ../lib/gen_fsconfigs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_fsconfigs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_fsconfigs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_fsconfigs_h-gen_tables.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_fsconfigs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_fsconfigs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` ../lib/gen_icmptypetabs_h-gen_tables.o: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_icmptypetabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_icmptypetabs_h-gen_tables.o -MD -MP -MF ../lib/$(DEPDIR)/gen_icmptypetabs_h-gen_tables.Tpo -c -o ../lib/gen_icmptypetabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_icmptypetabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_icmptypetabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_icmptypetabs_h-gen_tables.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_icmptypetabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_icmptypetabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c ../lib/gen_icmptypetabs_h-gen_tables.obj: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_icmptypetabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_icmptypetabs_h-gen_tables.obj -MD -MP -MF ../lib/$(DEPDIR)/gen_icmptypetabs_h-gen_tables.Tpo -c -o ../lib/gen_icmptypetabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_icmptypetabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_icmptypetabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_icmptypetabs_h-gen_tables.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_icmptypetabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_icmptypetabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` ../lib/gen_inethooktabs_h-gen_tables.o: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_inethooktabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_inethooktabs_h-gen_tables.o -MD -MP -MF ../lib/$(DEPDIR)/gen_inethooktabs_h-gen_tables.Tpo -c -o ../lib/gen_inethooktabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_inethooktabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_inethooktabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_inethooktabs_h-gen_tables.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_inethooktabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_inethooktabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c ../lib/gen_inethooktabs_h-gen_tables.obj: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_inethooktabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_inethooktabs_h-gen_tables.obj -MD -MP -MF ../lib/$(DEPDIR)/gen_inethooktabs_h-gen_tables.Tpo -c -o ../lib/gen_inethooktabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_inethooktabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_inethooktabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_inethooktabs_h-gen_tables.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_inethooktabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_inethooktabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` ../lib/gen_ioctlreqtabs_h-gen_tables.o: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_ioctlreqtabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_ioctlreqtabs_h-gen_tables.o -MD -MP -MF ../lib/$(DEPDIR)/gen_ioctlreqtabs_h-gen_tables.Tpo -c -o ../lib/gen_ioctlreqtabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_ioctlreqtabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_ioctlreqtabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_ioctlreqtabs_h-gen_tables.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_ioctlreqtabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_ioctlreqtabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c ../lib/gen_ioctlreqtabs_h-gen_tables.obj: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_ioctlreqtabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_ioctlreqtabs_h-gen_tables.obj -MD -MP -MF ../lib/$(DEPDIR)/gen_ioctlreqtabs_h-gen_tables.Tpo -c -o ../lib/gen_ioctlreqtabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_ioctlreqtabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_ioctlreqtabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_ioctlreqtabs_h-gen_tables.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_ioctlreqtabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_ioctlreqtabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` ../lib/gen_ip6optnametabs_h-gen_tables.o: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_ip6optnametabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_ip6optnametabs_h-gen_tables.o -MD -MP -MF ../lib/$(DEPDIR)/gen_ip6optnametabs_h-gen_tables.Tpo -c -o ../lib/gen_ip6optnametabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_ip6optnametabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_ip6optnametabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_ip6optnametabs_h-gen_tables.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_ip6optnametabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_ip6optnametabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c ../lib/gen_ip6optnametabs_h-gen_tables.obj: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_ip6optnametabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_ip6optnametabs_h-gen_tables.obj -MD -MP -MF ../lib/$(DEPDIR)/gen_ip6optnametabs_h-gen_tables.Tpo -c -o ../lib/gen_ip6optnametabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_ip6optnametabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_ip6optnametabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_ip6optnametabs_h-gen_tables.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_ip6optnametabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_ip6optnametabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` ../lib/gen_ipccmdtabs_h-gen_tables.o: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_ipccmdtabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_ipccmdtabs_h-gen_tables.o -MD -MP -MF ../lib/$(DEPDIR)/gen_ipccmdtabs_h-gen_tables.Tpo -c -o ../lib/gen_ipccmdtabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_ipccmdtabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_ipccmdtabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_ipccmdtabs_h-gen_tables.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_ipccmdtabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_ipccmdtabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c ../lib/gen_ipccmdtabs_h-gen_tables.obj: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_ipccmdtabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_ipccmdtabs_h-gen_tables.obj -MD -MP -MF ../lib/$(DEPDIR)/gen_ipccmdtabs_h-gen_tables.Tpo -c -o ../lib/gen_ipccmdtabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_ipccmdtabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_ipccmdtabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_ipccmdtabs_h-gen_tables.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_ipccmdtabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_ipccmdtabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` ../lib/gen_ipctabs_h-gen_tables.o: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_ipctabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_ipctabs_h-gen_tables.o -MD -MP -MF ../lib/$(DEPDIR)/gen_ipctabs_h-gen_tables.Tpo -c -o ../lib/gen_ipctabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_ipctabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_ipctabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_ipctabs_h-gen_tables.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_ipctabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_ipctabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c ../lib/gen_ipctabs_h-gen_tables.obj: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_ipctabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_ipctabs_h-gen_tables.obj -MD -MP -MF ../lib/$(DEPDIR)/gen_ipctabs_h-gen_tables.Tpo -c -o ../lib/gen_ipctabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_ipctabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_ipctabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_ipctabs_h-gen_tables.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_ipctabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_ipctabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` ../lib/gen_ipoptnametabs_h-gen_tables.o: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_ipoptnametabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_ipoptnametabs_h-gen_tables.o -MD -MP -MF ../lib/$(DEPDIR)/gen_ipoptnametabs_h-gen_tables.Tpo -c -o ../lib/gen_ipoptnametabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_ipoptnametabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_ipoptnametabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_ipoptnametabs_h-gen_tables.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_ipoptnametabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_ipoptnametabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c ../lib/gen_ipoptnametabs_h-gen_tables.obj: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_ipoptnametabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_ipoptnametabs_h-gen_tables.obj -MD -MP -MF ../lib/$(DEPDIR)/gen_ipoptnametabs_h-gen_tables.Tpo -c -o ../lib/gen_ipoptnametabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_ipoptnametabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_ipoptnametabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_ipoptnametabs_h-gen_tables.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_ipoptnametabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_ipoptnametabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` ../lib/gen_mmaptabs_h-gen_tables.o: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_mmaptabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_mmaptabs_h-gen_tables.o -MD -MP -MF ../lib/$(DEPDIR)/gen_mmaptabs_h-gen_tables.Tpo -c -o ../lib/gen_mmaptabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_mmaptabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_mmaptabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_mmaptabs_h-gen_tables.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_mmaptabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_mmaptabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c ../lib/gen_mmaptabs_h-gen_tables.obj: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_mmaptabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_mmaptabs_h-gen_tables.obj -MD -MP -MF ../lib/$(DEPDIR)/gen_mmaptabs_h-gen_tables.Tpo -c -o ../lib/gen_mmaptabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_mmaptabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_mmaptabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_mmaptabs_h-gen_tables.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_mmaptabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_mmaptabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` ../lib/gen_mounttabs_h-gen_tables.o: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_mounttabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_mounttabs_h-gen_tables.o -MD -MP -MF ../lib/$(DEPDIR)/gen_mounttabs_h-gen_tables.Tpo -c -o ../lib/gen_mounttabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_mounttabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_mounttabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_mounttabs_h-gen_tables.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_mounttabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_mounttabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c ../lib/gen_mounttabs_h-gen_tables.obj: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_mounttabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_mounttabs_h-gen_tables.obj -MD -MP -MF ../lib/$(DEPDIR)/gen_mounttabs_h-gen_tables.Tpo -c -o ../lib/gen_mounttabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_mounttabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_mounttabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_mounttabs_h-gen_tables.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_mounttabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_mounttabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` ../lib/gen_netactiontabs_h-gen_tables.o: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_netactiontabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_netactiontabs_h-gen_tables.o -MD -MP -MF ../lib/$(DEPDIR)/gen_netactiontabs_h-gen_tables.Tpo -c -o ../lib/gen_netactiontabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_netactiontabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_netactiontabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_netactiontabs_h-gen_tables.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_netactiontabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_netactiontabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c ../lib/gen_netactiontabs_h-gen_tables.obj: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_netactiontabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_netactiontabs_h-gen_tables.obj -MD -MP -MF ../lib/$(DEPDIR)/gen_netactiontabs_h-gen_tables.Tpo -c -o ../lib/gen_netactiontabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_netactiontabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_netactiontabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_netactiontabs_h-gen_tables.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_netactiontabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_netactiontabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` ../lib/gen_nfprototabs_h-gen_tables.o: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_nfprototabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_nfprototabs_h-gen_tables.o -MD -MP -MF ../lib/$(DEPDIR)/gen_nfprototabs_h-gen_tables.Tpo -c -o ../lib/gen_nfprototabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_nfprototabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_nfprototabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_nfprototabs_h-gen_tables.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_nfprototabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_nfprototabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c ../lib/gen_nfprototabs_h-gen_tables.obj: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_nfprototabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_nfprototabs_h-gen_tables.obj -MD -MP -MF ../lib/$(DEPDIR)/gen_nfprototabs_h-gen_tables.Tpo -c -o ../lib/gen_nfprototabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_nfprototabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_nfprototabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_nfprototabs_h-gen_tables.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_nfprototabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_nfprototabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` ../lib/gen_normalize_evtypetabs_h-gen_tables.o: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_normalize_evtypetabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_normalize_evtypetabs_h-gen_tables.o -MD -MP -MF ../lib/$(DEPDIR)/gen_normalize_evtypetabs_h-gen_tables.Tpo -c -o ../lib/gen_normalize_evtypetabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_normalize_evtypetabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_normalize_evtypetabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_normalize_evtypetabs_h-gen_tables.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_normalize_evtypetabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_normalize_evtypetabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c ../lib/gen_normalize_evtypetabs_h-gen_tables.obj: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_normalize_evtypetabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_normalize_evtypetabs_h-gen_tables.obj -MD -MP -MF ../lib/$(DEPDIR)/gen_normalize_evtypetabs_h-gen_tables.Tpo -c -o ../lib/gen_normalize_evtypetabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_normalize_evtypetabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_normalize_evtypetabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_normalize_evtypetabs_h-gen_tables.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_normalize_evtypetabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_normalize_evtypetabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` ../lib/gen_normalize_obj_kind_map-gen_tables.o: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_normalize_obj_kind_map_CFLAGS) $(CFLAGS) -MT ../lib/gen_normalize_obj_kind_map-gen_tables.o -MD -MP -MF ../lib/$(DEPDIR)/gen_normalize_obj_kind_map-gen_tables.Tpo -c -o ../lib/gen_normalize_obj_kind_map-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_normalize_obj_kind_map-gen_tables.Tpo ../lib/$(DEPDIR)/gen_normalize_obj_kind_map-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_normalize_obj_kind_map-gen_tables.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_normalize_obj_kind_map_CFLAGS) $(CFLAGS) -c -o ../lib/gen_normalize_obj_kind_map-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c ../lib/gen_normalize_obj_kind_map-gen_tables.obj: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_normalize_obj_kind_map_CFLAGS) $(CFLAGS) -MT ../lib/gen_normalize_obj_kind_map-gen_tables.obj -MD -MP -MF ../lib/$(DEPDIR)/gen_normalize_obj_kind_map-gen_tables.Tpo -c -o ../lib/gen_normalize_obj_kind_map-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_normalize_obj_kind_map-gen_tables.Tpo ../lib/$(DEPDIR)/gen_normalize_obj_kind_map-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_normalize_obj_kind_map-gen_tables.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_normalize_obj_kind_map_CFLAGS) $(CFLAGS) -c -o ../lib/gen_normalize_obj_kind_map-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` ../lib/gen_normalize_record_map-gen_tables.o: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_normalize_record_map_CFLAGS) $(CFLAGS) -MT ../lib/gen_normalize_record_map-gen_tables.o -MD -MP -MF ../lib/$(DEPDIR)/gen_normalize_record_map-gen_tables.Tpo -c -o ../lib/gen_normalize_record_map-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_normalize_record_map-gen_tables.Tpo ../lib/$(DEPDIR)/gen_normalize_record_map-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_normalize_record_map-gen_tables.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_normalize_record_map_CFLAGS) $(CFLAGS) -c -o ../lib/gen_normalize_record_map-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c ../lib/gen_normalize_record_map-gen_tables.obj: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_normalize_record_map_CFLAGS) $(CFLAGS) -MT ../lib/gen_normalize_record_map-gen_tables.obj -MD -MP -MF ../lib/$(DEPDIR)/gen_normalize_record_map-gen_tables.Tpo -c -o ../lib/gen_normalize_record_map-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_normalize_record_map-gen_tables.Tpo ../lib/$(DEPDIR)/gen_normalize_record_map-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_normalize_record_map-gen_tables.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_normalize_record_map_CFLAGS) $(CFLAGS) -c -o ../lib/gen_normalize_record_map-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` ../lib/gen_normalize_syscall_map-gen_tables.o: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_normalize_syscall_map_CFLAGS) $(CFLAGS) -MT ../lib/gen_normalize_syscall_map-gen_tables.o -MD -MP -MF ../lib/$(DEPDIR)/gen_normalize_syscall_map-gen_tables.Tpo -c -o ../lib/gen_normalize_syscall_map-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_normalize_syscall_map-gen_tables.Tpo ../lib/$(DEPDIR)/gen_normalize_syscall_map-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_normalize_syscall_map-gen_tables.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_normalize_syscall_map_CFLAGS) $(CFLAGS) -c -o ../lib/gen_normalize_syscall_map-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c ../lib/gen_normalize_syscall_map-gen_tables.obj: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_normalize_syscall_map_CFLAGS) $(CFLAGS) -MT ../lib/gen_normalize_syscall_map-gen_tables.obj -MD -MP -MF ../lib/$(DEPDIR)/gen_normalize_syscall_map-gen_tables.Tpo -c -o ../lib/gen_normalize_syscall_map-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_normalize_syscall_map-gen_tables.Tpo ../lib/$(DEPDIR)/gen_normalize_syscall_map-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_normalize_syscall_map-gen_tables.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_normalize_syscall_map_CFLAGS) $(CFLAGS) -c -o ../lib/gen_normalize_syscall_map-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` ../lib/gen_open_flagtabs_h-gen_tables.o: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_open_flagtabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_open_flagtabs_h-gen_tables.o -MD -MP -MF ../lib/$(DEPDIR)/gen_open_flagtabs_h-gen_tables.Tpo -c -o ../lib/gen_open_flagtabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_open_flagtabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_open_flagtabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_open_flagtabs_h-gen_tables.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_open_flagtabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_open_flagtabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c ../lib/gen_open_flagtabs_h-gen_tables.obj: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_open_flagtabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_open_flagtabs_h-gen_tables.obj -MD -MP -MF ../lib/$(DEPDIR)/gen_open_flagtabs_h-gen_tables.Tpo -c -o ../lib/gen_open_flagtabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_open_flagtabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_open_flagtabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_open_flagtabs_h-gen_tables.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_open_flagtabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_open_flagtabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` ../lib/gen_openat2_resolvetabs_h-gen_tables.o: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_openat2_resolvetabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_openat2_resolvetabs_h-gen_tables.o -MD -MP -MF ../lib/$(DEPDIR)/gen_openat2_resolvetabs_h-gen_tables.Tpo -c -o ../lib/gen_openat2_resolvetabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_openat2_resolvetabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_openat2_resolvetabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_openat2_resolvetabs_h-gen_tables.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_openat2_resolvetabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_openat2_resolvetabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c ../lib/gen_openat2_resolvetabs_h-gen_tables.obj: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_openat2_resolvetabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_openat2_resolvetabs_h-gen_tables.obj -MD -MP -MF ../lib/$(DEPDIR)/gen_openat2_resolvetabs_h-gen_tables.Tpo -c -o ../lib/gen_openat2_resolvetabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_openat2_resolvetabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_openat2_resolvetabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_openat2_resolvetabs_h-gen_tables.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_openat2_resolvetabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_openat2_resolvetabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` ../lib/gen_persontabs_h-gen_tables.o: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_persontabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_persontabs_h-gen_tables.o -MD -MP -MF ../lib/$(DEPDIR)/gen_persontabs_h-gen_tables.Tpo -c -o ../lib/gen_persontabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_persontabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_persontabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_persontabs_h-gen_tables.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_persontabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_persontabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c ../lib/gen_persontabs_h-gen_tables.obj: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_persontabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_persontabs_h-gen_tables.obj -MD -MP -MF ../lib/$(DEPDIR)/gen_persontabs_h-gen_tables.Tpo -c -o ../lib/gen_persontabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_persontabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_persontabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_persontabs_h-gen_tables.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_persontabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_persontabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` ../lib/gen_pktoptnametabs_h-gen_tables.o: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_pktoptnametabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_pktoptnametabs_h-gen_tables.o -MD -MP -MF ../lib/$(DEPDIR)/gen_pktoptnametabs_h-gen_tables.Tpo -c -o ../lib/gen_pktoptnametabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_pktoptnametabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_pktoptnametabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_pktoptnametabs_h-gen_tables.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_pktoptnametabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_pktoptnametabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c ../lib/gen_pktoptnametabs_h-gen_tables.obj: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_pktoptnametabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_pktoptnametabs_h-gen_tables.obj -MD -MP -MF ../lib/$(DEPDIR)/gen_pktoptnametabs_h-gen_tables.Tpo -c -o ../lib/gen_pktoptnametabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_pktoptnametabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_pktoptnametabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_pktoptnametabs_h-gen_tables.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_pktoptnametabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_pktoptnametabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` ../lib/gen_prctl_opttabs_h-gen_tables.o: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_prctl_opttabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_prctl_opttabs_h-gen_tables.o -MD -MP -MF ../lib/$(DEPDIR)/gen_prctl_opttabs_h-gen_tables.Tpo -c -o ../lib/gen_prctl_opttabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_prctl_opttabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_prctl_opttabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_prctl_opttabs_h-gen_tables.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_prctl_opttabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_prctl_opttabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c ../lib/gen_prctl_opttabs_h-gen_tables.obj: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_prctl_opttabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_prctl_opttabs_h-gen_tables.obj -MD -MP -MF ../lib/$(DEPDIR)/gen_prctl_opttabs_h-gen_tables.Tpo -c -o ../lib/gen_prctl_opttabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_prctl_opttabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_prctl_opttabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_prctl_opttabs_h-gen_tables.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_prctl_opttabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_prctl_opttabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` ../lib/gen_prottabs_h-gen_tables.o: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_prottabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_prottabs_h-gen_tables.o -MD -MP -MF ../lib/$(DEPDIR)/gen_prottabs_h-gen_tables.Tpo -c -o ../lib/gen_prottabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_prottabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_prottabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_prottabs_h-gen_tables.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_prottabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_prottabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c ../lib/gen_prottabs_h-gen_tables.obj: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_prottabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_prottabs_h-gen_tables.obj -MD -MP -MF ../lib/$(DEPDIR)/gen_prottabs_h-gen_tables.Tpo -c -o ../lib/gen_prottabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_prottabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_prottabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_prottabs_h-gen_tables.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_prottabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_prottabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` ../lib/gen_ptracetabs_h-gen_tables.o: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_ptracetabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_ptracetabs_h-gen_tables.o -MD -MP -MF ../lib/$(DEPDIR)/gen_ptracetabs_h-gen_tables.Tpo -c -o ../lib/gen_ptracetabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_ptracetabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_ptracetabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_ptracetabs_h-gen_tables.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_ptracetabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_ptracetabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c ../lib/gen_ptracetabs_h-gen_tables.obj: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_ptracetabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_ptracetabs_h-gen_tables.obj -MD -MP -MF ../lib/$(DEPDIR)/gen_ptracetabs_h-gen_tables.Tpo -c -o ../lib/gen_ptracetabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_ptracetabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_ptracetabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_ptracetabs_h-gen_tables.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_ptracetabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_ptracetabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` ../lib/gen_recvtabs_h-gen_tables.o: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_recvtabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_recvtabs_h-gen_tables.o -MD -MP -MF ../lib/$(DEPDIR)/gen_recvtabs_h-gen_tables.Tpo -c -o ../lib/gen_recvtabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_recvtabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_recvtabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_recvtabs_h-gen_tables.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_recvtabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_recvtabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c ../lib/gen_recvtabs_h-gen_tables.obj: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_recvtabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_recvtabs_h-gen_tables.obj -MD -MP -MF ../lib/$(DEPDIR)/gen_recvtabs_h-gen_tables.Tpo -c -o ../lib/gen_recvtabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_recvtabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_recvtabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_recvtabs_h-gen_tables.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_recvtabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_recvtabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` ../lib/gen_rlimit_h-gen_tables.o: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_rlimit_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_rlimit_h-gen_tables.o -MD -MP -MF ../lib/$(DEPDIR)/gen_rlimit_h-gen_tables.Tpo -c -o ../lib/gen_rlimit_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_rlimit_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_rlimit_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_rlimit_h-gen_tables.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_rlimit_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_rlimit_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c ../lib/gen_rlimit_h-gen_tables.obj: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_rlimit_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_rlimit_h-gen_tables.obj -MD -MP -MF ../lib/$(DEPDIR)/gen_rlimit_h-gen_tables.Tpo -c -o ../lib/gen_rlimit_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_rlimit_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_rlimit_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_rlimit_h-gen_tables.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_rlimit_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_rlimit_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` ../lib/gen_schedtabs_h-gen_tables.o: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_schedtabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_schedtabs_h-gen_tables.o -MD -MP -MF ../lib/$(DEPDIR)/gen_schedtabs_h-gen_tables.Tpo -c -o ../lib/gen_schedtabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_schedtabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_schedtabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_schedtabs_h-gen_tables.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_schedtabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_schedtabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c ../lib/gen_schedtabs_h-gen_tables.obj: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_schedtabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_schedtabs_h-gen_tables.obj -MD -MP -MF ../lib/$(DEPDIR)/gen_schedtabs_h-gen_tables.Tpo -c -o ../lib/gen_schedtabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_schedtabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_schedtabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_schedtabs_h-gen_tables.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_schedtabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_schedtabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` ../lib/gen_seccomptabs_h-gen_tables.o: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_seccomptabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_seccomptabs_h-gen_tables.o -MD -MP -MF ../lib/$(DEPDIR)/gen_seccomptabs_h-gen_tables.Tpo -c -o ../lib/gen_seccomptabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_seccomptabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_seccomptabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_seccomptabs_h-gen_tables.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_seccomptabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_seccomptabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c ../lib/gen_seccomptabs_h-gen_tables.obj: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_seccomptabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_seccomptabs_h-gen_tables.obj -MD -MP -MF ../lib/$(DEPDIR)/gen_seccomptabs_h-gen_tables.Tpo -c -o ../lib/gen_seccomptabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_seccomptabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_seccomptabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_seccomptabs_h-gen_tables.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_seccomptabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_seccomptabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` ../lib/gen_seektabs_h-gen_tables.o: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_seektabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_seektabs_h-gen_tables.o -MD -MP -MF ../lib/$(DEPDIR)/gen_seektabs_h-gen_tables.Tpo -c -o ../lib/gen_seektabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_seektabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_seektabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_seektabs_h-gen_tables.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_seektabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_seektabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c ../lib/gen_seektabs_h-gen_tables.obj: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_seektabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_seektabs_h-gen_tables.obj -MD -MP -MF ../lib/$(DEPDIR)/gen_seektabs_h-gen_tables.Tpo -c -o ../lib/gen_seektabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_seektabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_seektabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_seektabs_h-gen_tables.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_seektabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_seektabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` ../lib/gen_shm_modetabs_h-gen_tables.o: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_shm_modetabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_shm_modetabs_h-gen_tables.o -MD -MP -MF ../lib/$(DEPDIR)/gen_shm_modetabs_h-gen_tables.Tpo -c -o ../lib/gen_shm_modetabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_shm_modetabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_shm_modetabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_shm_modetabs_h-gen_tables.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_shm_modetabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_shm_modetabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c ../lib/gen_shm_modetabs_h-gen_tables.obj: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_shm_modetabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_shm_modetabs_h-gen_tables.obj -MD -MP -MF ../lib/$(DEPDIR)/gen_shm_modetabs_h-gen_tables.Tpo -c -o ../lib/gen_shm_modetabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_shm_modetabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_shm_modetabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_shm_modetabs_h-gen_tables.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_shm_modetabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_shm_modetabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` ../lib/gen_signals_h-gen_tables.o: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_signals_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_signals_h-gen_tables.o -MD -MP -MF ../lib/$(DEPDIR)/gen_signals_h-gen_tables.Tpo -c -o ../lib/gen_signals_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_signals_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_signals_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_signals_h-gen_tables.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_signals_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_signals_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c ../lib/gen_signals_h-gen_tables.obj: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_signals_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_signals_h-gen_tables.obj -MD -MP -MF ../lib/$(DEPDIR)/gen_signals_h-gen_tables.Tpo -c -o ../lib/gen_signals_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_signals_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_signals_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_signals_h-gen_tables.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_signals_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_signals_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` ../lib/gen_sockleveltabs_h-gen_tables.o: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_sockleveltabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_sockleveltabs_h-gen_tables.o -MD -MP -MF ../lib/$(DEPDIR)/gen_sockleveltabs_h-gen_tables.Tpo -c -o ../lib/gen_sockleveltabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_sockleveltabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_sockleveltabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_sockleveltabs_h-gen_tables.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_sockleveltabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_sockleveltabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c ../lib/gen_sockleveltabs_h-gen_tables.obj: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_sockleveltabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_sockleveltabs_h-gen_tables.obj -MD -MP -MF ../lib/$(DEPDIR)/gen_sockleveltabs_h-gen_tables.Tpo -c -o ../lib/gen_sockleveltabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_sockleveltabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_sockleveltabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_sockleveltabs_h-gen_tables.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_sockleveltabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_sockleveltabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` ../lib/gen_sockoptnametabs_h-gen_tables.o: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_sockoptnametabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_sockoptnametabs_h-gen_tables.o -MD -MP -MF ../lib/$(DEPDIR)/gen_sockoptnametabs_h-gen_tables.Tpo -c -o ../lib/gen_sockoptnametabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_sockoptnametabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_sockoptnametabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_sockoptnametabs_h-gen_tables.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_sockoptnametabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_sockoptnametabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c ../lib/gen_sockoptnametabs_h-gen_tables.obj: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_sockoptnametabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_sockoptnametabs_h-gen_tables.obj -MD -MP -MF ../lib/$(DEPDIR)/gen_sockoptnametabs_h-gen_tables.Tpo -c -o ../lib/gen_sockoptnametabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_sockoptnametabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_sockoptnametabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_sockoptnametabs_h-gen_tables.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_sockoptnametabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_sockoptnametabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` ../lib/gen_socktabs_h-gen_tables.o: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_socktabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_socktabs_h-gen_tables.o -MD -MP -MF ../lib/$(DEPDIR)/gen_socktabs_h-gen_tables.Tpo -c -o ../lib/gen_socktabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_socktabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_socktabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_socktabs_h-gen_tables.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_socktabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_socktabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c ../lib/gen_socktabs_h-gen_tables.obj: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_socktabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_socktabs_h-gen_tables.obj -MD -MP -MF ../lib/$(DEPDIR)/gen_socktabs_h-gen_tables.Tpo -c -o ../lib/gen_socktabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_socktabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_socktabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_socktabs_h-gen_tables.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_socktabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_socktabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` ../lib/gen_socktypetabs_h-gen_tables.o: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_socktypetabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_socktypetabs_h-gen_tables.o -MD -MP -MF ../lib/$(DEPDIR)/gen_socktypetabs_h-gen_tables.Tpo -c -o ../lib/gen_socktypetabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_socktypetabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_socktypetabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_socktypetabs_h-gen_tables.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_socktypetabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_socktypetabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c ../lib/gen_socktypetabs_h-gen_tables.obj: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_socktypetabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_socktypetabs_h-gen_tables.obj -MD -MP -MF ../lib/$(DEPDIR)/gen_socktypetabs_h-gen_tables.Tpo -c -o ../lib/gen_socktypetabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_socktypetabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_socktypetabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_socktypetabs_h-gen_tables.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_socktypetabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_socktypetabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` ../lib/gen_tcpoptnametabs_h-gen_tables.o: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_tcpoptnametabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_tcpoptnametabs_h-gen_tables.o -MD -MP -MF ../lib/$(DEPDIR)/gen_tcpoptnametabs_h-gen_tables.Tpo -c -o ../lib/gen_tcpoptnametabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_tcpoptnametabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_tcpoptnametabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_tcpoptnametabs_h-gen_tables.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_tcpoptnametabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_tcpoptnametabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c ../lib/gen_tcpoptnametabs_h-gen_tables.obj: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_tcpoptnametabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_tcpoptnametabs_h-gen_tables.obj -MD -MP -MF ../lib/$(DEPDIR)/gen_tcpoptnametabs_h-gen_tables.Tpo -c -o ../lib/gen_tcpoptnametabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_tcpoptnametabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_tcpoptnametabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_tcpoptnametabs_h-gen_tables.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_tcpoptnametabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_tcpoptnametabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` ../lib/gen_typetabs_h-gen_tables.o: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_typetabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_typetabs_h-gen_tables.o -MD -MP -MF ../lib/$(DEPDIR)/gen_typetabs_h-gen_tables.Tpo -c -o ../lib/gen_typetabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_typetabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_typetabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_typetabs_h-gen_tables.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_typetabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_typetabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c ../lib/gen_typetabs_h-gen_tables.obj: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_typetabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_typetabs_h-gen_tables.obj -MD -MP -MF ../lib/$(DEPDIR)/gen_typetabs_h-gen_tables.Tpo -c -o ../lib/gen_typetabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_typetabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_typetabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_typetabs_h-gen_tables.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_typetabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_typetabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` ../lib/gen_umounttabs_h-gen_tables.o: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_umounttabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_umounttabs_h-gen_tables.o -MD -MP -MF ../lib/$(DEPDIR)/gen_umounttabs_h-gen_tables.Tpo -c -o ../lib/gen_umounttabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_umounttabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_umounttabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_umounttabs_h-gen_tables.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_umounttabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_umounttabs_h-gen_tables.o `test -f '../lib/gen_tables.c' || echo '$(srcdir)/'`../lib/gen_tables.c ../lib/gen_umounttabs_h-gen_tables.obj: ../lib/gen_tables.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_umounttabs_h_CFLAGS) $(CFLAGS) -MT ../lib/gen_umounttabs_h-gen_tables.obj -MD -MP -MF ../lib/$(DEPDIR)/gen_umounttabs_h-gen_tables.Tpo -c -o ../lib/gen_umounttabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../lib/$(DEPDIR)/gen_umounttabs_h-gen_tables.Tpo ../lib/$(DEPDIR)/gen_umounttabs_h-gen_tables.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../lib/gen_tables.c' object='../lib/gen_umounttabs_h-gen_tables.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gen_umounttabs_h_CFLAGS) $(CFLAGS) -c -o ../lib/gen_umounttabs_h-gen_tables.obj `if test -f '../lib/gen_tables.c'; then $(CYGPATH_W) '../lib/gen_tables.c'; else $(CYGPATH_W) '$(srcdir)/../lib/gen_tables.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-recursive all-am: Makefile $(PROGRAMS) $(LTLIBRARIES) $(DATA) $(HEADERS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-recursive install-exec: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f ../lib/$(DEPDIR)/$(am__dirstamp) -rm -f ../lib/$(am__dirstamp) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-recursive clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ clean-noinstPROGRAMS mostlyclean-am distclean: distclean-recursive -rm -f ../lib/$(DEPDIR)/gen_accesstabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_bpftabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_captabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_clock_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_clone_flagtabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_epoll_ctls_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_famtabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_fcntl_cmdtabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_flagtabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_fsconfigs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_icmptypetabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_inethooktabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_ioctlreqtabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_ip6optnametabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_ipccmdtabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_ipctabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_ipoptnametabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_mmaptabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_mounttabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_netactiontabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_nfprototabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_normalize_evtypetabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_normalize_obj_kind_map-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_normalize_record_map-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_normalize_syscall_map-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_open_flagtabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_openat2_resolvetabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_persontabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_pktoptnametabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_prctl_opttabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_prottabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_ptracetabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_recvtabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_rlimit_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_schedtabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_seccomptabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_seektabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_shm_modetabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_signals_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_sockleveltabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_sockoptnametabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_socktabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_socktypetabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_tcpoptnametabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_typetabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_umounttabs_h-gen_tables.Po -rm -f ./$(DEPDIR)/auditd-config.Plo -rm -f ./$(DEPDIR)/auparse.Plo -rm -f ./$(DEPDIR)/data_buf.Plo -rm -f ./$(DEPDIR)/ellist.Plo -rm -f ./$(DEPDIR)/expression.Plo -rm -f ./$(DEPDIR)/interpret.Plo -rm -f ./$(DEPDIR)/lru.Plo -rm -f ./$(DEPDIR)/message.Plo -rm -f ./$(DEPDIR)/normalize-llist.Plo -rm -f ./$(DEPDIR)/normalize.Plo -rm -f ./$(DEPDIR)/nvlist.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-includeHEADERS install-pkgconfigDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f ../lib/$(DEPDIR)/gen_accesstabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_bpftabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_captabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_clock_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_clone_flagtabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_epoll_ctls_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_famtabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_fcntl_cmdtabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_flagtabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_fsconfigs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_icmptypetabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_inethooktabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_ioctlreqtabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_ip6optnametabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_ipccmdtabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_ipctabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_ipoptnametabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_mmaptabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_mounttabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_netactiontabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_nfprototabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_normalize_evtypetabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_normalize_obj_kind_map-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_normalize_record_map-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_normalize_syscall_map-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_open_flagtabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_openat2_resolvetabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_persontabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_pktoptnametabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_prctl_opttabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_prottabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_ptracetabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_recvtabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_rlimit_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_schedtabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_seccomptabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_seektabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_shm_modetabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_signals_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_sockleveltabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_sockoptnametabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_socktabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_socktypetabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_tcpoptnametabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_typetabs_h-gen_tables.Po -rm -f ../lib/$(DEPDIR)/gen_umounttabs_h-gen_tables.Po -rm -f ./$(DEPDIR)/auditd-config.Plo -rm -f ./$(DEPDIR)/auparse.Plo -rm -f ./$(DEPDIR)/data_buf.Plo -rm -f ./$(DEPDIR)/ellist.Plo -rm -f ./$(DEPDIR)/expression.Plo -rm -f ./$(DEPDIR)/interpret.Plo -rm -f ./$(DEPDIR)/lru.Plo -rm -f ./$(DEPDIR)/message.Plo -rm -f ./$(DEPDIR)/normalize-llist.Plo -rm -f ./$(DEPDIR)/normalize.Plo -rm -f ./$(DEPDIR)/nvlist.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES \ uninstall-pkgconfigDATA .MAKE: $(am__recursive_targets) all check install install-am \ install-exec install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--depfiles check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool clean-noinstPROGRAMS \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-includeHEADERS install-info install-info-am \ install-libLTLIBRARIES install-man install-pdf install-pdf-am \ install-pkgconfigDATA install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-includeHEADERS uninstall-libLTLIBRARIES \ uninstall-pkgconfigDATA .PRECIOUS: Makefile message.c: cp ${top_srcdir}/lib/message.c . $(gen_accesstabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_accesstabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_accesstabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_accesstabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_accesstabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_accesstabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_accesstabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_accesstabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) accesstabs.h: gen_accesstabs_h Makefile ./gen_accesstabs_h --i2s-transtab access > $@ $(gen_captabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_captabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_captabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_captabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_captabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_captabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_captabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_captabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) captabs.h: gen_captabs_h Makefile ./gen_captabs_h --i2s cap > $@ $(gen_clock_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_clock_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_clock_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_clock_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_clock_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_clock_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_clock_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_clock_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) clocktabs.h: gen_clock_h Makefile ./gen_clock_h --i2s clock > $@ $(gen_clone_flagtabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_clone_flagtabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_clone_flagtabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_clone_flagtabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_clone-flagtabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_clone-flagtabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_clone-flagtabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_clone-flagtabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) clone-flagtabs.h: gen_clone-flagtabs_h Makefile ./gen_clone-flagtabs_h --i2s-transtab clone_flag > $@ $(gen_epoll_ctls_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_epoll_ctls_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_epoll_ctls_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_epoll_ctls_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_epoll_ctls_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_epoll_ctls_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_epoll_ctls_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_epoll_ctls_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) epoll_ctls.h: gen_epoll_ctls_h Makefile ./gen_epoll_ctls_h --i2s epoll_ctl > $@ $(gen_famtabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_famtabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_famtabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_famtabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_famtabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_famtabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_famtabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_famtabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) famtabs.h: gen_famtabs_h Makefile ./gen_famtabs_h --i2s fam > $@ $(gen_flagtabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_flagtabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_flagtabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_flagtabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_flagtabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_flagtabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_flagtabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_flagtabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) flagtabs.h: gen_flagtabs_h Makefile ./gen_flagtabs_h --i2s-transtab flag > $@ $(gen_fcntl_cmdtabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_fcntl_cmdtabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_fcntl_cmdtabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_fcntl_cmdtabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_fcntl-cmdtabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_fcntl-cmdtabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_fcntl-cmdtabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_fcntl-cmdtabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) fcntl-cmdtabs.h: gen_fcntl-cmdtabs_h Makefile ./gen_fcntl-cmdtabs_h --i2s fcntl > $@ $(gen_fsconfigs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_fsconfigs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_fsconfigs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_fsconfigs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_fsconfigs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_fsconfigs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_fsconfigs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_fsconfigs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) fsconfigs.h: gen_fsconfigs_h Makefile ./gen_fsconfigs_h --i2s fsconfig > $@ $(gen_icmptypetabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_icmptypetabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_icmptypetabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_icmptypetabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_icmptypetabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_icmptypetabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_icmptypetabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_icmptypetabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) icmptypetabs.h: gen_icmptypetabs_h Makefile ./gen_icmptypetabs_h --i2s icmptype > $@ $(gen_ioctlreqtabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_ioctlreqtabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_ioctlreqtabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_ioctlreqtabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_ioctlreqtabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_ioctlreqtabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_ioctlreqtabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_ioctlreqtabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) ioctlreqtabs.h: gen_ioctlreqtabs_h Makefile ./gen_ioctlreqtabs_h --i2s ioctlreq > $@ $(gen_ipctabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_ipctabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_ipctabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_ipctabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_ipctabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_ipctabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_ipctabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_ipctabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) ipctabs.h: gen_ipctabs_h Makefile ./gen_ipctabs_h --i2s ipc > $@ $(gen_ipccmdtabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_ipccmdtabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_ipccmdtabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_ipccmdtabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_ipccmdtabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_ipccmdtabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_ipccmdtabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_ipccmdtabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) ipccmdtabs.h: gen_ipccmdtabs_h Makefile ./gen_ipccmdtabs_h --i2s-transtab ipccmd > $@ $(gen_ipoptnametabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_ipoptnametabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_ipoptnametabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_ipoptnametabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_ipoptnametabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_ipoptnametabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_ipoptnametabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_ipoptnametabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) ipoptnametabs.h: gen_ipoptnametabs_h Makefile ./gen_ipoptnametabs_h --i2s ipoptname > $@ $(gen_ip6optnametabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_ip6optnametabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_ip6optnametabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_ip6optnametabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_ip6optnametabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_ip6optnametabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_ip6optnametabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_ip6optnametabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) ip6optnametabs.h: gen_ip6optnametabs_h Makefile ./gen_ip6optnametabs_h --i2s ip6optname > $@ $(gen_mmaptabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_mmaptabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_mmaptabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_mmaptabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_mmaptabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_mmaptabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_mmaptabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_mmaptabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) mmaptabs.h: gen_mmaptabs_h Makefile ./gen_mmaptabs_h --i2s-transtab mmap > $@ $(gen_mounttabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_mounttabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_mounttabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_mounttabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_mounttabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_mounttabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_mounttabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_mounttabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) mounttabs.h: gen_mounttabs_h Makefile ./gen_mounttabs_h --i2s-transtab mount > $@ $(gen_nfprototabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_nfprototabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_nfprototabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_nfprototabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_nfprototabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_nfprototabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_nfprototabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_nfprototabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) nfprototabs.h: gen_nfprototabs_h Makefile ./gen_nfprototabs_h --i2s nfproto > $@ $(gen_open_flagtabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_open_flagtabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_open_flagtabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_open_flagtabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_open-flagtabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_open-flagtabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_open-flagtabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_open-flagtabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) open-flagtabs.h: gen_open-flagtabs_h Makefile ./gen_open-flagtabs_h --i2s-transtab open_flag > $@ $(gen_persontabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_persontabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_persontabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_persontabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_persontabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_persontabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_persontabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_persontabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) persontabs.h: gen_persontabs_h Makefile ./gen_persontabs_h --i2s person > $@ $(gen_ptracetabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_ptracetabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_ptracetabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_ptracetabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_ptracetabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_ptracetabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_ptracetabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_ptracetabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) ptracetabs.h: gen_ptracetabs_h Makefile ./gen_ptracetabs_h --i2s ptrace > $@ $(gen_prctl_opttabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_prctl_opttabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_prctl_opttabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_prctl_opttabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_prctl_opttabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_prctl_opttabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_prctl_opttabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_prctl_opttabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) prctl_opttabs.h: gen_prctl_opttabs_h Makefile ./gen_prctl_opttabs_h --i2s prctl_opt > $@ $(gen_pktoptnametabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_pktoptnametabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_pktoptnametabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_pktoptnametabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_pktoptnametabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_pktoptnametabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_pktoptnametabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_pktoptnametabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) pktoptnametabs.h: gen_pktoptnametabs_h Makefile ./gen_pktoptnametabs_h --i2s pktoptname > $@ $(gen_prottabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_prottabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_prottabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_prottabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_prottabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_prottabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_prottabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_prottabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) prottabs.h: gen_prottabs_h Makefile ./gen_prottabs_h --i2s-transtab prot > $@ $(gen_recvtabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_recvtabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_recvtabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_recvtabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_recvtabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_recvtabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_recvtabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_recvtabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) recvtabs.h: gen_recvtabs_h Makefile ./gen_recvtabs_h --i2s-transtab recv > $@ $(gen_rlimit_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_rlimit_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_rlimit_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_rlimit_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_rlimit_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_rlimit_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_rlimit_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_rlimit_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) rlimittabs.h: gen_rlimit_h Makefile ./gen_rlimit_h --i2s rlimit > $@ $(gen_schedtabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_schedtabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_schedtabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_schedtabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_schedtabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_schedtabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_schedtabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_schedtabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) schedtabs.h: gen_schedtabs_h Makefile ./gen_schedtabs_h --i2s sched > $@ $(gen_seccomptabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_seccomptabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_seccomptabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_seccomptabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_seccomptabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_seccomptabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_seccomptabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_seccomptabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) seccomptabs.h: gen_seccomptabs_h Makefile ./gen_seccomptabs_h --i2s seccomp > $@ $(gen_seektabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_seektabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_seektabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_seektabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_seektabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_seektabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_seektabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_seektabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) seektabs.h: gen_seektabs_h Makefile ./gen_seektabs_h --i2s seek > $@ $(gen_shm_modetabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_shm_modetabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_shm_modetabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_shm_modetabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_shm_modetabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_shm_modetabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_shm_modetabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_shm_modetabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) shm_modetabs.h: gen_shm_modetabs_h Makefile ./gen_shm_modetabs_h --i2s-transtab shm_mode > $@ $(gen_signals_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_signals_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_signals_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_signals_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_signals_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_signals_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_signals_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_signals_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) signaltabs.h: gen_signals_h Makefile ./gen_signals_h --i2s signal > $@ $(gen_sockleveltabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_sockleveltabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_sockleveltabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_sockleveltabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_sockleveltabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_sockleveltabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_sockleveltabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_sockleveltabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) sockleveltabs.h: gen_sockleveltabs_h Makefile ./gen_sockleveltabs_h --i2s socklevel > $@ $(gen_sockoptnametabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_sockoptnametabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_sockoptnametabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_sockoptnametabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_sockoptnametabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_sockoptnametabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_sockoptnametabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_sockoptnametabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) sockoptnametabs.h: gen_sockoptnametabs_h Makefile ./gen_sockoptnametabs_h --i2s sockoptname > $@ $(gen_socktabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_socktabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_socktabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_socktabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_socktabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_socktabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_socktabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_socktabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) socktabs.h: gen_socktabs_h Makefile ./gen_socktabs_h --i2s sock > $@ $(gen_socktypetabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_socktypetabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_socktypetabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_socktypetabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_socktypetabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_socktypetabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_socktypetabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_socktypetabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) socktypetabs.h: gen_socktypetabs_h Makefile ./gen_socktypetabs_h --i2s sock_type > $@ $(gen_tcpoptnametabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_tcpoptnametabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_tcpoptnametabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_tcpoptnametabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_tcpoptnametabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_tcpoptnametabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_tcpoptnametabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_tcpoptnametabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) tcpoptnametabs.h: gen_tcpoptnametabs_h Makefile ./gen_tcpoptnametabs_h --i2s tcpoptname > $@ $(gen_typetabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_typetabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_typetabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_typetabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_typetabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_typetabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_typetabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_typetabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) typetabs.h: gen_typetabs_h Makefile ./gen_typetabs_h --s2i type > $@ $(gen_umounttabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_umounttabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_umounttabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_umounttabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_umounttabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_umounttabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_umounttabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_umounttabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) umounttabs.h: gen_umounttabs_h Makefile ./gen_umounttabs_h --i2s-transtab umount > $@ $(gen_inethooktabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_inethooktabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_inethooktabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_inethooktabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_inethooktabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_inethooktabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_inethooktabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_inethooktabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) inethooktabs.h: gen_inethooktabs_h Makefile ./gen_inethooktabs_h --i2s inethook > $@ $(gen_netactiontabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_netactiontabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_netactiontabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_netactiontabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_netactiontabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_netactiontabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_netactiontabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_netactiontabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) netactiontabs.h: gen_netactiontabs_h Makefile ./gen_netactiontabs_h --i2s netaction > $@ $(gen_normalize_record_map_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_normalize_record_map_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_normalize_record_map_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_normalize_record_map_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_normalize_record_map$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_normalize_record_map$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_normalize_record_map$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_normalize_record_map$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) normalize_record_maps.h: gen_normalize_record_map Makefile ./gen_normalize_record_map --lowercase --i2s normalize_record_map > $@ $(gen_normalize_syscall_map_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_normalize_syscall_map_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_normalize_syscall_map_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_normalize_syscall_map_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_normalize_syscall_map$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_normalize_syscall_map$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_normalize_syscall_map$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_normalize_syscall_map$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) normalize_syscall_maps.h: gen_normalize_syscall_map Makefile ./gen_normalize_syscall_map --lowercase --s2i normalize_syscall_map > $@ $(gen_normalize_obj_kind_map_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_normalize_obj_kind_map_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_normalize_obj_kind_map_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_normalize_obj_kind_map_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_normalize_obj_kind_map$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_normalize_obj_kind_map$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_normalize_obj_kind_map$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_normalize_obj_kind_map$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) normalize_obj_kind_maps.h: gen_normalize_obj_kind_map Makefile ./gen_normalize_obj_kind_map --lowercase --i2s normalize_obj_kind_map > $@ $(gen_normalize_evtypetabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_normalize_evtypetabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_normalize_evtypetabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_normalize_evtypetabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_normalize_evtypetabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_normalize_evtypetabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_normalize_evtypetabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_normalize_evtypetabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) normalize_evtypetabs.h: gen_normalize_evtypetabs_h Makefile ./gen_normalize_evtypetabs_h --i2s evtype > $@ $(gen_bpftabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_bpftabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_bpftabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_bpftabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_bpftabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_bpftabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_bpftabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_bpftabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) bpftabs.h: gen_bpftabs_h Makefile ./gen_bpftabs_h --i2s bpf > $@ $(gen_openat2_resolvetabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_openat2_resolvetabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_openat2_resolvetabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_openat2_resolvetabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_openat2-resolvetabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_openat2-resolvetabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_openat2-resolvetabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_openat2-resolvetabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) openat2-resolvetabs.h: gen_openat2-resolvetabs_h Makefile ./gen_openat2-resolvetabs_h --i2s-transtab openat2_resolve > $@ # 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: audit-4.0.2/auparse/epoll_ctl.h0000644001034500103450000000200214655201403012064 /* epoll_ctl.h -- * Copyright 2008,2012,2014 Red Hat Inc., Durham, North Carolina. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb * Location: include/uapi/linux/eventpoll.h */ _S(1, "EPOLL_CTL_ADD" ) _S(2, "EPOLL_CTL_DEL" ) _S(3, "EPOLL_CTL_MOD" ) audit-4.0.2/auparse/ptracetab.h0000644001034500103450000000447714655201403012076 /* ptracetab.h -- * Copyright 2012-14,16,18,20-23 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb * Location: include/uapi/linux/ptrace.h * ./arch/x86/include/uapi/asm/ptrace-abi.h (0 - 30) */ _S(0, "PTRACE_TRACEME" ) _S(1, "PTRACE_PEEKTEXT" ) _S(2, "PTRACE_PEEKDATA" ) _S(3, "PTRACE_PEEKUSER" ) _S(4, "PTRACE_POKETEXT" ) _S(5, "PTRACE_POKEDATA" ) _S(6, "PTRACE_POKEUSER" ) _S(7, "PTRACE_CONT" ) _S(8, "PTRACE_KILL" ) _S(9, "PTRACE_SINGLESTEP" ) _S(12, "PTRACE_GETREGS" ) _S(13, "PTRACE_SETREGS" ) _S(14, "PTRACE_GETFPREGS" ) _S(15, "PTRACE_SETFPREGS" ) _S(16, "PTRACE_ATTACH" ) _S(17, "PTRACE_DETACH" ) _S(18, "PTRACE_GETFPXREGS" ) _S(19, "PTRACE_SETFPXREGS" ) _S(24, "PTRACE_SYSCALL" ) _S(25, "PTRACE_GET_THREAD_AREA") _S(26, "PTRACE_SET_THREAD_AREA") _S(30, "PTRACE_ARCH_PRCTL" ) _S(31, "PTRACE_SYSEMU" ) _S(32, "PTRACE_SYSEMU_SINGLESTEP") _S(33, "PTRACE_SINGLEBLOCK" ) _S(0x4200, "PTRACE_SETOPTIONS" ) _S(0x4201, "PTRACE_GETEVENTMSG" ) _S(0x4202, "PTRACE_GETSIGINFO" ) _S(0x4203, "PTRACE_SETSIGINFO" ) _S(0x4204, "PTRACE_GETREGSET" ) _S(0x4205, "PTRACE_SETREGSET" ) _S(0x4206, "PTRACE_SEIZE" ) _S(0x4207, "PTRACE_INTERRUPT" ) _S(0x4208, "PTRACE_LISTEN" ) _S(0x4209, "PTRACE_PEEKSIGINFO" ) _S(0x420a, "PTRACE_GETSIGMASK" ) _S(0x420b, "PTRACE_SETSIGMASK" ) _S(0x420c, "PTRACE_SECCOMP_GET_FILTER" ) _S(0x420d, "PTRACE_SECCOMP_GET_METADATA" ) _S(0x420e, "PTRACE_GET_SYSCALL_INFO" ) _S(0x420f, "PTRACE_GET_RSEQ_CONFIGURATION" ) _S(0x4210, "PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG" ) _S(0x4211, "PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG" ) audit-4.0.2/auparse/accesstab.h0000644001034500103450000000171014655201403012044 /* accesstab.h -- * Copyright 2013 Red Hat Inc., Durham, North Carolina. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb * Location: ? */ _S(0x1U, "X_OK" ) _S(0x2U, "W_OK" ) _S(0x4U, "R_OK" ) audit-4.0.2/auparse/Makefile.am0000644001034500103450000010606714655201403012012 # Makefile.am -- # Copyright 2006-08,2011-18 Red Hat Inc. # All Rights Reserved. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this program; see the file COPYING.lib. If not, write to # the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor # Boston, MA 02110-1335, USA. # # Authors: # Steve Grubb # Richard Guy Briggs # SUBDIRS = test EXTRA_DIST = expression-design.txt CLEANFILES = $(BUILT_SOURCES) CONFIG_CLEAN_FILES = *.loT *.rej *.orig AM_CFLAGS = -fPIC -DPIC -D_GNU_SOURCE -g ${DEBUG} -Wno-pointer-sign -Wno-enum-compare -Wno-switch ${WFLAGS} AM_CPPFLAGS = -I. -I${top_srcdir} -I${top_srcdir}/src -I${top_srcdir}/lib -I${top_srcdir}/common LIBS = pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = auparse.pc DISTCLEANFILES = $(pkgconfig_DATA) lib_LTLIBRARIES = libauparse.la include_HEADERS = auparse.h auparse-defs.h libauparse_la_SOURCES = lru.c interpret.c nvlist.c ellist.c \ auparse.c auditd-config.c message.c data_buf.c \ auparse-defs.h auparse-idata.h data_buf.h \ nvlist.h auparse.h ellist.h \ internal.h lru.h rnode.h interpret.h \ private.h expression.c expression.h tty_named_keys.h \ normalize.c normalize-llist.c normalize-llist.h \ normalize-internal.h normalize_obj_kind_map.h \ normalize_record_map.h normalize_syscall_map.h nodist_libauparse_la_SOURCES = $(BUILT_SOURCES) libauparse_la_LIBADD = ${top_builddir}/lib/libaudit.la ${top_builddir}/common/libaucommon.la libauparse_la_DEPENDENCIES = $(libauparse_la_SOURCES) ${top_builddir}/config.h ${top_builddir}/common/libaucommon.la libauparse_la_LDFLAGS = -Wl,-z,relro message.c: cp ${top_srcdir}/lib/message.c . BUILT_SOURCES = accesstabs.h captabs.h clocktabs.h clone-flagtabs.h \ epoll_ctls.h famtabs.h fcntl-cmdtabs.h fsconfigs.h \ flagtabs.h icmptypetabs.h ipctabs.h ipccmdtabs.h\ ioctlreqtabs.h ipoptnametabs.h ip6optnametabs.h \ mmaptabs.h mounttabs.h nfprototabs.h open-flagtabs.h \ persontabs.h prctl_opttabs.h pktoptnametabs.h \ prottabs.h ptracetabs.h \ rlimittabs.h recvtabs.h schedtabs.h seccomptabs.h \ seektabs.h shm_modetabs.h signaltabs.h sockoptnametabs.h \ socktabs.h sockleveltabs.h socktypetabs.h \ tcpoptnametabs.h typetabs.h umounttabs.h inethooktabs.h \ netactiontabs.h \ normalize_obj_kind_maps.h normalize_record_maps.h \ normalize_syscall_maps.h normalize_evtypetabs.h bpftabs.h \ openat2-resolvetabs.h noinst_PROGRAMS = gen_accesstabs_h gen_captabs_h gen_clock_h \ gen_clone-flagtabs_h \ gen_epoll_ctls_h gen_famtabs_h gen_fcntl-cmdtabs_h \ gen_flagtabs_h gen_fsconfigs_h gen_ioctlreqtabs_h \ gen_icmptypetabs_h gen_ipctabs_h gen_ipccmdtabs_h\ gen_ipoptnametabs_h gen_ip6optnametabs_h gen_nfprototabs_h \ gen_mmaptabs_h gen_mounttabs_h \ gen_open-flagtabs_h gen_persontabs_h \ gen_prctl_opttabs_h gen_pktoptnametabs_h gen_prottabs_h \ gen_recvtabs_h gen_rlimit_h gen_ptracetabs_h \ gen_schedtabs_h gen_seccomptabs_h \ gen_seektabs_h gen_shm_modetabs_h gen_signals_h \ gen_sockoptnametabs_h gen_socktabs_h gen_sockleveltabs_h \ gen_socktypetabs_h gen_tcpoptnametabs_h gen_typetabs_h \ gen_umounttabs_h gen_inethooktabs_h gen_netactiontabs_h \ gen_normalize_record_map gen_normalize_syscall_map \ gen_normalize_obj_kind_map gen_normalize_evtypetabs_h gen_bpftabs_h \ gen_openat2-resolvetabs_h gen_accesstabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h accesstab.h gen_accesstabs_h_CFLAGS = '-DTABLE_H="accesstab.h"' $(gen_accesstabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_accesstabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_accesstabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_accesstabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_accesstabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_accesstabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_accesstabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_accesstabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) accesstabs.h: gen_accesstabs_h Makefile ./gen_accesstabs_h --i2s-transtab access > $@ gen_captabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h captab.h gen_captabs_h_CFLAGS = '-DTABLE_H="captab.h"' $(gen_captabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_captabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_captabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_captabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_captabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_captabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_captabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_captabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) captabs.h: gen_captabs_h Makefile ./gen_captabs_h --i2s cap > $@ gen_clock_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h clocktab.h gen_clock_h_CFLAGS = '-DTABLE_H="clocktab.h"' $(gen_clock_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_clock_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_clock_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_clock_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_clock_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_clock_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_clock_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_clock_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) clocktabs.h: gen_clock_h Makefile ./gen_clock_h --i2s clock > $@ gen_clone_flagtabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h \ clone-flagtab.h gen_clone_flagtabs_h_CFLAGS = '-DTABLE_H="clone-flagtab.h"' $(gen_clone_flagtabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_clone_flagtabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_clone_flagtabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_clone_flagtabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_clone-flagtabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_clone-flagtabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_clone-flagtabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_clone-flagtabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) clone-flagtabs.h: gen_clone-flagtabs_h Makefile ./gen_clone-flagtabs_h --i2s-transtab clone_flag > $@ gen_epoll_ctls_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h epoll_ctl.h gen_epoll_ctls_h_CFLAGS = '-DTABLE_H="epoll_ctl.h"' $(gen_epoll_ctls_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_epoll_ctls_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_epoll_ctls_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_epoll_ctls_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_epoll_ctls_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_epoll_ctls_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_epoll_ctls_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_epoll_ctls_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) epoll_ctls.h: gen_epoll_ctls_h Makefile ./gen_epoll_ctls_h --i2s epoll_ctl > $@ gen_famtabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h famtab.h gen_famtabs_h_CFLAGS = '-DTABLE_H="famtab.h"' $(gen_famtabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_famtabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_famtabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_famtabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_famtabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_famtabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_famtabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_famtabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) famtabs.h: gen_famtabs_h Makefile ./gen_famtabs_h --i2s fam > $@ gen_flagtabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h flagtab.h # ../auparse/ is used to avoid using ../lib/flagtab.h gen_flagtabs_h_CFLAGS = '-DTABLE_H="../auparse/flagtab.h"' $(gen_flagtabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_flagtabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_flagtabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_flagtabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_flagtabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_flagtabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_flagtabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_flagtabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) flagtabs.h: gen_flagtabs_h Makefile ./gen_flagtabs_h --i2s-transtab flag > $@ gen_fcntl_cmdtabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h \ fcntl-cmdtab.h gen_fcntl_cmdtabs_h_CFLAGS = '-DTABLE_H="fcntl-cmdtab.h"' $(gen_fcntl_cmdtabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_fcntl_cmdtabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_fcntl_cmdtabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_fcntl_cmdtabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_fcntl-cmdtabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_fcntl-cmdtabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_fcntl-cmdtabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_fcntl-cmdtabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) fcntl-cmdtabs.h: gen_fcntl-cmdtabs_h Makefile ./gen_fcntl-cmdtabs_h --i2s fcntl > $@ gen_fsconfigs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h fsconfig.h gen_fsconfigs_h_CFLAGS = '-DTABLE_H="fsconfig.h"' $(gen_fsconfigs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_fsconfigs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_fsconfigs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_fsconfigs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_fsconfigs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_fsconfigs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_fsconfigs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_fsconfigs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) fsconfigs.h: gen_fsconfigs_h Makefile ./gen_fsconfigs_h --i2s fsconfig > $@ gen_icmptypetabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h icmptypetab.h gen_icmptypetabs_h_CFLAGS = '-DTABLE_H="icmptypetab.h"' $(gen_icmptypetabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_icmptypetabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_icmptypetabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_icmptypetabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_icmptypetabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_icmptypetabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_icmptypetabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_icmptypetabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) icmptypetabs.h: gen_icmptypetabs_h Makefile ./gen_icmptypetabs_h --i2s icmptype > $@ gen_ioctlreqtabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h ioctlreqtab.h gen_ioctlreqtabs_h_CFLAGS = '-DTABLE_H="ioctlreqtab.h"' $(gen_ioctlreqtabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_ioctlreqtabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_ioctlreqtabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_ioctlreqtabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_ioctlreqtabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_ioctlreqtabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_ioctlreqtabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_ioctlreqtabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) ioctlreqtabs.h: gen_ioctlreqtabs_h Makefile ./gen_ioctlreqtabs_h --i2s ioctlreq > $@ gen_ipctabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h ipctab.h gen_ipctabs_h_CFLAGS = '-DTABLE_H="ipctab.h"' $(gen_ipctabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_ipctabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_ipctabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_ipctabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_ipctabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_ipctabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_ipctabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_ipctabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) ipctabs.h: gen_ipctabs_h Makefile ./gen_ipctabs_h --i2s ipc > $@ gen_ipccmdtabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h ipccmdtab.h gen_ipccmdtabs_h_CFLAGS = '-DTABLE_H="ipccmdtab.h"' $(gen_ipccmdtabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_ipccmdtabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_ipccmdtabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_ipccmdtabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_ipccmdtabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_ipccmdtabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_ipccmdtabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_ipccmdtabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) ipccmdtabs.h: gen_ipccmdtabs_h Makefile ./gen_ipccmdtabs_h --i2s-transtab ipccmd > $@ gen_ipoptnametabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h ipoptnametab.h gen_ipoptnametabs_h_CFLAGS = '-DTABLE_H="ipoptnametab.h"' $(gen_ipoptnametabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_ipoptnametabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_ipoptnametabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_ipoptnametabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_ipoptnametabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_ipoptnametabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_ipoptnametabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_ipoptnametabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) ipoptnametabs.h: gen_ipoptnametabs_h Makefile ./gen_ipoptnametabs_h --i2s ipoptname > $@ gen_ip6optnametabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h ip6optnametab.h gen_ip6optnametabs_h_CFLAGS = '-DTABLE_H="ip6optnametab.h"' $(gen_ip6optnametabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_ip6optnametabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_ip6optnametabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_ip6optnametabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_ip6optnametabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_ip6optnametabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_ip6optnametabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_ip6optnametabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) ip6optnametabs.h: gen_ip6optnametabs_h Makefile ./gen_ip6optnametabs_h --i2s ip6optname > $@ gen_mmaptabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h mmaptab.h gen_mmaptabs_h_CFLAGS = '-DTABLE_H="mmaptab.h"' $(gen_mmaptabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_mmaptabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_mmaptabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_mmaptabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_mmaptabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_mmaptabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_mmaptabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_mmaptabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) mmaptabs.h: gen_mmaptabs_h Makefile ./gen_mmaptabs_h --i2s-transtab mmap > $@ gen_mounttabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h mounttab.h gen_mounttabs_h_CFLAGS = '-DTABLE_H="mounttab.h"' $(gen_mounttabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_mounttabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_mounttabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_mounttabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_mounttabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_mounttabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_mounttabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_mounttabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) mounttabs.h: gen_mounttabs_h Makefile ./gen_mounttabs_h --i2s-transtab mount > $@ gen_nfprototabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h nfprototab.h gen_nfprototabs_h_CFLAGS = '-DTABLE_H="nfprototab.h"' $(gen_nfprototabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_nfprototabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_nfprototabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_nfprototabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_nfprototabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_nfprototabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_nfprototabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_nfprototabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) nfprototabs.h: gen_nfprototabs_h Makefile ./gen_nfprototabs_h --i2s nfproto > $@ gen_open_flagtabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h \ open-flagtab.h gen_open_flagtabs_h_CFLAGS = '-DTABLE_H="open-flagtab.h"' $(gen_open_flagtabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_open_flagtabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_open_flagtabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_open_flagtabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_open-flagtabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_open-flagtabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_open-flagtabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_open-flagtabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) open-flagtabs.h: gen_open-flagtabs_h Makefile ./gen_open-flagtabs_h --i2s-transtab open_flag > $@ gen_persontabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h persontab.h gen_persontabs_h_CFLAGS = '-DTABLE_H="persontab.h"' $(gen_persontabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_persontabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_persontabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_persontabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_persontabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_persontabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_persontabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_persontabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) persontabs.h: gen_persontabs_h Makefile ./gen_persontabs_h --i2s person > $@ gen_ptracetabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h ptracetab.h gen_ptracetabs_h_CFLAGS = '-DTABLE_H="ptracetab.h"' $(gen_ptracetabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_ptracetabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_ptracetabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_ptracetabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_ptracetabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_ptracetabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_ptracetabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_ptracetabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) ptracetabs.h: gen_ptracetabs_h Makefile ./gen_ptracetabs_h --i2s ptrace > $@ gen_prctl_opttabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h prctl-opt-tab.h gen_prctl_opttabs_h_CFLAGS = '-DTABLE_H="prctl-opt-tab.h"' $(gen_prctl_opttabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_prctl_opttabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_prctl_opttabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_prctl_opttabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_prctl_opttabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_prctl_opttabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_prctl_opttabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_prctl_opttabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) prctl_opttabs.h: gen_prctl_opttabs_h Makefile ./gen_prctl_opttabs_h --i2s prctl_opt > $@ gen_pktoptnametabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h pktoptnametab.h gen_pktoptnametabs_h_CFLAGS = '-DTABLE_H="pktoptnametab.h"' $(gen_pktoptnametabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_pktoptnametabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_pktoptnametabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_pktoptnametabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_pktoptnametabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_pktoptnametabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_pktoptnametabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_pktoptnametabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) pktoptnametabs.h: gen_pktoptnametabs_h Makefile ./gen_pktoptnametabs_h --i2s pktoptname > $@ gen_prottabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h prottab.h gen_prottabs_h_CFLAGS = '-DTABLE_H="prottab.h"' $(gen_prottabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_prottabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_prottabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_prottabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_prottabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_prottabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_prottabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_prottabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) prottabs.h: gen_prottabs_h Makefile ./gen_prottabs_h --i2s-transtab prot > $@ gen_recvtabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h recvtab.h gen_recvtabs_h_CFLAGS = '-DTABLE_H="recvtab.h"' $(gen_recvtabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_recvtabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_recvtabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_recvtabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_recvtabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_recvtabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_recvtabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_recvtabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) recvtabs.h: gen_recvtabs_h Makefile ./gen_recvtabs_h --i2s-transtab recv > $@ gen_rlimit_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h rlimittab.h gen_rlimit_h_CFLAGS = '-DTABLE_H="rlimittab.h"' $(gen_rlimit_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_rlimit_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_rlimit_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_rlimit_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_rlimit_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_rlimit_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_rlimit_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_rlimit_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) rlimittabs.h: gen_rlimit_h Makefile ./gen_rlimit_h --i2s rlimit > $@ gen_schedtabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h schedtab.h gen_schedtabs_h_CFLAGS = '-DTABLE_H="schedtab.h"' $(gen_schedtabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_schedtabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_schedtabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_schedtabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_schedtabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_schedtabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_schedtabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_schedtabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) schedtabs.h: gen_schedtabs_h Makefile ./gen_schedtabs_h --i2s sched > $@ gen_seccomptabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h seccomptab.h gen_seccomptabs_h_CFLAGS = '-DTABLE_H="seccomptab.h"' $(gen_seccomptabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_seccomptabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_seccomptabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_seccomptabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_seccomptabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_seccomptabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_seccomptabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_seccomptabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) seccomptabs.h: gen_seccomptabs_h Makefile ./gen_seccomptabs_h --i2s seccomp > $@ gen_seektabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h seektab.h gen_seektabs_h_CFLAGS = '-DTABLE_H="seektab.h"' $(gen_seektabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_seektabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_seektabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_seektabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_seektabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_seektabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_seektabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_seektabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) seektabs.h: gen_seektabs_h Makefile ./gen_seektabs_h --i2s seek > $@ gen_shm_modetabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h shm_modetab.h gen_shm_modetabs_h_CFLAGS = '-DTABLE_H="shm_modetab.h"' $(gen_shm_modetabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_shm_modetabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_shm_modetabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_shm_modetabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_shm_modetabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_shm_modetabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_shm_modetabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_shm_modetabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) shm_modetabs.h: gen_shm_modetabs_h Makefile ./gen_shm_modetabs_h --i2s-transtab shm_mode > $@ gen_signals_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h signaltab.h gen_signals_h_CFLAGS = '-DTABLE_H="signaltab.h"' $(gen_signals_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_signals_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_signals_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_signals_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_signals_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_signals_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_signals_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_signals_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) signaltabs.h: gen_signals_h Makefile ./gen_signals_h --i2s signal > $@ gen_sockleveltabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h sockleveltab.h gen_sockleveltabs_h_CFLAGS = '-DTABLE_H="sockleveltab.h"' $(gen_sockleveltabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_sockleveltabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_sockleveltabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_sockleveltabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_sockleveltabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_sockleveltabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_sockleveltabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_sockleveltabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) sockleveltabs.h: gen_sockleveltabs_h Makefile ./gen_sockleveltabs_h --i2s socklevel > $@ gen_sockoptnametabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h sockoptnametab.h gen_sockoptnametabs_h_CFLAGS = '-DTABLE_H="sockoptnametab.h"' $(gen_sockoptnametabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_sockoptnametabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_sockoptnametabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_sockoptnametabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_sockoptnametabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_sockoptnametabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_sockoptnametabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_sockoptnametabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) sockoptnametabs.h: gen_sockoptnametabs_h Makefile ./gen_sockoptnametabs_h --i2s sockoptname > $@ gen_socktabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h socktab.h gen_socktabs_h_CFLAGS = '-DTABLE_H="socktab.h"' $(gen_socktabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_socktabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_socktabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_socktabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_socktabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_socktabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_socktabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_socktabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) socktabs.h: gen_socktabs_h Makefile ./gen_socktabs_h --i2s sock > $@ gen_socktypetabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h socktypetab.h gen_socktypetabs_h_CFLAGS = '-DTABLE_H="socktypetab.h"' $(gen_socktypetabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_socktypetabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_socktypetabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_socktypetabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_socktypetabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_socktypetabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_socktypetabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_socktypetabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) socktypetabs.h: gen_socktypetabs_h Makefile ./gen_socktypetabs_h --i2s sock_type > $@ gen_tcpoptnametabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h tcpoptnametab.h gen_tcpoptnametabs_h_CFLAGS = '-DTABLE_H="tcpoptnametab.h"' $(gen_tcpoptnametabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_tcpoptnametabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_tcpoptnametabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_tcpoptnametabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_tcpoptnametabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_tcpoptnametabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_tcpoptnametabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_tcpoptnametabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) tcpoptnametabs.h: gen_tcpoptnametabs_h Makefile ./gen_tcpoptnametabs_h --i2s tcpoptname > $@ gen_typetabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h typetab.h gen_typetabs_h_CFLAGS = '-DTABLE_H="typetab.h"' $(gen_typetabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_typetabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_typetabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_typetabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_typetabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_typetabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_typetabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_typetabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) typetabs.h: gen_typetabs_h Makefile ./gen_typetabs_h --s2i type > $@ gen_umounttabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h umounttab.h gen_umounttabs_h_CFLAGS = '-DTABLE_H="umounttab.h"' $(gen_umounttabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_umounttabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_umounttabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_umounttabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_umounttabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_umounttabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_umounttabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_umounttabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) umounttabs.h: gen_umounttabs_h Makefile ./gen_umounttabs_h --i2s-transtab umount > $@ gen_inethooktabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h inethooktab.h gen_inethooktabs_h_CFLAGS = '-DTABLE_H="inethooktab.h"' $(gen_inethooktabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_inethooktabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_inethooktabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_inethooktabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_inethooktabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_inethooktabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_inethooktabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_inethooktabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) inethooktabs.h: gen_inethooktabs_h Makefile ./gen_inethooktabs_h --i2s inethook > $@ gen_netactiontabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h netactiontab.h gen_netactiontabs_h_CFLAGS = '-DTABLE_H="netactiontab.h"' $(gen_netactiontabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_netactiontabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_netactiontabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_netactiontabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_netactiontabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_netactiontabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_netactiontabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_netactiontabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) netactiontabs.h: gen_netactiontabs_h Makefile ./gen_netactiontabs_h --i2s netaction > $@ gen_normalize_record_map_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h normalize_record_map.h gen_normalize_record_map_CFLAGS = '-DTABLE_H="normalize_record_map.h"' $(gen_normalize_record_map_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_normalize_record_map_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_normalize_record_map_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_normalize_record_map_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_normalize_record_map$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_normalize_record_map$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_normalize_record_map$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_normalize_record_map$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) normalize_record_maps.h: gen_normalize_record_map Makefile ./gen_normalize_record_map --lowercase --i2s normalize_record_map > $@ gen_normalize_syscall_map_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h normalize_syscall_map.h gen_normalize_syscall_map_CFLAGS = '-DTABLE_H="normalize_syscall_map.h"' $(gen_normalize_syscall_map_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_normalize_syscall_map_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_normalize_syscall_map_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_normalize_syscall_map_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_normalize_syscall_map$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_normalize_syscall_map$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_normalize_syscall_map$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_normalize_syscall_map$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) normalize_syscall_maps.h: gen_normalize_syscall_map Makefile ./gen_normalize_syscall_map --lowercase --s2i normalize_syscall_map > $@ gen_normalize_obj_kind_map_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h normalize_obj_kind_map.h gen_normalize_obj_kind_map_CFLAGS = '-DTABLE_H="normalize_obj_kind_map.h"' $(gen_normalize_obj_kind_map_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_normalize_obj_kind_map_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_normalize_obj_kind_map_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_normalize_obj_kind_map_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_normalize_obj_kind_map$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_normalize_obj_kind_map$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_normalize_obj_kind_map$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_normalize_obj_kind_map$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) normalize_obj_kind_maps.h: gen_normalize_obj_kind_map Makefile ./gen_normalize_obj_kind_map --lowercase --i2s normalize_obj_kind_map > $@ gen_normalize_evtypetabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h normalize_evtypetab.h gen_normalize_evtypetabs_h_CFLAGS = '-DTABLE_H="normalize_evtypetab.h"' $(gen_normalize_evtypetabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_normalize_evtypetabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_normalize_evtypetabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_normalize_evtypetabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_normalize_evtypetabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_normalize_evtypetabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_normalize_evtypetabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_normalize_evtypetabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) normalize_evtypetabs.h: gen_normalize_evtypetabs_h Makefile ./gen_normalize_evtypetabs_h --i2s evtype > $@ gen_bpftabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h bpftab.h gen_bpftabs_h_CFLAGS = '-DTABLE_H="bpftab.h"' $(gen_bpftabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_bpftabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_bpftabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_bpftabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_bpftabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_bpftabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_bpftabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_bpftabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) bpftabs.h: gen_bpftabs_h Makefile ./gen_bpftabs_h --i2s bpf > $@ gen_openat2_resolvetabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h \ openat2-resolvetab.h gen_openat2_resolvetabs_h_CFLAGS = '-DTABLE_H="openat2-resolvetab.h"' $(gen_openat2_resolvetabs_h_OBJECTS): CC=$(CC_FOR_BUILD) $(gen_openat2_resolvetabs_h_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) $(gen_openat2_resolvetabs_h_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) $(gen_openat2_resolvetabs_h_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD) gen_openat2-resolvetabs_h$(BUILD_EXEEXT): CC=$(CC_FOR_BUILD) gen_openat2-resolvetabs_h$(BUILD_EXEEXT): CFLAGS=$(CFLAGS_FOR_BUILD) gen_openat2-resolvetabs_h$(BUILD_EXEEXT): CPPFLAGS=$(CPPFLAGS_FOR_BUILD) gen_openat2-resolvetabs_h$(BUILD_EXEEXT): LDFLAGS=$(LDFLAGS_FOR_BUILD) openat2-resolvetabs.h: gen_openat2-resolvetabs_h Makefile ./gen_openat2-resolvetabs_h --i2s-transtab openat2_resolve > $@ audit-4.0.2/auparse/clone-flagtab.h0000644001034500103450000000344514655201403012621 /* clone-flagtab.h -- * Copyright 2007,2012-23 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330ULL, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb * Location: include/uapi/linux/sched.h */ _S(0x00000100ULL, "CLONE_VM" ) _S(0x00000200ULL, "CLONE_FS" ) _S(0x00000400ULL, "CLONE_FILES" ) _S(0x00000800ULL, "CLONE_SIGHAND" ) _S(0x00002000ULL, "CLONE_PTRACE" ) _S(0x00004000ULL, "CLONE_VFORK" ) _S(0x00008000ULL, "CLONE_PARENT" ) _S(0x00010000ULL, "CLONE_THREAD" ) _S(0x00020000ULL, "CLONE_NEWNS" ) _S(0x00040000ULL, "CLONE_SYSVSEM" ) _S(0x00080000ULL, "CLONE_SETTLS" ) _S(0x00100000ULL, "CLONE_PARENT_SETTID" ) _S(0x00200000ULL, "CLONE_CHILD_CLEARTID" ) _S(0x00400000ULL, "CLONE_DETACHED" ) _S(0x00800000ULL, "CLONE_UNTRACED" ) _S(0x01000000ULL, "CLONE_CHILD_SETTID" ) _S(0x02000000ULL, "CLONE_STOPPED" ) _S(0x04000000ULL, "CLONE_NEWUTS" ) _S(0x08000000ULL, "CLONE_NEWIPC" ) _S(0x10000000ULL, "CLONE_NEWUSER" ) _S(0x20000000ULL, "CLONE_NEWPID" ) _S(0x40000000ULL, "CLONE_NEWNET" ) _S(0x80000000ULL, "CLONE_IO" ) _S(0x100000000ULL, "CLONE_CLEAR_SIGHAND") _S(0x200000000ULL, "CLONE_INTO_CGROUP") audit-4.0.2/auparse/ipctab.h0000644001034500103450000000225514655201403011363 /* ipctab.h -- * Copyright 2007,2012-13 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb * Location: include/uapi/linux/ipc.h */ _S(SEMOP, "semop" ) _S(SEMGET, "semget" ) _S(SEMCTL, "semctl" ) _S(4, "semtimedop" ) _S(MSGSND, "msgsnd" ) _S(MSGRCV, "msgrcv" ) _S(MSGGET, "msgget" ) _S(MSGCTL, "msgctl" ) _S(SHMAT, "shmat" ) _S(SHMDT, "shmdt" ) _S(SHMGET, "shmget" ) _S(SHMCTL, "shmctl" ) _S(DIPC, "dipc" ) audit-4.0.2/auparse/normalize_evtypetab.h0000644001034500103450000000331314655201403014200 /* normalize_evtypetab.h -- * Copyright 2017,2021 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb */ #include "normalize-internal.h" _S(NORM_EVTYPE_UNKNOWN, "unknown" ) _S(NORM_EVTYPE_USERSPACE, "user-space" ) _S(NORM_EVTYPE_SYSTEM_SERVICES, "system-services" ) _S(NORM_EVTYPE_CONFIG, "configuration" ) _S(NORM_EVTYPE_TTY, "TTY" ) _S(NORM_EVTYPE_USER_ACCT, "user-account" ) _S(NORM_EVTYPE_USER_LOGIN, "user-login" ) _S(NORM_EVTYPE_AUDIT_DAEMON, "audit-daemon" ) _S(NORM_EVTYPE_MAC_DECISION, "mac-decision" ) _S(NORM_EVTYPE_ANOMALY, "anomaly" ) _S(NORM_EVTYPE_INTEGRITY, "integrity" ) _S(NORM_EVTYPE_ANOMALY_RESP, "anomaly-response") _S(NORM_EVTYPE_MAC, "mac" ) _S(NORM_EVTYPE_CRYPTO, "crypto" ) _S(NORM_EVTYPE_VIRT, "virt" ) _S(NORM_EVTYPE_AUDIT_RULE, "audit-rule" ) _S(NORM_EVTYPE_DAC_DECISION, "dac-decision" ) _S(NORM_EVTYPE_GROUP_CHANGE, "group-change" ) _S(NORM_EVTYPE_AV_DECISION, "av-decision" ) _S(NORM_EVTYPE_BPF, "bpf-program" ) audit-4.0.2/auparse/nvlist.h0000644001034500103450000000434414655201403011441 /* * nvlist.h - Header file for nvlist.c * Copyright (c) 2006-07,2016,2021 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb */ #ifndef NVLIST_HEADER #define NVLIST_HEADER #include "config.h" #include "private.h" #include #include "rnode.h" #include "ellist.h" static inline unsigned int nvlist_get_cnt(const nvlist *l) { return l->cnt; } static inline void nvlist_first(nvlist *l) { l->cur = 0; } static inline nvnode *nvlist_get_cur(const nvlist *l) { return &l->array[l->cur]; } static inline const char *nvlist_get_cur_name(const nvlist *l) {if (l->cnt) { nvnode *node = &l->array[l->cur]; return node->name; } else return NULL;} static inline const char *nvlist_get_cur_val(const nvlist *l) {if (l->cnt) { nvnode *node = &l->array[l->cur]; return node->val; } else return NULL;} static inline const char *nvlist_get_cur_val_interp(const nvlist *l) {if (l->cnt) { nvnode *node = &l->array[l->cur]; return node->interp_val; } else return NULL;} AUDIT_HIDDEN_START void nvlist_create(nvlist *l); void nvlist_clear(nvlist *l, int free_interp); nvnode *nvlist_next(nvlist *l); int nvlist_get_cur_type(rnode *r); const char *nvlist_interp_cur_val(rnode *r, auparse_esc_t escape_mode); int nvlist_append(nvlist *l, const nvnode *node); void nvlist_interp_fixup(const nvlist *l); /* Given a numeric index, find that record. */ nvnode *nvlist_goto_rec(nvlist *l, unsigned int i); /* Given a name, find that record */ int nvlist_find_name(nvlist *l, const char *name); AUDIT_HIDDEN_END #endif audit-4.0.2/auparse/auparse.pc.in0000644001034500103450000000041514655201403012335 prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: libauparse Description: Library for apps that want to parse and interpret audit events Version: @VERSION@ Libs: -L${libdir} -lauparse Libs.private: -laudit Cflags: -I${includedir} audit-4.0.2/auparse/socktypetab.h0000644001034500103450000000203214655201403012442 /* socktypetab.h -- * Copyright 2012 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb * Location: include/linux/net.h */ _S(1, "SOCK_STREAM") _S(2, "SOCK_DGRAM") _S(3, "SOCK_RAW") _S(4, "SOCK_RDM") _S(5, "SOCK_SEQPACKET") _S(6, "SOCK_DCCP") _S(10, "SOCK_PACKET") audit-4.0.2/auparse/auditd-config.c0000644001034500103450000002065314655201403012633 /* * auditd-config.c - This is a greatly reduced config file parser * * Copyright 2007,2014,2016 Red Hat Inc., Durham, North Carolina. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb * */ #include "config.h" #include "internal.h" #include #include #include #include #include #include #include #include #include "common.h" /* Local prototypes */ struct _pair { const char *name; const char *value; }; struct kw_pair { const char *name; int (*parser)(auparse_state_t *, const char *, int, struct daemon_conf *); }; struct nv_list { const char *name; int option; }; static char *get_line(auparse_state_t *au, FILE *f, char *buf, unsigned size, int *lineno, const char *file); static int nv_split(char *buf, struct _pair *nv); static const struct kw_pair *kw_lookup(const char *val); static int log_file_parser(auparse_state_t *au, const char *val, int line, struct daemon_conf *config); static int eoe_timeout_parser(auparse_state_t *au, const char *val, int line, struct daemon_conf *config); static const struct kw_pair keywords[] = { {"log_file", log_file_parser }, {"end_of_event_timeout", eoe_timeout_parser }, { NULL, NULL } }; /* * Set everything to its default value */ static void aup_clear_config(struct daemon_conf *config) { config->local_events = 1; config->sender_uid = 0; config->sender_pid = 0; config->sender_ctx = NULL; config->write_logs = 1; config->log_file = strdup("/var/log/audit/audit.log"); config->log_format = LF_RAW; config->log_group = 0; config->priority_boost = 4; config->flush = FT_NONE; config->freq = 0; config->num_logs = 0L; config->node_name_format = N_NONE; config->node_name = NULL; config->max_log_size = 0L; config->max_log_size_action = SZ_IGNORE; config->space_left = 0L; config->space_left_action = FA_IGNORE; config->space_left_exe = NULL; config->action_mail_acct = NULL; config->admin_space_left= 0L; config->admin_space_left_action = FA_IGNORE; config->admin_space_left_exe = NULL; config->disk_full_action = FA_IGNORE; config->disk_full_exe = NULL; config->disk_error_action = FA_SYSLOG; config->disk_error_exe = NULL; config->end_of_event_timeout = EOE_TIMEOUT; } int aup_load_config(auparse_state_t *au, struct daemon_conf *config, log_test_t lt __attribute__((unused))) { int fd, lineno = 1; FILE *f; char buf[160]; aup_clear_config(config); /* open the file */ fd = open(CONFIG_FILE, O_RDONLY|O_NOFOLLOW); if (fd < 0) { if (errno != ENOENT) { if (errno == EACCES) { audit_msg(au, LOG_INFO, "libauparse: Permission denied opening config file, using defaults"); return 0; } audit_msg(au, LOG_ERR, "Error opening config file (%s)", strerror(errno)); return 1; } audit_msg(au, LOG_WARNING, "Config file %s doesn't exist, skipping", CONFIG_FILE); return 0; } /* Make into FILE struct and read line by line */ f = fdopen(fd, "rm"); if (f == NULL) { audit_msg(au, LOG_ERR, "Error - fdopen failed (%s)", strerror(errno)); close(fd); return 1; } while (get_line(au, f, buf, sizeof(buf), &lineno, CONFIG_FILE)) { // convert line into name-value pair const struct kw_pair *kw; struct _pair nv; int rc = nv_split(buf, &nv); switch (rc) { case 0: // fine break; case 1: // not the right number of tokens. audit_msg(au, LOG_ERR, "Wrong number of arguments for line %d in %s", lineno, CONFIG_FILE); break; case 2: // no '=' sign audit_msg(au, LOG_ERR, "Missing equal sign for line %d in %s", lineno, CONFIG_FILE); break; default: // something else went wrong... audit_msg(au, LOG_ERR, "Unknown error for line %d in %s", lineno, CONFIG_FILE); break; } if (nv.name == NULL) { lineno++; continue; } if (nv.value == NULL) { fclose(f); audit_msg(au, LOG_ERR, "Not processing any more lines in %s", CONFIG_FILE); return 1; } /* identify keyword or error */ kw = kw_lookup(nv.name); if (kw->name) { /* dispatch to keyword's local parser */ rc = kw->parser(au, nv.value, lineno, config); if (rc != 0) { fclose(f); return 1; // local parser puts message out } } lineno++; } fclose(f); return 0; } static char *get_line(auparse_state_t *au, FILE *f, char *buf, unsigned size, int *lineno, const char *file) { int too_long = 0; while (fgets_unlocked(buf, size, f)) { /* remove newline */ char *ptr = strchr(buf, 0x0a); if (ptr) { if (!too_long) { *ptr = 0; return buf; } // Reset and start with the next line too_long = 0; *lineno = *lineno + 1; } else { // If a line is too long skip it. // Only output 1 warning if (!too_long) audit_msg(au, LOG_ERR, "Skipping line %d in %s: too long", *lineno, file); too_long = 1; } } return NULL; } static int nv_split(char *buf, struct _pair *nv) { /* Get the name part */ char *ptr; nv->name = NULL; nv->value = NULL; ptr = audit_strsplit(buf); if (ptr == NULL) return 0; /* If there's nothing, go to next line */ if (ptr[0] == '#') return 0; /* If there's a comment, go to next line */ nv->name = ptr; /* Check for a '=' */ ptr = audit_strsplit(NULL); if (ptr == NULL) return 1; if (strcmp(ptr, "=") != 0) return 2; /* get the value */ ptr = audit_strsplit(NULL); if (ptr == NULL) return 1; nv->value = ptr; /* Make sure there's nothing else */ ptr = audit_strsplit(NULL); if (ptr) { /* Allow one option, but check that there's not 2 */ ptr = audit_strsplit(NULL); if (ptr) return 1; } /* Everything is OK */ return 0; } static const struct kw_pair *kw_lookup(const char *val) { int i = 0; while (keywords[i].name != NULL) { if (strcasecmp(keywords[i].name, val) == 0) break; i++; } return &keywords[i]; } static int log_file_parser(auparse_state_t *au, const char *val, int line, struct daemon_conf *config) { char *dir = NULL, *tdir, *base; DIR *d; int fd, mode; /* split name into dir and basename. */ tdir = strdup(val); if (tdir) dir = dirname(tdir); if (dir == NULL || strlen(dir) < 4) { // '/var' is shortest dirname audit_msg(au, LOG_ERR, "The directory name: %s is too short - line %d", dir, line); free((void *)tdir); return 1; } base = basename((char *)val); if (base == 0 || strlen(base) == 0) { audit_msg(au, LOG_ERR, "The file name: %s is too short - line %d", base, line); free((void *)tdir); return 1; } /* verify the directory path exists */ d = opendir(dir); if (d == NULL) { audit_msg(au, LOG_ERR, "Could not open dir %s (%s)", dir, strerror(errno)); free((void *)tdir); return 1; } free((void *)tdir); closedir(d); /* Verify the log file can be opened. */ mode = O_RDONLY; fd = open(val, mode); if (fd < 0) { audit_msg(au, LOG_ERR, "Unable to open %s (%s)", val, strerror(errno)); return 1; } close(fd); free((void *)config->log_file); config->log_file = strdup(val); if (config->log_file == NULL) return 1; return 0; } static int eoe_timeout_parser(auparse_state_t *au, const char *val, int line, struct daemon_conf *config) { const char *ptr = val; unsigned long i; /* check that all chars are numbers */ for (i=0; ptr[i]; i++) { if (!isdigit((unsigned char)ptr[i])) { audit_msg(au, LOG_ERR, "Value %s should only be numbers - line %d", val, line); return 1; } } /* convert to unsigned long */ errno = 0; i = strtoul(val, NULL, 10); if (errno) { audit_msg(au, LOG_ERR, "Error converting string to a number (%s) - line %d", strerror(errno), line); return 1; } config->end_of_event_timeout = i; return 0; } void aup_free_config(struct daemon_conf *config) { free((void*)config->log_file); config->log_file = NULL; } audit-4.0.2/auparse/normalize-internal.h0000644001034500103450000000731514655201403013735 /* * normalize-internal.h * Copyright (c) 2016-18,21 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb */ #ifndef NORMALIZE_INTERNAL #define NORMALIZE_INTERNAL #define NORM_ACCT_PRIV 0 #define NORM_ACCT_UNSET 4294967295U #define NORM_ACCT_MAX_SYS 1000 #define NORM_ACCT_MAX_USER 60000 /* * This is used for normalizing syscalls. It can determine * the action, object, obj_kind, and object attributes. */ #define NORM_UNKNOWN 0 #define NORM_FILE 1 #define NORM_FILE_CHATTR 2 #define NORM_FILE_CHPERM 3 #define NORM_FILE_CHOWN 4 #define NORM_FILE_LDMOD 5 #define NORM_FILE_UNLDMOD 6 #define NORM_FILE_DIR 7 #define NORM_FILE_MOUNT 8 #define NORM_FILE_RENAME 9 #define NORM_FILE_STAT 10 #define NORM_FILE_LNK 11 #define NORM_FILE_UMNT 12 #define NORM_FILE_DEL 13 #define NORM_FILE_TIME 14 #define NORM_EXEC 15 #define NORM_SOCKET_ACCEPT 16 #define NORM_SOCKET_BIND 17 #define NORM_SOCKET_CONN 18 #define NORM_SOCKET_RECV 19 #define NORM_SOCKET_SEND 20 #define NORM_PID 21 #define NORM_MAC 22 #define NORM_MAC_LOAD 23 #define NORM_MAC_CONFIG 24 #define NORM_MAC_ENFORCE 25 #define NORM_MAC_ERR 26 #define NORM_IPTABLES 27 #define NORM_PROMISCUOUS 28 #define NORM_UID 29 #define NORM_GID 30 #define NORM_SYSTEM_TIME 31 #define NORM_MAKE_DEV 32 #define NORM_SYSTEM_NAME 33 #define NORM_FILE_SYS_STAT 34 #define NORM_SYSTEM_MEMORY 35 #define NORM_SCHEDULER 36 #define NORM_AV 37 #define NORM_BPF 38 #define NORM_EV_LISTEN 39 #define NORM_SECURITY_POLICY 40 // This enum is used to map what the system objects are #define NORM_WHAT_UNKNOWN 0 #define NORM_WHAT_FIFO 1 #define NORM_WHAT_CHAR_DEV 2 #define NORM_WHAT_DIRECTORY 3 #define NORM_WHAT_BLOCK_DEV 4 #define NORM_WHAT_FILE 5 #define NORM_WHAT_LINK 6 #define NORM_WHAT_SOCKET 7 #define NORM_WHAT_PROCESS 8 #define NORM_WHAT_FIREWALL 9 #define NORM_WHAT_SERVICE 10 #define NORM_WHAT_ACCT 11 #define NORM_WHAT_USER_SESSION 12 #define NORM_WHAT_VM 13 #define NORM_WHAT_PRINTER 14 #define NORM_WHAT_SYSTEM 15 #define NORM_WHAT_AUDIT_RULE 16 #define NORM_WHAT_AUDIT_CONFIG 17 #define NORM_WHAT_SECURITY_POLICY 18 #define NORM_WHAT_FILESYSTEM 19 #define NORM_WHAT_MEMORY 20 #define NORM_WHAT_KEYSTROKES 21 #define NORM_WHAT_DEVICE 22 #define NORM_WHAT_SOFTWARE 23 #define NORM_WHAT_INTEGRITY_POLICY 24 // This enum is used to map events to what kind they are #define NORM_EVTYPE_UNKNOWN 0 #define NORM_EVTYPE_USERSPACE 1 #define NORM_EVTYPE_SYSTEM_SERVICES 2 #define NORM_EVTYPE_CONFIG 3 #define NORM_EVTYPE_TTY 4 #define NORM_EVTYPE_USER_ACCT 5 #define NORM_EVTYPE_USER_LOGIN 6 #define NORM_EVTYPE_AUDIT_DAEMON 7 #define NORM_EVTYPE_MAC_DECISION 8 #define NORM_EVTYPE_ANOMALY 9 #define NORM_EVTYPE_INTEGRITY 10 #define NORM_EVTYPE_ANOMALY_RESP 11 #define NORM_EVTYPE_MAC 12 #define NORM_EVTYPE_CRYPTO 13 #define NORM_EVTYPE_VIRT 14 #define NORM_EVTYPE_AUDIT_RULE 15 #define NORM_EVTYPE_DAC_DECISION 16 #define NORM_EVTYPE_GROUP_CHANGE 17 #define NORM_EVTYPE_AV_DECISION 18 #define NORM_EVTYPE_BPF 19 #endif audit-4.0.2/auparse/bpftab.h0000644001034500103450000000363114655201403011356 /* bpftab.h -- * Copyright 2018-23 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb * Location: include/uapi/linux/bpf.h */ _S(0, "BPF_MAP_CREATE") _S(1, "BPF_MAP_LOOKUP_ELEM") _S(2, "BPF_MAP_UPDATE_ELEM") _S(3, "BPF_MAP_DELETE_ELEM") _S(4, "BPF_MAP_GET_NEXT_KEY") _S(5, "BPF_PROG_LOAD") _S(6, "BPF_OBJ_PIN") _S(7, "BPF_OBJ_GET") _S(8, "BPF_PROG_ATTACH") _S(9, "BPF_PROG_DETACH") _S(10, "BPF_PROG_TEST_RUN") _S(11, "BPF_PROG_GET_NEXT_ID") _S(12, "BPF_MAP_GET_NEXT_ID") _S(13, "BPF_PROG_GET_FD_BY_ID") _S(14, "BPF_MAP_GET_FD_BY_ID") _S(15, "BPF_OBJ_GET_INFO_BY_FD") _S(16, "BPF_PROG_QUERY") _S(17, "BPF_RAW_TRACEPOINT_OPEN") _S(18, "BPF_BTF_LOAD") _S(19, "BPF_BTF_GET_FD_BY_ID") _S(20, "BPF_TASK_FD_QUERY") _S(21, "BPF_MAP_LOOKUP_AND_DELETE_ELEM") _S(22, "BPF_MAP_FREEZE") _S(23, "BPF_BTF_GET_NEXT_ID") _S(24, "BPF_MAP_LOOKUP_BATCH") _S(25, "BPF_MAP_LOOKUP_AND_DELETE_BATCH") _S(26, "BPF_MAP_UPDATE_BATCH") _S(27, "BPF_MAP_DELETE_BATCH") _S(28, "BPF_LINK_CREATE") _S(29, "BPF_LINK_UPDATE") _S(30, "BPF_LINK_GET_FD_BY_ID") _S(31, "BPF_LINK_GET_NEXT_ID") _S(32, "BPF_ENABLE_STATS") _S(33, "BPF_ITER_CREATE") _S(34, "BPF_LINK_DETACH") _S(35, "BPF_PROG_BIND_MAP") audit-4.0.2/auparse/auparse-idata.h0000644001034500103450000000334114655201403012636 /* * idata.h - Header file for ausearch-lookup.c * Copyright (c) 2013,2016-17,2021 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb */ #ifndef IDATA_HEADER #define IDATA_HEADER #include "config.h" #include "dso.h" #include "auparse-defs.h" typedef struct _idata { unsigned int machine; // The machine type for the event int syscall; // The syscall for the event unsigned long long a0; // arg 0 to the syscall unsigned long long a1; // arg 1 to the syscall const char *cwd; // The current working directory const char *name; // name of field being interpreted const char *val; // value of field being interpreted } idata; int auparse_interp_adjust_type(int rtype, const char *name, const char *val); char *auparse_do_interpretation(int type, const idata *id, auparse_esc_t escape_mode); void _auparse_load_interpretations(const char *buf); void _auparse_free_interpretations(void); const char *_auparse_lookup_interpretation(const char *name); void _auparse_flush_caches(void); #endif audit-4.0.2/auparse/open-flagtab.h0000644001034500103450000000257314655201403012463 /* open-flagtab.h -- * Copyright 2007,2012-14 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb * Location: include/uapi/asm-generic/fcntl.h */ // Handled in the code: _S(00, "O_RDONLY" ) _S(01, "O_WRONLY" ) _S(02, "O_RDWR" ) _S(0100, "O_CREAT") _S(0200, "O_EXCL" ) _S(0400, "O_NOCTTY" ) _S(01000, "O_TRUNC" ) _S(02000, "O_APPEND" ) _S(04000, "O_NONBLOCK" ) _S(010000, "O_DSYNC" ) _S(020000, "O_ASYNC" ) _S(040000, "O_DIRECT" ) _S(0200000, "O_DIRECTORY" ) _S(0400000, "O_NOFOLLOW" ) _S(01000000, "O_NOATIME" ) _S(02000000, "O_CLOEXEC") _S(04000000, "__O_SYNC") _S(010000000, "O_PATH") _S(020000000, "__O_TMPFILE") audit-4.0.2/auparse/sockleveltab.h0000644001034500103450000000326114655201403012575 /* sockleveltab.h -- * Copyright 2013-15,2018 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA * * Authors: * Steve Grubb * Location: include/linux/socket.h */ _S(0, "SOL_IP") _S(6, "SOL_TCP") _S(17, "SOL_UDP") _S(41, "SOL_IPV6") _S(58, "SOL_ICMPV6") _S(132, "SOL_SCTP") _S(136, "SOL_UDPLITE") _S(255, "SOL_RAW") _S(256, "SOL_IPX") _S(257, "SOL_AX25") _S(258, "SOL_ATALK") _S(259, "SOL_NETROM") _S(260, "SOL_ROSE") _S(261, "SOL_DECNET") _S(263, "SOL_PACKET") _S(264, "SOL_ATM") _S(265, "SOL_AAL") _S(266, "SOL_IRDA") _S(267, "SOL_NETBEUI") _S(268, "SOL_LLC") _S(269, "SOL_DCCP") _S(270, "SOL_NETLINK") _S(271, "SOL_TIPC") _S(272, "SOL_RXRPC") _S(273, "SOL_PPPOL2TP") _S(274, "SOL_BLUETOOTH") _S(275, "SOL_PNPIPE") _S(276, "SOL_RDS") _S(277, "SOL_IUCV") _S(278, "SOL_CAIF") _S(279, "SOL_ALG") _S(280, "SOL_NFC") _S(281, "SOL_KCM") _S(282, "SOL_TLS") _S(283, "SOL_XDP") _S(284, "SOL_MPTCP") _S(285, "SOL_MCTP") _S(286, "SOL_SMC") _S(287, "SOL_VSOCK") audit-4.0.2/auparse/interpret.c0000644001034500103450000024314114655201403012131 /* * interpret.c - Lookup values to something more readable * Copyright (c) 2007-09,2011-16,2018-21,2023 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb */ #include "config.h" #include "lru.h" #include "libaudit.h" #include "internal.h" #include "interpret.h" #include "auparse-idata.h" #include "nvlist.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_IPX_HEADERS #include // FIXME: remove when ipx.h is fixed #include #endif #include #include #include #include #include /* PATH_MAX */ #ifdef USE_FANOTIFY #include #else #define FAN_ALLOW 1 #define FAN_DENY 2 #endif // This code is at the center of many performance issues. The following // ensure that it is optimized the most without making all of the audit // subsystem bigger. #pragma GCC optimize("O3") #include "auparse-defs.h" #include "gen_tables.h" #include "common.h" #if !HAVE_DECL_ADDR_NO_RANDOMIZE # define ADDR_NO_RANDOMIZE 0x0040000 #endif /* This is from asm/ipc.h. Copying it for now as some platforms * have broken headers. */ #define SEMOP 1 #define SEMGET 2 #define SEMCTL 3 #define SEMTIMEDOP 4 #define MSGSND 11 #define MSGRCV 12 #define MSGGET 13 #define MSGCTL 14 #define SHMAT 21 #define SHMDT 22 #define SHMGET 23 #define SHMCTL 24 #define DIPC 25 #include "captabs.h" #include "clone-flagtabs.h" #include "epoll_ctls.h" #include "famtabs.h" #include "fcntl-cmdtabs.h" #include "flagtabs.h" #include "fsconfigs.h" #include "ipctabs.h" #include "ipccmdtabs.h" #include "mmaptabs.h" #include "mounttabs.h" #include "open-flagtabs.h" #include "persontabs.h" #include "prottabs.h" #include "ptracetabs.h" #include "recvtabs.h" #include "rlimittabs.h" #include "seektabs.h" #include "socktabs.h" #include "socktypetabs.h" #include "signaltabs.h" #include "clocktabs.h" #include "typetabs.h" #include "nfprototabs.h" #include "icmptypetabs.h" #include "seccomptabs.h" #include "accesstabs.h" #include "prctl_opttabs.h" #include "schedtabs.h" #include "shm_modetabs.h" #include "sockoptnametabs.h" #include "sockleveltabs.h" #include "ipoptnametabs.h" #include "ip6optnametabs.h" #include "tcpoptnametabs.h" #include "pktoptnametabs.h" #include "umounttabs.h" #include "ioctlreqtabs.h" #include "inethooktabs.h" #include "netactiontabs.h" #include "bpftabs.h" #include "openat2-resolvetabs.h" typedef enum { AVC_UNSET, AVC_DENIED, AVC_GRANTED } avc_t; typedef enum { S_UNSET=-1, S_FAILED, S_SUCCESS } success_t; static char *print_escaped(const char *val); static const char *print_signals(const char *val, unsigned int base); // FIXME: move next declaration to auparse_state_t static nvlist il; // Interpretations list /* * This function will take a pointer to a 2 byte Ascii character buffer and * return the actual hex value. */ static unsigned char x2c(const unsigned char *buf) { static const char AsciiArray[17] = "0123456789ABCDEF"; char *ptr; unsigned char total=0; ptr = strchr(AsciiArray, (char)toupper(buf[0])); if (ptr) total = (unsigned char)(((ptr-AsciiArray) & 0x0F)<<4); ptr = strchr(AsciiArray, (char)toupper(buf[1])); if (ptr) total += (unsigned char)((ptr-AsciiArray) & 0x0F); return total; } // Check if any characters need tty escaping. Returns how many found. static unsigned int need_tty_escape(const unsigned char *s, unsigned int len) { unsigned int i = 0, cnt = 0; while (i < len) { if (s[i] < 32) cnt++; i++; } return cnt; } // TTY escaping s string into dest. static void tty_escape(const char *s, char *dest, unsigned int len) { unsigned int i = 0, j = 0; while (i < len) { if ((unsigned char)s[i] < 32) { dest[j++] = ('\\'); dest[j++] = ('0' + ((s[i] & 0300) >> 6)); dest[j++] = ('0' + ((s[i] & 0070) >> 3)); dest[j++] = ('0' + (s[i] & 0007)); } else dest[j++] = s[i]; i++; } dest[j] = '\0'; /* terminate string */ } static const char sh_set[] = "\"'`$\\!()| "; static unsigned int need_shell_escape(const char *s, unsigned int len) { unsigned int i = 0, cnt = 0; while (i < len) { if (s[i] < 32) cnt++; else if (strchr(sh_set, s[i])) cnt++; i++; } return cnt; } static void shell_escape(const char *s, char *dest, unsigned int len) { unsigned int i = 0, j = 0; while (i < len) { if ((unsigned char)s[i] < 32) { dest[j++] = ('\\'); dest[j++] = ('0' + ((s[i] & 0300) >> 6)); dest[j++] = ('0' + ((s[i] & 0070) >> 3)); dest[j++] = ('0' + (s[i] & 0007)); } else if (strchr(sh_set, s[i])) { dest[j++] = ('\\'); dest[j++] = s[i]; } else dest[j++] = s[i]; i++; } dest[j] = '\0'; /* terminate string */ } static const char quote_set[] = "\"'`$\\!()| ;#&*?[]<>{}"; static unsigned int need_shell_quote_escape(const unsigned char *s, unsigned int len) { unsigned int i = 0, cnt = 0; while (i < len) { if (s[i] < 32) cnt++; else if (strchr(quote_set, s[i])) cnt++; i++; } return cnt; } static void shell_quote_escape(const char *s, char *dest, unsigned int len) { unsigned int i = 0, j = 0; while (i < len) { if ((unsigned char)s[i] < 32) { dest[j++] = ('\\'); dest[j++] = ('0' + ((s[i] & 0300) >> 6)); dest[j++] = ('0' + ((s[i] & 0070) >> 3)); dest[j++] = ('0' + (s[i] & 0007)); } else if (strchr(quote_set, s[i])) { dest[j++] = ('\\'); dest[j++] = s[i]; } else dest[j++] = s[i]; i++; } dest[j] = '\0'; /* terminate string */ } /* This should return the count of what needs escaping */ static unsigned int need_escaping(const char *s, unsigned int len, auparse_esc_t escape_mode) { switch (escape_mode) { case AUPARSE_ESC_RAW: break; case AUPARSE_ESC_TTY: return need_tty_escape(s, len); case AUPARSE_ESC_SHELL: return need_shell_escape(s, len); case AUPARSE_ESC_SHELL_QUOTE: return need_shell_quote_escape(s, len); } return 0; } static void escape(const char *s, char *dest, unsigned int len, auparse_esc_t escape_mode) { switch (escape_mode) { case AUPARSE_ESC_RAW: break; case AUPARSE_ESC_TTY: tty_escape(s, dest, len); break; case AUPARSE_ESC_SHELL: shell_escape(s, dest, len); break; case AUPARSE_ESC_SHELL_QUOTE: shell_quote_escape(s, dest, len); break; } } static void key_escape(const char *orig, char *dest, auparse_esc_t escape_mode) { const char *optr = orig; char *str, *dptr = dest, tmp; while (*optr) { unsigned int klen, cnt; // Find the separator or the end str = strchr(optr, AUDIT_KEY_SEPARATOR); if (str == NULL) str = strchr(optr, 0); klen = str - optr; tmp = *str; *str = 0; cnt = need_escaping(optr, klen, escape_mode); if (cnt == 0) dptr = stpcpy(dptr, optr); else { escape(optr, dptr, klen, escape_mode); dptr = strchr(dest, 0); if (dptr == NULL) return; // Something is really messed up } // Put the separator back *str = tmp; *dptr = tmp; optr = str; // If we are not at the end... if (tmp) { optr++; dptr++; } } } static int is_hex_string(const char *str) { while (*str) { if (!isxdigit(*str)) return 0; str++; } return 1; } /* returns a freshly malloc'ed and converted buffer */ char *au_unescape(char *buf) { int olen, len, i; char saved, *str, *ptr = buf; /* Find the end of the name */ if (*ptr == '(') { ptr = strchr(ptr, ')'); if (ptr == NULL) return NULL; else ptr++; } else { while (isxdigit(*ptr)) ptr++; } // Make the buffer based on size of original buffer. // This is in case we have unexpected non-hex digit // that causes truncation of the conversion and passes // back a buffer that is not sized on the expectation of // strlen(buf) / 2. olen = strlen(buf); str = malloc(olen+1); if (!str) return NULL; saved = *ptr; *ptr = 0; strcpy(str, buf); *ptr = saved; /* See if its '(null)' from the kernel */ if (*buf == '(') return str; /* We can get away with this since the buffer is 2 times * bigger than what we are putting there. */ len = strlen(str); if (len < 2) { free(str); return NULL; } ptr = str; for (i=0; i len) memset(ptr, 0, olen - len); return str; } /////////// Interpretation list functions /////////////// #define NEVER_LOADED 0xFFFF void init_interpretation_list(void) { nvlist_create(&il); il.cnt = NEVER_LOADED; } /* * Returns 0 on error and 1 on success */ int load_interpretation_list(const char *buffer) { char *saved = NULL, *ptr; char *buf, *val; nvnode n; if (buffer == NULL) return 0; if (il.cnt == NEVER_LOADED) il.cnt = 0; il.record = buf = strdup(buffer); if (buf == NULL) { goto err_out; } if (strncmp(buf, "SADDR=", 6) == 0) { // We have SOCKADDR record. It has no other values. // Handle it by itself. ptr = strchr(buf+6, '{'); if (ptr) { val = ptr; ptr = strchr(val, '}'); if (ptr) { // Just change the case n.name = strcpy(buf, "saddr"); n.val = val; if (nvlist_append(&il, &n)) goto err_out; nvlist_interp_fixup(&il); return 1; } } err_out: free(buf); il.record = NULL; il.cnt = NEVER_LOADED; return 0; } else { // We handle everything else in this branch ptr = audit_strsplit_r(buf, &saved); if (ptr == NULL) goto err_out; do { char tmp; val = strchr(ptr, '='); if (val) { *val = 0; val++; } else // Malformed - skip continue; n.name = ptr; char *c = n.name; while (*c) { *c = tolower(*c); c++; } ptr = strchr(val, ' '); if (ptr) { tmp = *ptr; *ptr = 0; } else tmp = 0; n.val = val; if (nvlist_append(&il, &n)) continue; // assuming we loaded something nvlist_interp_fixup(&il); if (ptr) *ptr = tmp; } while ((ptr = audit_strsplit_r(NULL, &saved))); } // If for some reason it was useless, delete buf if (il.cnt == 0) goto err_out; return 1; } /* * Returns malloc'ed buffer on success and NULL if no match */ const char *_auparse_lookup_interpretation(const char *name) { nvnode *n; if (il.cnt == NEVER_LOADED) return NULL; nvlist_first(&il); if (nvlist_find_name(&il, name)) { n = nvlist_get_cur(&il); // This is only called from src/ausearch-lookup.c // it only looks up auid and syscall. One needs // escape, the other does not. if (strstr(name, "id")) return print_escaped(n->interp_val); else return strdup(n->interp_val); } return NULL; } void free_interpretation_list(void) { if (il.cnt != NEVER_LOADED) { nvlist_clear(&il, 0); il.cnt = NEVER_LOADED; } } // This uses a sentinel to determine if the list has ever been loaded. // If never loaded, returns 0. Otherwise it returns 1 higher than how // many interpretations are loaded. unsigned int interpretation_list_cnt(void) { if (il.cnt == NEVER_LOADED) return 0; return il.cnt+1; } //////////// Start Field Value Interpretations ///////////// static const char *success[3]= { "unset", "no", "yes" }; static const char *aulookup_success(int s) { switch (s) { default: return success[0]; case S_FAILED: return success[1]; case S_SUCCESS: return success[2]; } } static Queue *uid_cache = NULL; static int uid_cache_created = 0; static const char *aulookup_uid(uid_t uid, char *buf, size_t size) { char *name = NULL; unsigned int key; QNode *q_node; if (uid == -1) { snprintf(buf, size, "unset"); return buf; } else if (uid == 0) { snprintf(buf, size, "root"); return buf; } // Check the cache first if (uid_cache_created == 0) { uid_cache = init_lru(19, NULL, "uid"); uid_cache_created = 1; } key = compute_subject_key(uid_cache, uid); q_node = check_lru_cache(uid_cache, key); if (q_node) { if (q_node->id == uid) name = q_node->str; else { // This getpw use is OK because its for protocol 1 // compatibility. Add it to cache. struct passwd *pw; lru_evict(uid_cache, key); q_node = check_lru_cache(uid_cache, key); pw = getpwuid(uid); if (pw) { q_node->str = strdup(pw->pw_name); q_node->id = uid; name = q_node->str; } } } if (name != NULL) snprintf(buf, size, "%s", name); else snprintf(buf, size, "unknown(%d)", uid); return buf; } void aulookup_destroy_uid_list(void) { if (uid_cache_created == 0) return; destroy_lru(uid_cache); uid_cache_created = 0; } static Queue *gid_cache = NULL; static int gid_cache_created = 0; static const char *aulookup_gid(gid_t gid, char *buf, size_t size) { char *name = NULL; unsigned int key; QNode *q_node; if (gid == -1) { snprintf(buf, size, "unset"); return buf; } else if (gid == 0) { snprintf(buf, size, "root"); return buf; } // Check the cache first if (gid_cache_created == 0) { gid_cache = init_lru(19, NULL, "gid"); gid_cache_created = 1; } key = compute_subject_key(gid_cache, gid); q_node = check_lru_cache(gid_cache, key); if (q_node) { if (q_node->id == gid) name = q_node->str; else { // Add it to cache struct group *gr; lru_evict(gid_cache, key); q_node = check_lru_cache(gid_cache, key); gr = getgrgid(gid); if (gr) { q_node->str = strdup(gr->gr_name); q_node->id = gid; name = q_node->str; } } } if (name != NULL) snprintf(buf, size, "%s", name); else snprintf(buf, size, "unknown(%d)", gid); return buf; } void aulookup_destroy_gid_list(void) { if (gid_cache_created == 0) return; destroy_lru(gid_cache); gid_cache_created = 0; } void _auparse_flush_caches(void) { if (uid_cache_created) { destroy_lru(uid_cache); uid_cache_created = 0; } if (gid_cache_created) { destroy_lru(gid_cache); gid_cache_created = 0; } } void aulookup_metrics(unsigned int *uid, unsigned int *gid) { *uid = uid_cache->count; *gid = gid_cache->count; } static const char *print_uid(const char *val, unsigned int base) { int uid; char name[64]; errno = 0; uid = strtoul(val, NULL, base); if (errno) { char *out; if (asprintf(&out, "conversion error(%s)", val) < 0) out = NULL; return out; } return strdup(aulookup_uid(uid, name, sizeof(name))); } static const char *print_gid(const char *val, unsigned int base) { int gid; char name[64]; errno = 0; gid = strtoul(val, NULL, base); if (errno) { char *out; if (asprintf(&out, "conversion error(%s)", val) < 0) out = NULL; return out; } return strdup(aulookup_gid(gid, name, sizeof(name))); } static const char *print_arch(const char *val, unsigned int machine) { const char *ptr; char *out; if (machine > MACH_AARCH64) { unsigned int ival; errno = 0; ival = strtoul(val, NULL, 16); if (errno) { if (asprintf(&out, "conversion error(%s) ", val) < 0) out = NULL; return out; } machine = audit_elf_to_machine(ival); } if ((int)machine < 0) { if (asprintf(&out, "unknown-elf-type(%s)", val) < 0) out = NULL; return out; } ptr = audit_machine_to_name(machine); if (ptr) return strdup(ptr); else { if (asprintf(&out, "unknown-machine-type(%u)", machine) < 0) out = NULL; return out; } } static const char *print_ipccall(const char *val, unsigned int base) { int a0; char *out; const char *func = NULL; errno = 0; a0 = strtol(val, NULL, base); if (errno) { char *out2; if (asprintf(&out2, "conversion error(%s)", val) < 0) out2 = NULL; return out2; } func = ipc_i2s(a0); if (func) return strdup(func); else { if (asprintf(&out, "unknown-ipccall(%s)", val) < 0) out = NULL; return out; } } static const char *print_socketcall(const char *val, unsigned int base) { int a0; char *out; const char *func = NULL; errno = 0; a0 = strtol(val, NULL, base); if (errno) { char *out2; if (asprintf(&out2, "conversion error(%s)", val) < 0) out2 = NULL; return out2; } func = sock_i2s(a0); if (func) return strdup(func); else { if (asprintf(&out, "unknown-socketcall(%s)", val) < 0) out = NULL; return out; } } static const char *print_syscall(const idata *id) { const char *sys; char *out; int machine = id->machine, syscall = id->syscall; unsigned long long a0 = id->a0; if (machine < 0) machine = audit_detect_machine(); if (machine < 0) { out = strdup(id->val); return out; } sys = audit_syscall_to_name(syscall, machine); if (sys) { const char *func = NULL; if (strcmp(sys, "socketcall") == 0) { if ((int)a0 == a0) func = sock_i2s(a0); } else if (strcmp(sys, "ipc") == 0) if ((int)a0 == a0) func = ipc_i2s(a0); if (func) { if (asprintf(&out, "%s(%s)", sys, func) < 0) out = NULL; } else return strdup(sys); } else { if (asprintf(&out, "unknown-syscall(%d)", syscall) < 0) out = NULL; } return out; } static const char *print_exit(const char *val) { long long ival; char *out; errno = 0; ival = strtoll(val, NULL, 10); if (errno) { if (asprintf(&out, "conversion error(%s)", val) < 0) out = NULL; return out; } if (ival < 0) { if (asprintf(&out, "%s(%s)", audit_errno_to_name(-ival), strerror(-ival)) < 0) out = NULL; return out; } return strdup(val); } static char *print_escaped(const char *val) { char *out; if (val == NULL) return strdup(" "); if (*val == '"') { char *term; val++; term = strchr(val, '"'); if (term == NULL) return strdup(" "); *term = 0; out = strdup(val); *term = '"'; return out; // FIXME: working here...was trying to detect (null) and handle that // differently. The other 2 should have " around the file names. /* } else if (*val == '(') { char *term; val++; term = strchr(val, ' '); if (term == NULL) return; *term = 0; printf("%s ", val); */ } else if (val[0] == '0' && val[1] == '0') out = au_unescape((char *)&val[2]); // Abstract name af_unix else out = au_unescape((char *)val); if (out) return out; return strdup(val); // Something is wrong with string, just send as is } // This code is loosely based on glibc-2.27 realpath. static char working[PATH_MAX]; static char *path_norm(const char *name) { char *rpath, *dest; const char *start, *end, *rpath_limit; int old_errno = errno; errno = EINVAL; if (name == NULL) return NULL; if (name[0] == 0) return NULL; errno = old_errno; // If not absolute, give it back as is if (name[0] == '.') return strdup(name); rpath = working; dest = rpath; rpath_limit = rpath + PATH_MAX; for (start = name; *start; start = end) { // Remove duplicate '/' while (*start == '/') ++start; // Find end of path component for (end = start; *end && *end != '/'; ++end) ; //empty // if it ends with a slash, we're done if (end - start == 0) break; else if (end - start == 1 && start[0] == '.') ; //empty else if (end - start == 2 && start[0] == '.' && start[1] == '.') { // Back up to previous component, ignore if root if (dest > rpath + 1) while ((--dest)[-1] != '/'); } else { if (dest != working && dest[-1] != '/') *dest++ = '/'; // If it will overflow, chop it at last component if (dest + (end - start) >= rpath_limit) { *dest = 0; break; } // Otherwise copy next component dest = mempcpy (dest, start, end - start); *dest = 0; } } return strdup(working); } static const char *print_escaped_ext(const idata *id) { if (id->cwd) { char *str1 = NULL, *str2, *str3 = NULL, *out = NULL; str2 = print_escaped(id->val); if (!str2) goto err_out; if (*str2 != '/') { // Glue the cwd and path together str1 = print_escaped(id->cwd); if (!str1) goto err_out; if (asprintf(&str3, "%s/%s", str1, str2) < 0) goto err_out; } else { // Normal looking string str3 = str2; str2 = NULL; } // Check in case /home/../etc/passwd if (strstr(str3, "..") == NULL) { free(str1); free(str2); return str3; // Nope, just return the string } out = path_norm(str3); if (!out) { // If there's an error, just return the original free(str1); free(str2); return str3; } err_out: free(str1); free(str2); free(str3); return out; } else return print_escaped(id->val); } // rawmemchr is faster. Let's use it if we have it. #ifdef HAVE_RAWMEMCHR #define STRCHR rawmemchr #else #define STRCHR strchr #endif static const char *print_proctitle(const char *val) { char *out = (char *)print_escaped(val); if (*val != '"') { size_t len = strlen(val) / 2; const char *end = out + len; char *ptr = out; // Proctitle has arguments separated by NUL bytes // We need to write over the NUL bytes with a space // so that we can see the arguments while ((ptr = STRCHR(ptr, '\0'))) { if (ptr >= end) break; *ptr = ' '; ptr++; } } return out; } static const char *print_perm(const char *val) { int ival, printed=0; char buf[32]; errno = 0; ival = strtol(val, NULL, 10); if (errno) { char *out; if (asprintf(&out, "conversion error(%s)", val) < 0) out = NULL; return out; } buf[0] = 0; /* The kernel treats nothing (0x00) as everything (0x0F) */ if (ival == 0) ival = 0x0F; if (ival & AUDIT_PERM_READ) { strcat(buf, "read"); printed = 1; } if (ival & AUDIT_PERM_WRITE) { if (printed) strcat(buf, ",write"); else strcat(buf, "write"); printed = 1; } if (ival & AUDIT_PERM_EXEC) { if (printed) strcat(buf, ",exec"); else strcat(buf, "exec"); printed = 1; } if (ival & AUDIT_PERM_ATTR) { if (printed) strcat(buf, ",attr"); else strcat(buf, "attr"); } return strdup(buf); } static const char *print_mode(const char *val, unsigned int base) { unsigned int ival; char *out, buf[48]; const char *name; errno = 0; ival = strtoul(val, NULL, base); if (errno) { if (asprintf(&out, "conversion error(%s)", val) < 0) out = NULL; return out; } // detect the file type name = audit_ftype_to_name(ival & S_IFMT); if (name != NULL) strcpy(buf, name); else { unsigned first_ifmt_bit; // The lowest-valued "1" bit in S_IFMT first_ifmt_bit = S_IFMT & ~(S_IFMT - 1); sprintf(buf, "%03o", (ival & S_IFMT) / first_ifmt_bit); } // check on special bits if (S_ISUID & ival) strcat(buf, ",suid"); if (S_ISGID & ival) strcat(buf, ",sgid"); if (S_ISVTX & ival) strcat(buf, ",sticky"); // and the read, write, execute flags in octal if (asprintf(&out, "%s,%03o", buf, (S_IRWXU|S_IRWXG|S_IRWXO) & ival) < 0) out = NULL; return out; } static const char *print_mode_short_int(unsigned int ival) { char *out, buf[48]; // check on special bits buf[0] = 0; if (S_ISUID & ival) strcat(buf, "suid"); if (S_ISGID & ival) { if (buf[0]) strcat(buf, ","); strcat(buf, "sgid"); } if (S_ISVTX & ival) { if (buf[0]) strcat(buf, ","); strcat(buf, "sticky"); } // and the read, write, execute flags in octal if (buf[0] == 0) { if (asprintf(&out, "0%03o", (S_IRWXU|S_IRWXG|S_IRWXO) & ival) < 0) out = NULL; } else if (asprintf(&out, "%s,0%03o", buf, (S_IRWXU|S_IRWXG|S_IRWXO) & ival) < 0) out = NULL; return out; } static const char *print_mode_short(const char *val, int base) { unsigned int ival; char *out; errno = 0; ival = strtoul(val, NULL, base); if (errno) { if (asprintf(&out, "conversion error(%s)", val) < 0) out = NULL; return out; } return print_mode_short_int(ival); } static const char *print_socket_domain(const char *val) { int i; char *out; const char *str; errno = 0; i = strtoul(val, NULL, 16); if (errno) { if (asprintf(&out, "conversion error(%s)", val) < 0) out = NULL; return out; } str = fam_i2s(i); if (str == NULL) { if (asprintf(&out, "unknown-family(0x%s)", val) < 0) out = NULL; return out; } else return strdup(str); } static const char *print_socket_type(const char *val) { unsigned int type; char *out; const char *str; errno = 0; type = 0xFF & strtoul(val, NULL, 16); if (errno) { if (asprintf(&out, "conversion error(%s)", val) < 0) out = NULL; return out; } str = sock_type_i2s(type); if (str == NULL) { if (asprintf(&out, "unknown-type(%s)", val) < 0) out = NULL; return out; } else return strdup(str); } static const char *print_socket_proto(const char *val) { unsigned int proto; char *out; struct protoent *p; errno = 0; proto = strtoul(val, NULL, 16); if (errno) { if (asprintf(&out, "conversion error(%s)", val) < 0) out = NULL; return out; } p = getprotobynumber(proto); if (p == NULL) { if (asprintf(&out, "unknown-proto(%s)", val) < 0) out = NULL; return out; } else return strdup(p->p_name); } static const char *print_sockaddr(const char *val) { size_t slen; int rc = 0; const struct sockaddr *saddr; char name[NI_MAXHOST], serv[NI_MAXSERV]; const char *host; char *out = NULL; const char *str; slen = strlen(val)/2; host = au_unescape((char *)val); if (host == NULL) { if (asprintf(&out, "malformed-host(%s)", val) < 0) out = NULL; return out; } saddr = (struct sockaddr *)host; str = fam_i2s(saddr->sa_family); if (str == NULL) { if (asprintf(&out, "unknown-family(%d)", saddr->sa_family) < 0) out = NULL; free((char *)host); return out; } // Now print address for some families switch (saddr->sa_family) { case AF_LOCAL: if (slen < 4) { rc = asprintf(&out, "{ saddr_fam=%s %s }", str, slen == sizeof(saddr->sa_family) ? "unnamed socket" : // ignore sun_path "sockaddr len too short"); break; } else { const struct sockaddr_un *un = (const struct sockaddr_un *)saddr; if (un->sun_path[0]) rc = asprintf(&out, "{ saddr_fam=%s path=%.108s }", str, un->sun_path); else // abstract name rc = asprintf(&out, "{ saddr_fam=%s path=%.108s }", str, &un->sun_path[1]); } break; case AF_INET: if (slen < sizeof(struct sockaddr_in)) { rc = asprintf(&out, "{ saddr_fam=%s sockaddr len too short }", str); break; } slen = sizeof(struct sockaddr_in); if (getnameinfo(saddr, slen, name, NI_MAXHOST, serv, NI_MAXSERV, NI_NUMERICHOST | NI_NUMERICSERV) == 0 ) { rc = asprintf(&out, "{ saddr_fam=%s laddr=%s lport=%s }", str, name, serv); } else rc = asprintf(&out, "{ saddr_fam=%s (error resolving addr) }", str); break; case AF_AX25: { const struct sockaddr_ax25 *x = (const struct sockaddr_ax25 *)saddr; rc = asprintf(&out, "{ saddr_fam=%s call=%c%c%c%c%c%c%c }", str, x->sax25_call.ax25_call[0], x->sax25_call.ax25_call[1], x->sax25_call.ax25_call[2], x->sax25_call.ax25_call[3], x->sax25_call.ax25_call[4], x->sax25_call.ax25_call[5], x->sax25_call.ax25_call[6]); } break; #ifdef HAVE_IPX_HEADERS case AF_IPX: { const struct sockaddr_ipx *ip = (const struct sockaddr_ipx *)saddr; rc = asprintf(&out, "{ saddr_fam=%s lport=%d ipx-net=%u }", str, ip->sipx_port, ip->sipx_network); } break; #endif case AF_ATMPVC: { const struct sockaddr_atmpvc* at = (const struct sockaddr_atmpvc *)saddr; rc = asprintf(&out, "{ saddr_fam=%s int=%d }", str, at->sap_addr.itf); } break; case AF_X25: { const struct sockaddr_x25* x = (const struct sockaddr_x25 *)saddr; rc = asprintf(&out, "{ saddr_fam=%s laddr=%.15s }", str, x->sx25_addr.x25_addr); } break; case AF_INET6: if (slen < sizeof(struct sockaddr_in6)) { rc = asprintf(&out, "{ saddr_fam=%s sockaddr6 len too short }", str); break; } slen = sizeof(struct sockaddr_in6); if (getnameinfo(saddr, slen, name, NI_MAXHOST, serv, NI_MAXSERV, NI_NUMERICHOST | NI_NUMERICSERV) == 0 ) { rc = asprintf(&out, "{ saddr_fam=%s laddr=%s lport=%s }", str, name, serv); } else rc = asprintf(&out, "{ saddr_fam=%s (error resolving addr) }", str); break; case AF_NETLINK: if (slen < sizeof(struct sockaddr_nl)) { rc = asprintf(&out, "{ saddr_fam=%s len too short }", str); break; } else { const struct sockaddr_nl *n = (const struct sockaddr_nl *)saddr; rc = asprintf(&out, "{ saddr_fam=%s nlnk-fam=%u nlnk-pid=%u }", str, n->nl_family, n->nl_pid); } break; default: rc = asprintf(&out, "{ saddr_fam=%s (unsupported) }", str); break; } if (rc < 0) out = NULL; free((char *)host); return out; } /* This is only used in the RHEL4 kernel */ static const char *print_flags(const char *val) { int flags, cnt = 0; size_t i; char *out, buf[sizeof(flag_strings)+FLAG_NUM_ENTRIES+1]; errno = 0; flags = strtoul(val, NULL, 16); if (errno) { if (asprintf(&out, "conversion error(%s)", val) < 0) out = NULL; return out; } if (flags == 0) { if (asprintf(&out, "none") < 0) out = NULL; return out; } buf[0] = 0; for (i=0; i> 32; p = buf; for (i=0; i <= CAP_LAST_CAP; i++) { if (MASK(i%32) & caps[i/32]) { const char *s; if (found) p = stpcpy(p, ","); s = cap_i2s(i); if (s != NULL) p = stpcpy(p, s); found = 1; } } if (found == 0) return strdup("none"); return strdup(buf); } static const char *print_success(const char *val) { int res; if (isdigit((unsigned char)*val)) { errno = 0; res = strtoul(val, NULL, 10); if (errno) { char *out; if (asprintf(&out, "conversion error(%s)", val) < 0) out = NULL; return out; } return strdup(aulookup_success(res)); } else return strdup(val); } static const char *print_open_flags(const char *val, int base) { size_t i; unsigned long flags; int cnt = 0; char *out, buf[sizeof(open_flag_strings)+OPEN_FLAG_NUM_ENTRIES+1]; errno = 0; flags = strtoul(val, NULL, base); if (errno) { if (asprintf(&out, "conversion error(%s)", val) < 0) out = NULL; return out; } buf[0] = 0; if ((flags & O_ACCMODE) == 0) { // Handle O_RDONLY specially strcat(buf, "O_RDONLY"); cnt++; } for (i=0; ip_name); } return out; } static const char *print_sock_opt_name(const char *val, int machine) { int opt; char *out; const char *s; errno = 0; opt = strtoul(val, NULL, 16); if (errno) { if (asprintf(&out, "conversion error(%s)", val) < 0) out = NULL; return out; } // PPC's tables are different if ((machine == MACH_PPC64 || machine == MACH_PPC) && opt >= 16 && opt <= 21) opt+=100; s = sockoptname_i2s(opt); if (s != NULL) return strdup(s); if (asprintf(&out, "unknown-sockopt-name(0x%s)", val) < 0) out = NULL; return out; } static const char *print_ip_opt_name(const char *val) { int opt; char *out; const char *s; errno = 0; opt = strtoul(val, NULL, 16); if (errno) { if (asprintf(&out, "conversion error(%s)", val) < 0) out = NULL; return out; } s = ipoptname_i2s(opt); if (s != NULL) return strdup(s); if (asprintf(&out, "unknown-ipopt-name(0x%s)", val) < 0) out = NULL; return out; } static const char *print_ip6_opt_name(const char *val) { int opt; char *out; const char *s; errno = 0; opt = strtoul(val, NULL, 16); if (errno) { if (asprintf(&out, "conversion error(%s)", val) < 0) out = NULL; return out; } s = ip6optname_i2s(opt); if (s != NULL) return strdup(s); if (asprintf(&out, "unknown-ip6opt-name(0x%s)", val) < 0) out = NULL; return out; } static const char *print_tcp_opt_name(const char *val) { int opt; char *out; const char *s; errno = 0; opt = strtoul(val, NULL, 16); if (errno) { if (asprintf(&out, "conversion error(%s)", val) < 0) out = NULL; return out; } s = tcpoptname_i2s(opt); if (s != NULL) return strdup(s); if (asprintf(&out, "unknown-tcpopt-name(0x%s)", val) < 0) out = NULL; return out; } static const char *print_udp_opt_name(const char *val) { int opt; char *out; errno = 0; opt = strtoul(val, NULL, 16); if (errno) { if (asprintf(&out, "conversion error(%s)", val) < 0) out = NULL; return out; } if (opt == 1) out = strdup("UDP_CORK"); else if (opt == 100) out = strdup("UDP_ENCAP"); else if (asprintf(&out, "unknown-udpopt-name(0x%s)", val) < 0) out = NULL; return out; } static const char *print_pkt_opt_name(const char *val) { int opt; char *out; const char *s; errno = 0; opt = strtoul(val, NULL, 16); if (errno) { if (asprintf(&out, "conversion error(%s)", val) < 0) out = NULL; return out; } s = pktoptname_i2s(opt); if (s != NULL) return strdup(s); if (asprintf(&out, "unknown-pktopt-name(0x%s)", val) < 0) out = NULL; return out; } static const char *print_shmflags(const char *val) { unsigned int flags, partial, i; int cnt = 0; char *out, buf[sizeof(shm_mode_strings)+sizeof(ipccmd_strings)+SHM_MODE_NUM_ENTRIES+IPCCMD_NUM_ENTRIES+1]; errno = 0; flags = strtoul(val, NULL, 16); if (errno) { if (asprintf(&out, "conversion error(%s)", val) < 0) out = NULL; return out; } partial = flags & 00003000; buf[0] = 0; for (i=0; imachine, syscall = id->syscall; const char *sys = audit_syscall_to_name(syscall, machine); if (sys) { if (*sys == 'r') { if (strcmp(sys, "rt_sigaction") == 0) return print_signals(val, 16); else if (strncmp(sys, "renameat", 8) == 0) return print_dirfd(val); else if (strcmp(sys, "readlinkat") == 0) return print_dirfd(val); } else if (*sys == 'c') { if (strcmp(sys, "clock_settime") == 0) return print_clock_id(val); } else if (*sys == 'p') { if (strcmp(sys, "personality") == 0) return print_personality(val); else if (strcmp(sys, "ptrace") == 0) return print_ptrace(val); else if (strcmp(sys, "prctl") == 0) return print_prctl_opt(val); } else if (*sys == 'm') { if (strcmp(sys, "mkdirat") == 0) return print_dirfd(val); else if (strcmp(sys, "mknodat") == 0) return print_dirfd(val); } else if (*sys == 'f') { if (strcmp(sys, "fchownat") == 0) return print_dirfd(val); else if (strcmp(sys, "futimesat") == 0) return print_dirfd(val); else if (strcmp(sys, "fchmodat") == 0) return print_dirfd(val); else if (strncmp(sys, "faccessat", 9) == 0) return print_dirfd(val); else if (strcmp(sys, "futimensat") == 0) return print_dirfd(val); } else if (*sys == 'u') { if (strcmp(sys, "unshare") == 0) return print_clone_flags(val); else if (strcmp(sys, "unlinkat") == 0) return print_dirfd(val); else if (strcmp(sys, "utimensat") == 0) return print_dirfd(val); } else if (strcmp(sys+1, "etrlimit") == 0) return print_rlimit(val); else if (*sys == 's') { if (strcmp(sys, "setuid") == 0) return print_uid(val, 16); else if (strcmp(sys, "setreuid") == 0) return print_uid(val, 16); else if (strcmp(sys, "setresuid") == 0) return print_uid(val, 16); else if (strcmp(sys, "setfsuid") == 0) return print_uid(val, 16); else if (strcmp(sys, "setgid") == 0) return print_gid(val, 16); else if (strcmp(sys, "setregid") == 0) return print_gid(val, 16); else if (strcmp(sys, "setresgid") == 0) return print_gid(val, 16); else if (strcmp(sys, "socket") == 0) return print_socket_domain(val); else if (strcmp(sys, "setfsgid") == 0) return print_gid(val, 16); else if (strcmp(sys, "socketcall") == 0) return print_socketcall(val, 16); } else if (strcmp(sys, "linkat") == 0) return print_dirfd(val); else if (strcmp(sys, "newfstatat") == 0) return print_dirfd(val); else if (strncmp(sys, "openat", 6) == 0) return print_dirfd(val); else if (strcmp(sys, "name_to_handle_at") == 0) return print_dirfd(val); else if (strcmp(sys, "ipccall") == 0) return print_ipccall(val, 16); else if (strncmp(sys, "exit", 4) == 0) return print_exit_syscall(val); else if (strcmp(sys, "bpf") == 0) return print_bpf(val); } if (asprintf(&out, "0x%s", val) < 0) out = NULL; return out; } static const char *print_a1(const char *val, const idata *id) { char *out; int machine = id->machine, syscall = id->syscall; const char *sys = audit_syscall_to_name(syscall, machine); if (sys) { if (*sys == 'f') { if (strcmp(sys, "fchmod") == 0) return print_mode_short(val, 16); else if (strncmp(sys, "fcntl", 5) == 0) return print_fcntl_cmd(val); else if (strncmp(sys, "fsconfig", 5) == 0) return print_fsconfig(val); else if (strncmp(sys, "fsopen", 6) == 0) { if (strcmp(val, "1") == 0) return strdup("FSOPEN_CLOEXEC"); } else if (strncmp(sys, "fsmount", 7) == 0) { if (strcmp(val, "1") == 0) return strdup("FSMOUNT_CLOEXEC"); } } else if (*sys == 'c') { if (strcmp(sys, "chmod") == 0) return print_mode_short(val, 16); else if (strstr(sys, "chown")) return print_uid(val, 16); else if (strcmp(sys, "creat") == 0) return print_mode_short(val, 16); } if (strcmp(sys+1, "etsockopt") == 0) return print_sock_opt_level(val); else if (*sys == 's') { if (strcmp(sys, "setreuid") == 0) return print_uid(val, 16); else if (strcmp(sys, "setresuid") == 0) return print_uid(val, 16); else if (strcmp(sys, "setregid") == 0) return print_gid(val, 16); else if (strcmp(sys, "setresgid") == 0) return print_gid(val, 16); else if (strcmp(sys, "socket") == 0) return print_socket_type(val); else if (strcmp(sys, "setns") == 0) return print_clone_flags(val); else if (strcmp(sys, "sched_setscheduler") == 0) return print_sched(val); } else if (*sys == 'm') { if (strcmp(sys, "mkdir") == 0) return print_mode_short(val, 16); else if (strcmp(sys, "mknod") == 0) return print_mode(val, 16); else if (strcmp(sys, "mq_open") == 0) return print_open_flags(val, 16); } else if (strcmp(sys, "open") == 0) return print_open_flags(val, 16); else if (strcmp(sys, "access") == 0) return print_access(val); else if (strcmp(sys, "epoll_ctl") == 0) return print_epoll_ctl(val); else if (strcmp(sys, "kill") == 0) return print_signals(val, 16); else if (strcmp(sys, "prctl") == 0) { if (id->a0 == PR_CAPBSET_READ || id->a0 == PR_CAPBSET_DROP) return print_capabilities(val, 16); else if (id->a0 == PR_SET_PDEATHSIG) return print_signals(val, 16); } else if (strcmp(sys, "tkill") == 0) return print_signals(val, 16); else if (strcmp(sys, "umount2") == 0) return print_umount(val); else if (strcmp(sys, "ioctl") == 0) return print_ioctl_req(val); } if (asprintf(&out, "0x%s", val) < 0) out = NULL; return out; } static const char *print_a2(const char *val, const idata *id) { char *out; int machine = id->machine, syscall = id->syscall; const char *sys = audit_syscall_to_name(syscall, machine); if (sys) { if (strncmp(sys, "fcntl", 5) == 0) { int ival; errno = 0; ival = strtoul(val, NULL, 16); if (errno) { if (asprintf(&out, "conversion error(%s)", val) < 0) out = NULL; return out; } switch (id->a1) { case F_SETOWN: return print_uid(val, 16); case F_SETFD: if (ival == FD_CLOEXEC) return strdup("FD_CLOEXEC"); /* Fall thru okay. */ case F_SETFL: case F_SETLEASE: case F_GETLEASE: case F_NOTIFY: break; } } else if (strcmp(sys+1, "etsockopt") == 0) { if (id->a1 == IPPROTO_IP) return print_ip_opt_name(val); else if (id->a1 == SOL_SOCKET) return print_sock_opt_name(val, machine); else if (id->a1 == IPPROTO_TCP) return print_tcp_opt_name(val); else if (id->a1 == IPPROTO_UDP) return print_udp_opt_name(val); else if (id->a1 == IPPROTO_IPV6) return print_ip6_opt_name(val); else if (id->a1 == SOL_PACKET) return print_pkt_opt_name(val); else goto normal; } else if (*sys == 'o') { if (strcmp(sys, "openat") == 0) return print_open_flags(val, 16); if ((strcmp(sys, "open") == 0) && (id->a1 & O_CREAT)) return print_mode_short(val, 16); if (strcmp(sys, "open_by_handle_at") == 0) return print_open_flags(val, 16); } else if (*sys == 'f') { if (strcmp(sys, "fchmodat") == 0) return print_mode_short(val, 16); else if (strncmp(sys, "faccessat", 9) == 0) return print_access(val); else if (strncmp(sys, "fsmount", 7) == 0) return print_mount(val); } else if (*sys == 's') { if (strcmp(sys, "setresuid") == 0) return print_uid(val, 16); else if (strcmp(sys, "setresgid") == 0) return print_gid(val, 16); else if (strcmp(sys, "socket") == 0) return print_socket_proto(val); else if (strcmp(sys, "sendmsg") == 0) return print_recv(val); else if (strcmp(sys, "shmget") == 0) return print_shmflags(val); } else if (*sys == 'm') { if (strcmp(sys, "mmap") == 0) return print_prot(val, 1); else if (strcmp(sys, "mkdirat") == 0) return print_mode_short(val, 16); else if (strcmp(sys, "mknodat") == 0) return print_mode_short(val, 16); else if (strcmp(sys, "mprotect") == 0) return print_prot(val, 0); else if (strcmp(sys, "move_mount") == 0) return print_dirfd(val); else if ((strcmp(sys, "mq_open") == 0) && (id->a1 & O_CREAT)) return print_mode_short(val, 16); } else if (*sys == 'r') { if (strcmp(sys, "recvmsg") == 0) return print_recv(val); else if (strcmp(sys, "readlinkat") == 0) return print_dirfd(val); else if (strncmp(sys, "renameat", 8) == 0) return print_dirfd(val); } else if (*sys == 'l') { if (strcmp(sys, "linkat") == 0) return print_dirfd(val); else if (strcmp(sys, "lseek") == 0) return print_seek(val); } else if (*sys == 'c') { if (strcmp(sys, "clone") == 0) return print_clone_flags(val); else if (strcmp(sys, "clone2") == 0) return print_clone_flags(val); } else if (strstr(sys, "chown")) return print_gid(val, 16); else if (strcmp(sys, "tgkill") == 0) return print_signals(val, 16); } normal: if (asprintf(&out, "0x%s", val) < 0) out = NULL; return out; } static const char *print_a3(const char *val, const idata *id) { char *out; int machine = id->machine, syscall = id->syscall; const char *sys = audit_syscall_to_name(syscall, machine); if (sys) { if (*sys == 'm') { if (strcmp(sys, "mmap") == 0) return print_mmap(val); else if (strcmp(sys, "mount") == 0) return print_mount(val); } else if (*sys == 'r') { if (strcmp(sys, "recv") == 0) return print_recv(val); else if (strcmp(sys, "recvfrom") == 0) return print_recv(val); else if (strcmp(sys, "recvmmsg") == 0) return print_recv(val); } else if (*sys == 's') { if (strcmp(sys, "send") == 0) return print_recv(val); else if (strcmp(sys, "sendto") == 0) return print_recv(val); else if (strcmp(sys, "sendmmsg") == 0) return print_recv(val); } } if (asprintf(&out, "0x%s", val) < 0) out = NULL; return out; } static const char *print_signals(const char *val, unsigned int base) { int i; char *out; errno = 0; i = strtoul(val, NULL, base); if (errno) { if (asprintf(&out, "conversion error(%s)", val) < 0) out = NULL; return out; } else if (i < 32) { const char *s = signal_i2s(i); if (s != NULL) return strdup(s); } if (asprintf(&out, "unknown-signal(%s%s)", base == 16 ? "0x" : "", val) < 0) out = NULL; return out; } static const char *print_nfproto(const char *val) { int proto; char *out; const char *s; errno = 0; proto = strtoul(val, NULL, 10); if (errno) { if (asprintf(&out, "conversion error(%s)", val) < 0) out = NULL; return out; } s = nfproto_i2s(proto); if (s != NULL) return strdup(s); if (asprintf(&out, "unknown-netfilter-protocol(%s)", val) < 0) out = NULL; return out; } static const char *print_icmptype(const char *val) { int icmptype; char *out; const char *s; errno = 0; icmptype = strtoul(val, NULL, 10); if (errno) { if (asprintf(&out, "conversion error(%s)", val) < 0) out = NULL; return out; } s = icmptype_i2s(icmptype); if (s != NULL) return strdup(s); if (asprintf(&out, "unknown-icmp-type(%s)", val) < 0) out = NULL; return out; } static const char *print_protocol(const char *val) { int i; char *out; errno = 0; i = strtoul(val, NULL, 10); if (errno) { if (asprintf(&out, "conversion error(%s)", val) < 0) out = NULL; } else { struct protoent *p = getprotobynumber(i); if (p) out = strdup(p->p_name); else out = strdup("undefined protocol"); } return out; } /* FIXME - this assumes inet hook. Could also be an arp hook */ static const char *print_hook(const char *val) { int hook; char *out; const char *str; errno = 0; hook = strtoul(val, NULL, 16); if (errno) { if (asprintf(&out, "conversion error(%s)", val) < 0) out = NULL; return out; } str = inethook_i2s(hook); if (str == NULL) { if (asprintf(&out, "unknown-hook(%s)", val) < 0) out = NULL; return out; } else return strdup(str); } static const char *print_netaction(const char *val) { int action; char *out; const char *str; errno = 0; action = strtoul(val, NULL, 16); if (errno) { if (asprintf(&out, "conversion error(%s)", val) < 0) out = NULL; return out; } str = netaction_i2s(action); if (str == NULL) { if (asprintf(&out, "unknown-action(%s)", val) < 0) out = NULL; return out; } else return strdup(str); } /* Ethernet packet types */ static const char *print_macproto(const char *val) { int type; char *out; errno = 0; type = strtoul(val, NULL, 16); if (errno) { if (asprintf(&out, "conversion error(%s)", val) < 0) out = NULL; return out; } if (type == 0x0800) return strdup("IP"); else if (type == 0x0806) return strdup("ARP"); return strdup("UNKNOWN"); } static const char *print_addr(const char *val) { char *out = strdup(val); return out; } static const char *print_list(const char *val) { int i; char *out; errno = 0; i = strtoul(val, NULL, 10); if (errno) { if (asprintf(&out, "conversion error(%s)", val) < 0) out = NULL; } else { const char *o = audit_flag_to_name(i); if (o != NULL) out = strdup(o); else if (asprintf(&out, "unknown-list(%s)", val) < 0) out = NULL; } return out; } struct string_buf { char *buf; /* NULL if was ever out of memory */ size_t allocated; size_t pos; }; /* Append c to buf. */ static void append_char(struct string_buf *buf, char c) { if (buf->buf == NULL) return; if (buf->pos == buf->allocated) { char *p; buf->allocated *= 2; p = realloc(buf->buf, buf->allocated); if (p == NULL) { free(buf->buf); buf->buf = NULL; return; } buf->buf = p; } buf->buf[buf->pos] = c; buf->pos++; } /* Represent c as a character within a quoted string, and append it to buf. */ static void tty_append_printable_char(struct string_buf *buf, unsigned char c) { if (c < 0x20 || c > 0x7E) { append_char(buf, '\\'); append_char(buf, '0' + ((c >> 6) & 07)); append_char(buf, '0' + ((c >> 3) & 07)); append_char(buf, '0' + (c & 07)); } else { if (c == '\\' || c == '"') append_char(buf, '\\'); append_char(buf, c); } } /* Search for a name of a sequence of TTY bytes. If found, return the name and advance *INPUT. Return NULL otherwise. */ static const char *tty_find_named_key(unsigned char **input, size_t input_len) { /* NUL-terminated list of (sequence, NUL, name, NUL) entries. First match wins, even if a longer match were possible later */ static const unsigned char named_keys[] = #define E(SEQ, NAME) SEQ "\0" NAME "\0" #include "tty_named_keys.h" #undef E "\0"; unsigned char *src; const unsigned char *nk; src = *input; if (*src >= ' ' && (*src < 0x7F || *src >= 0xA0)) return NULL; /* Fast path */ nk = named_keys; do { const unsigned char *p; size_t nk_len; p = strchr(nk, '\0'); nk_len = p - nk; if (nk_len <= input_len && memcmp(src, nk, nk_len) == 0) { *input += nk_len; return p + 1; } nk = strchr(p + 1, '\0') + 1; } while (*nk != '\0'); return NULL; } static const char *print_tty_data(const char *raw_data) { struct string_buf buf; int in_printable; unsigned char *data, *data_pos, *data_end; if (!is_hex_string(raw_data)) return strdup(raw_data); data = au_unescape((char *)raw_data); if (data == NULL) return NULL; data_end = data + strlen(raw_data) / 2; buf.allocated = 10; buf.buf = malloc(buf.allocated); /* NULL handled in append_char() */ buf.pos = 0; in_printable = 0; data_pos = data; while (data_pos < data_end) { /* FIXME: Unicode */ const char *desc; desc = tty_find_named_key(&data_pos, data_end - data_pos); if (desc != NULL) { if (in_printable != 0) { append_char(&buf, '"'); in_printable = 0; } if (buf.pos != 0) append_char(&buf, ','); append_char(&buf, '<'); while (*desc != '\0') { append_char(&buf, *desc); desc++; } append_char(&buf, '>'); } else { if (in_printable == 0) { if (buf.pos != 0) append_char(&buf, ','); append_char(&buf, '"'); in_printable = 1; } tty_append_printable_char(&buf, *data_pos); data_pos++; } } if (in_printable != 0) append_char(&buf, '"'); append_char(&buf, '\0'); free(data); return buf.buf; } static const char *print_session(const char *val) { if (strcmp(val, "4294967295") == 0) return strdup("unset"); else return strdup(val); } #define SECCOMP_RET_ACTION 0x7fff0000U static const char *print_seccomp_code(const char *val) { unsigned long code; char *out; const char *s; errno = 0; code = strtoul(val, NULL, 16); if (errno) { if (asprintf(&out, "conversion error(%s)", val) < 0) out = NULL; return out; } s = seccomp_i2s(code & SECCOMP_RET_ACTION); if (s != NULL) return strdup(s); if (asprintf(&out, "unknown-seccomp-code(%s)", val) < 0) out = NULL; return out; } static const char *nlmcgrp[2]= { "audit-none", "audit-netlink-multicast" }; static const char *print_nlmcgrp(const char *val) { unsigned long nl; errno = 0; nl = strtoul(val, NULL, 16); if (errno) { char *out; if (asprintf(&out, "conversion error(%s)", val) < 0) out = NULL; return out; } switch (nl) { default: return strdup(nlmcgrp[0]); #ifdef AUDIT_NLGRP_MAX case AUDIT_NLGRP_READLOG: return strdup(nlmcgrp[1]); #endif } } int lookup_type(const char *name) { int i; if (type_s2i(name, &i) != 0) return i; return AUPARSE_TYPE_UNCLASSIFIED; } /* * This is the main entry point for the auparse library. Call chain is: * auparse_interpret_field -> nvlist_interp_cur_val -> do_interpret */ const char *do_interpret(rnode *r, auparse_esc_t escape_mode) { nvlist *nv = &r->nv; int type; idata id; nvnode *n; const char *out; id.machine = r->machine; id.syscall = r->syscall; id.a0 = r->a0; id.a1 = r->a1; id.cwd = r->cwd; id.name = nvlist_get_cur_name(nv); id.val = nvlist_get_cur_val(nv); type = auparse_interp_adjust_type(r->type, id.name, id.val); out = auparse_do_interpretation(type, &id, escape_mode); n = nvlist_get_cur(nv); n->interp_val = (char *)out; return out; } /* * rtype: the record type * name: the current field name * value: the current field value * Returns: field's internal type is returned */ int auparse_interp_adjust_type(int rtype, const char *name, const char *val) { int type; /* This set of statements overrides or corrects the detection. * In almost all cases its a double use of a field. */ if (rtype == AUDIT_EXECVE && *name == 'a' && strcmp(name, "argc") && !strstr(name, "_len")) type = AUPARSE_TYPE_ESCAPED; else if (rtype == AUDIT_AVC && strcmp(name, "saddr") == 0) type = AUPARSE_TYPE_UNCLASSIFIED; else if (rtype == AUDIT_USER_TTY && strcmp(name, "msg") == 0) type = AUPARSE_TYPE_ESCAPED; else if (rtype == AUDIT_NETFILTER_PKT && strcmp(name, "saddr") == 0) type = AUPARSE_TYPE_ADDR; else if (strcmp(name, "acct") == 0) { if (val[0] == '"') type = AUPARSE_TYPE_ESCAPED; else if (is_hex_string(val)) type = AUPARSE_TYPE_ESCAPED; else type = AUPARSE_TYPE_UNCLASSIFIED; } else if (rtype == AUDIT_PATH && *name =='f' && strcmp(name, "flags") == 0) type = AUPARSE_TYPE_FLAGS; else if (rtype == AUDIT_MQ_OPEN && strcmp(name, "mode") == 0) type = AUPARSE_TYPE_MODE_SHORT; else if (rtype == AUDIT_CRYPTO_KEY_USER && strcmp(name, "fp") == 0) type = AUPARSE_TYPE_UNCLASSIFIED; else if ((strcmp(name, "id") == 0) && (rtype == AUDIT_ADD_GROUP || rtype == AUDIT_GRP_MGMT || rtype == AUDIT_DEL_GROUP)) type = AUPARSE_TYPE_GID; else if (rtype == AUDIT_TRUSTED_APP) { /* * Could be anything. See if we know the type. If not, * take a guess based on contents of value. */ type = lookup_type(name); if (type == AUPARSE_TYPE_UNCLASSIFIED) { if (val[0] == '"') type = AUPARSE_TYPE_ESCAPED; else if (strcmp(name, "pid") == 0) type = AUPARSE_TYPE_UNCLASSIFIED; /* Check if we have string with only HEX symbols */ else if (is_hex_string(val)) type = AUPARSE_TYPE_ESCAPED; /* Otherwise it really is AUPARSE_TYPE_UNCLASSIFIED */ } } else if (rtype == AUDIT_KERN_MODULE && strcmp(name, "name") == 0) type = AUPARSE_TYPE_ESCAPED; else type = lookup_type(name); return type; } /* * This can be called by either interpret() or from ausearch-report or * auditctl-listing.c. Returns a malloc'ed buffer that the caller must free. */ char *auparse_do_interpretation(int type, const idata *id, auparse_esc_t escape_mode) { const char *out; // Check the interpretations list first if (interpretation_list_cnt()) { nvlist_first(&il); if (nvlist_find_name(&il, id->name)) { nvnode* node = &il.array[il.cur]; const char *val = node->interp_val; if (val) { // If we don't know what it is when auditd // recorded it, try it again incase the // libraries have been updated to support it. if (strncmp(val, "unknown-", 8 ) == 0) goto unknown; if (type == AUPARSE_TYPE_UID || type == AUPARSE_TYPE_GID) return print_escaped(val); else return strdup(val); } } } unknown: switch(type) { case AUPARSE_TYPE_UID: out = print_uid(id->val, 10); break; case AUPARSE_TYPE_GID: out = print_gid(id->val, 10); break; case AUPARSE_TYPE_SYSCALL: out = print_syscall(id); break; case AUPARSE_TYPE_ARCH: out = print_arch(id->val, id->machine); break; case AUPARSE_TYPE_EXIT: out = print_exit(id->val); break; case AUPARSE_TYPE_ESCAPED: case AUPARSE_TYPE_ESCAPED_FILE: out = print_escaped_ext(id); break; case AUPARSE_TYPE_ESCAPED_KEY: out = print_escaped(id->val); break; case AUPARSE_TYPE_PERM: out = print_perm(id->val); break; case AUPARSE_TYPE_MODE: out = print_mode(id->val,8); break; case AUPARSE_TYPE_MODE_SHORT: out = print_mode_short(id->val,8); break; case AUPARSE_TYPE_SOCKADDR: out = print_sockaddr(id->val); break; case AUPARSE_TYPE_FLAGS: out = print_flags(id->val); break; case AUPARSE_TYPE_PROMISC: out = print_promiscuous(id->val); break; case AUPARSE_TYPE_CAPABILITY: out = print_capabilities(id->val, 10); break; case AUPARSE_TYPE_SUCCESS: out = print_success(id->val); break; case AUPARSE_TYPE_A0: out = print_a0(id->val, id); break; case AUPARSE_TYPE_A1: out = print_a1(id->val, id); break; case AUPARSE_TYPE_A2: out = print_a2(id->val, id); break; case AUPARSE_TYPE_A3: out = print_a3(id->val, id); break; case AUPARSE_TYPE_SIGNAL: out = print_signals(id->val, 10); break; case AUPARSE_TYPE_LIST: out = print_list(id->val); break; case AUPARSE_TYPE_TTY_DATA: out = print_tty_data(id->val); break; case AUPARSE_TYPE_SESSION: out = print_session(id->val); break; case AUPARSE_TYPE_CAP_BITMAP: out = print_cap_bitmap(id->val); break; case AUPARSE_TYPE_NFPROTO: out = print_nfproto(id->val); break; case AUPARSE_TYPE_ICMPTYPE: out = print_icmptype(id->val); break; case AUPARSE_TYPE_PROTOCOL: out = print_protocol(id->val); break; case AUPARSE_TYPE_ADDR: out = print_addr(id->val); break; case AUPARSE_TYPE_PERSONALITY: out = print_personality(id->val); break; case AUPARSE_TYPE_SECCOMP: out = print_seccomp_code(id->val); break; case AUPARSE_TYPE_OFLAG: // AUDIT_OPENAT2,MQ_OPEN out = print_open_flags(id->val, 0); break; case AUPARSE_TYPE_MMAP: out = print_mmap(id->val); break; case AUPARSE_TYPE_PROCTITLE: out = print_proctitle(id->val); break; case AUPARSE_TYPE_HOOK: out = print_hook(id->val); break; case AUPARSE_TYPE_NETACTION: out = print_netaction(id->val); break; case AUPARSE_TYPE_MACPROTO: out = print_macproto(id->val); break; case AUPARSE_TYPE_IOCTL_REQ: out = print_ioctl_req(id->val); break; case AUPARSE_TYPE_FANOTIFY: out = print_fanotify(id->val); break; case AUPARSE_TYPE_NLMCGRP: out = print_nlmcgrp(id->val); break; case AUPARSE_TYPE_RESOLVE: out = print_openat2_resolve(id->val); break; case AUPARSE_TYPE_TRUST: out = print_trust(id->val); break; case AUPARSE_TYPE_FAN_TYPE: out = print_fan_type(id->val); break; case AUPARSE_TYPE_FAN_INFO: out = print_fan_info(id->val); break; case AUPARSE_TYPE_ERRNO: out = print_errno(id->val); break; case AUPARSE_TYPE_MAC_LABEL: case AUPARSE_TYPE_UNCLASSIFIED: default: out = strdup(id->val); break; } if (escape_mode != AUPARSE_ESC_RAW && out) { char *str = NULL; unsigned int len = strlen(out); if (type == AUPARSE_TYPE_ESCAPED_KEY) { // The audit key separator causes a false // positive in deciding to escape. str = strchr(out, AUDIT_KEY_SEPARATOR); } if (str == NULL) { // This is the normal path unsigned int cnt = need_escaping(out, len, escape_mode); if (cnt) { char *dest = malloc(len + 1 + (3*cnt)); if (dest) escape(out, dest, len, escape_mode); free((void *)out); out = dest; } } else { // We have multiple keys. Need to look at each one. unsigned int cnt = 0; char *ptr = (char *)out; while (*ptr) { unsigned int klen = str - ptr; char tmp = *str; *str = 0; cnt += need_escaping(ptr, klen, escape_mode); *str = tmp; ptr = str; // If we are not at the end... if (tmp) { ptr++; str = strchr(ptr, AUDIT_KEY_SEPARATOR); // If we don't have anymore, just // point to the end if (str == NULL) str = strchr(ptr, 0); } } if (cnt) { // I expect this code to never get used. // Its here just in the off chance someone // actually put a control character in a key. char *dest = malloc(len + 1 + (3*cnt)); if (dest) { // Because need_escaping was called // terminated, we need to do the same // incase there's a Ctl-A in the key. // This is likely fuzzer induced. char tmp; str = strchr(out, AUDIT_KEY_SEPARATOR); if (str) { tmp = *str; *str = 0; key_escape(out, dest, escape_mode); *str = tmp; } else key_escape(out, dest, escape_mode); } free((void *)out); out = dest; } } } return (char *)out; } audit-4.0.2/auparse/mounttab.h0000644001034500103450000000346314655201403011754 /* mounttab.h -- * Copyright 2012-13,2018,2020 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb * Location: include/uapi/linux/mount.h * NOTE: When updating this table, update interpret.c:print_mount() */ _S(MS_RDONLY, "MS_RDONLY") _S(MS_NOSUID, "MS_NOSUID") _S(MS_NODEV, "MS_NODEV" ) _S(MS_NOEXEC, "MS_NOEXEC") _S(MS_SYNCHRONOUS, "MS_SYNCHRONOUS") _S(MS_REMOUNT, "MS_REMOUNT") _S(MS_MANDLOCK, "MS_MANDLOCK") _S(MS_DIRSYNC, "MS_DIRSYNC") _S(MS_NOATIME, "MS_NOATIME") _S(MS_NODIRATIME, "MS_NODIRATIME") _S(MS_BIND, "MS_BIND") _S(MS_MOVE, "MS_MOVE") _S(MS_REC, "MS_REC") _S(MS_SILENT, "MS_SILENT") _S(MS_POSIXACL, "MS_POSIXACL") _S(MS_UNBINDABLE, "MS_UNBINDABLE") _S(MS_PRIVATE, "MS_PRIVATE") _S(MS_SLAVE, "MS_SLAVE") _S(MS_SHARED, "MS_SHARED") _S(MS_RELATIME, "MS_RELATIME") _S(MS_KERNMOUNT, "MS_KERNMOUNT") _S(MS_I_VERSION, "MS_I_VERSION") _S((1<<24), "MS_STRICTATIME") _S((1<<25), "MS_LAZYTIME") _S((1<<26), "MS_SUBMOUNT") _S((1<<27), "MS_SNAP_STABLE") _S((1<<28), "MS_NOSEC") _S((1<<29), "MS_BORN") _S(MS_ACTIVE, "MS_ACTIVE") _S(MS_NOUSER, "MS_NOUSER") audit-4.0.2/auparse/socktab.h0000644001034500103450000000272314655201403011547 /* socktab.h -- * Copyright 2007,2011-13 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb * Location: include/uapi/linux/net.h */ _S(SYS_SOCKET, "socket" ) _S(SYS_BIND, "bind" ) _S(SYS_CONNECT, "connect" ) _S(SYS_LISTEN, "listen" ) _S(SYS_ACCEPT, "accept" ) _S(SYS_GETSOCKNAME, "getsockname" ) _S(SYS_GETPEERNAME, "getpeername" ) _S(SYS_SOCKETPAIR, "socketpair" ) _S(SYS_SEND, "send" ) _S(SYS_RECV, "recv" ) _S(SYS_SENDTO, "sendto" ) _S(SYS_RECVFROM, "recvfrom" ) _S(SYS_SHUTDOWN, "shutdown" ) _S(SYS_SETSOCKOPT, "setsockopt" ) _S(SYS_GETSOCKOPT, "getsockopt" ) _S(SYS_SENDMSG, "sendmsg" ) _S(SYS_RECVMSG, "recvmsg" ) _S(SYS_ACCEPT4, "accept4" ) _S(19, "recvmmsg" ) _S(20, "sendmmsg" ) audit-4.0.2/auparse/prottab.h0000644001034500103450000000206114655201403011567 /* prottab.h -- * Copyright 2012-13 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA * * Authors: * Steve Grubb * Location: include/uapi/asm-generic/mman-common.h */ _S(1, "PROT_READ" ) _S(2, "PROT_WRITE" ) _S(4, "PROT_EXEC" ) _S(8, "PROT_SEM" ) _S(0x01000000, "PROT_GROWSDOWN") _S(0x02000000, "PROT_GROWSUP") audit-4.0.2/auparse/normalize-llist.h0000644001034500103450000000376314655201403013253 /* * normalize-llist.h - Header file for normalize-llist.c * Copyright (c) 2016-17 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb */ #ifndef NORMALIZE_LLIST_HEADER #define NORMALIZE_LLIST_HEADER #include "config.h" #include #include "private.h" /* This is the node of the linked list. Number & item are the only elements * at this time. Any data elements that are per item goes here. */ typedef struct _data_node { uint32_t num; // The number void *data; // Extra spot for data struct _data_node *next; // Next string node pointer } data_node; /* This is the linked list head. Only data elements that are 1 per * event goes here. */ typedef struct { data_node *head; // List head data_node *cur; // Pointer to current node void (*cleanup)(void *); // Function to call when releasing memory unsigned int cnt; // How many items in this list } cllist; static inline void cllist_first(cllist *l) { l->cur = l->head; } static inline data_node *cllist_get_cur(const cllist *l) { return l->cur; } AUDIT_HIDDEN_START void cllist_create(cllist *l, void (*cleanup)(void *)); void cllist_clear(cllist* l); data_node *cllist_next(cllist *l); int cllist_append(cllist *l, uint32_t num, void *data); AUDIT_HIDDEN_END #endif audit-4.0.2/auparse/icmptypetab.h0000644001034500103450000000236414655201403012443 /* icmptypetab.h -- * Copyright 2011-13 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb * Location: include/uapi/linux/icmp.h */ _S(0, "echo-reply" ) _S(3, "destination-unreachable" ) _S(4, "source-quench" ) _S(5, "redirect" ) _S(8, "echo" ) _S(11, "time-exceeded" ) _S(12, "parameter-problem" ) _S(13, "timestamp-request" ) _S(14, "timestamp-reply" ) _S(15, "info-request" ) _S(16, "info-reply" ) _S(17, "address-mask-request" ) _S(18, "address-mask-reply" ) audit-4.0.2/auparse/nvlist.c0000644001034500103450000001037214655201403011432 /* * nvlist.c - Minimal linked list library for name-value pairs * Copyright (c) 2006-07,2016,2021 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb */ #include "config.h" #include #include #include "nvlist.h" #include "interpret.h" #include "auparse-idata.h" static inline void alloc_array(nvlist *l) { l->array = calloc(NFIELDS, sizeof(nvnode)); l->size = NFIELDS; } void nvlist_create(nvlist *l) { if (l) { alloc_array(l); l->cur = 0; l->cnt = 0; l->record = NULL; l->end = NULL; } } nvnode *nvlist_next(nvlist *l) { // Since cur will be incremented, check for 1 less that total if (l->cnt && l->cur < (l->cnt - 1)) { l->cur++; return &l->array[l->cur]; } return NULL; } // 0 on success and 1 on error int nvlist_append(nvlist *l, const nvnode *node) { if (node->name == NULL) return 1; if (l->array == NULL) alloc_array(l); if (l->cnt == l->size) { nvnode* tmp; tmp = realloc(l->array, l->size * sizeof(nvnode) * 2); if (tmp != NULL) { l->array = tmp; memset(l->array + l->size, 0, sizeof(nvnode) * l->size); l->size = l->size * 2; } else return 1; } nvnode *newnode = &l->array[l->cnt]; newnode->name = node->name; newnode->val = node->val; newnode->interp_val = NULL; newnode->item = l->cnt; // make newnode current l->cur = l->cnt; l->cnt++; return 0; } /* * Its less code to make a fixup than a new append. */ void nvlist_interp_fixup(const nvlist *l) { nvnode* node = &l->array[l->cur]; node->interp_val = node->val; node->val = NULL; } nvnode *nvlist_goto_rec(nvlist *l, unsigned int i) { if (i < l->cnt) { l->cur = i; return &l->array[l->cur]; } return NULL; } /* * This function will start at current index and scan for a name */ int nvlist_find_name(nvlist *l, const char *name) { unsigned int i = l->cur; register nvnode *node; if (l->cnt == 0) return 0; do { node = &l->array[i]; if (node->name && strcmp(node->name, name) == 0) { l->cur = i; return 1; } i++; } while (i < l->cnt); return 0; } extern int interp_adjust_type(int rtype, const char *name, const char *val); int nvlist_get_cur_type(rnode *r) { nvlist *l = &r->nv; nvnode *node = &l->array[l->cur]; return auparse_interp_adjust_type(r->type, node->name, node->val); } const char *nvlist_interp_cur_val(rnode *r, auparse_esc_t escape_mode) { nvlist *l = &r->nv; if (l->cnt == 0) return NULL; nvnode *node = &l->array[l->cur]; if (node->interp_val) return node->interp_val; return do_interpret(r, escape_mode); } // This function determines if a chunk of memory is part of the parsed up // record. If it is, do not free it since it gets free'd at the very end. // NOTE: This function causes invalid-pointer-pair errors with ASAN static inline int not_in_rec_buf(nvlist *l, const char *ptr) { if (ptr >= l->record && ptr < l->end) return 0; return 1; } // free_interp does not apply to thing coming from interpretation_list void nvlist_clear(nvlist *l, int free_interp) { unsigned int i = 0; register nvnode *current; while (i < l->cnt) { current = &l->array[i]; if (free_interp) { free(current->interp_val); // A couple items are not in parsed up list. // These all come from the aup_list_append path. if (not_in_rec_buf(l, current->name)) { // seperms & key values are strdup'ed if (not_in_rec_buf(l, current->val)) free(current->val); free(current->name); } } i++; } free((void *)l->record); free(l->array); l->array = NULL; l->size = 0; l->record = NULL; l->end = NULL; l->cur = 0; l->cnt = 0; } audit-4.0.2/auparse/ip6optnametab.h0000644001034500103450000000562414655201403012675 /* ip6optnametab.h -- * Copyright 2013-16,2018,2020 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb * Location: include/uapi/linux/in6.h (all ^IPV6_ && ^MCAST_) * include/uapi/linux/netfilter_ipv6/ip6_tables.h (all ^IP6T_) * include/uapi/linux/mroute6.h (not used?) */ _S(1, "IPV6_ADDRFORM") _S(2, "IPV6_2292PKTINFO") _S(3, "IPV6_2292HOPOPTS") _S(4, "IPV6_2292DSTOPTS") _S(5, "IPV6_2292RTHDR") _S(6, "IPV6_2292PKTOPTIONS") _S(7, "IPV6_CHECKSUM") _S(8, "IPV6_2292HOPLIMIT") _S(9, "IPV6_NEXTHOP") _S(10, "IPV6_AUTHHDR") _S(11, "IPV6_FLOWINFO") _S(16, "IPV6_UNICAST_HOPS") _S(17, "IPV6_MULTICAST_IF") _S(18, "IPV6_MULTICAST_HOPS") _S(19, "IPV6_MULTICAST_LOOP") _S(20, "IPV6_ADD_MEMBERSHIP") _S(21, "IPV6_DROP_MEMBERSHIP") _S(22, "IPV6_ROUTER_ALERT") _S(23, "IPV6_MTU_DISCOVER") _S(24, "IPV6_MTU") _S(25, "IPV6_RECVERR") _S(26, "IPV6_V6ONLY") _S(27, "IPV6_JOIN_ANYCAST") _S(28, "IPV6_LEAVE_ANYCAST") _S(29, "IPV6_MULTICAST_ALL") _S(30, "IPV6_ROUTER_ALERT_ISOLATE") _S(31, "IPV6_RECVERR_RFC4884") _S(32, "IPV6_FLOWLABEL_MGR") _S(33, "IPV6_FLOWINFO_SEND") _S(34, "IPV6_IPSEC_POLICY") _S(35, "IPV6_XFRM_POLICY") _S(36, "IPV6_HDRINCL") _S(42, "MCAST_JOIN_GROUP") _S(43, "MCAST_BLOCK_SOURCE") _S(44, "MCAST_UNBLOCK_SOURCE") _S(45, "MCAST_LEAVE_GROUP") _S(46, "MCAST_JOIN_SOURCE_GROUP") _S(47, "MCAST_LEAVE_SOURCE_GROUP") _S(48, "MCAST_MSFILTER") _S(49, "IPV6_RECVPKTINFO") _S(50, "IPV6_PKTINFO") _S(51, "IPV6_RECVHOPLIMIT") _S(52, "IPV6_HOPLIMIT") _S(53, "IPV6_RECVHOPOPTS") _S(54, "IPV6_HOPOPTS") _S(55, "IPV6_RTHDRDSTOPTS") _S(56, "IPV6_RECVRTHDR") _S(57, "IPV6_RTHDR") _S(58, "IPV6_RECVDSTOPTS") _S(59, "IPV6_DSTOPTS") _S(60, "IPV6_RECVPATHMTU") _S(61, "IPV6_PATHMTU") _S(62, "IPV6_DONTFRAG") _S(63, "IPV6_USE_MIN_MTU") _S(64, "IP6T_SO_SET_REPLACE") _S(65, "IP6T_SO_SET_ADD_COUNTERS") _S(66, "IPV6_RECVTCLASS") _S(67, "IPV6_TCLASS") _S(68, "IP6T_SO_GET_REVISION_MATCH") _S(69, "IP6T_SO_GET_REVISION_TARGET") _S(70, "IPV6_AUTOFLOWLABEL") _S(72, "IPV6_ADDR_PREFERENCES") _S(73, "IPV6_MINHOPCOUNT") _S(74, "IPV6_ORIGDSTADDR") _S(75, "IPV6_TRANSPARENT") _S(76, "IPV6_UNICAST_IF") _S(77, "IPV6_RECVFRAGSIZE") _S(78, "IPV6_FREEBIND") _S(80, "IP6T_SO_ORIGINAL_DST") audit-4.0.2/auparse/rnode.h0000644001034500103450000000475014655201403011232 /* rnode.h -- * Copyright 2007,2016-17,21 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb */ #ifndef RNODE_HEADER #define RNODE_HEADER #define NFIELDS 36 /* This is the data node of the fields list. Any data elements that are * per field goes here. */ typedef struct _nvnode{ char *name; // The name string char *val; // The value field char *interp_val; // The value field interpreted unsigned int item; // Which item of the same event } nvnode; /* This is the field list head. */ typedef struct { nvnode *array; // array of fields unsigned int cur; // Index to current node unsigned int cnt; // How many items in this list unsigned int size; // Number of allocated items char *record; // Holds the parsed up record char *end; // End of the parsed up record } nvlist; /* This is the node of the linked list. Only data elements that are per * record goes here. */ typedef struct _rnode{ char *record; // The whole unparsed record char *interp; // The interpretations that go with record const char *cwd; // This is pass thru for ellist int type; // record type (KERNEL, USER, LOGIN, etc) int machine; // The machine type for the event int syscall; // The syscall for the event unsigned long long a0; // arg 0 to the syscall unsigned long long a1; // arg 1 to the syscall nvlist nv; // name-value linked list of parsed elements unsigned int item; // Which item of the same event int list_idx; // The index into the source list, points to where record was found unsigned int line_number; // The line number where record was found struct _rnode* next; // Next record node pointer } rnode; #endif audit-4.0.2/auparse/ioctlreqtab.h0000644001034500103450000000367014655201403012434 /* ioctlreqtab.h -- * Copyright 2014 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb * * This list is not comprehensive. Its just some cherry picked ioctls. * include/uapi/linux/kd.h * include/uapi/linux/cdrom.h * include/uapi/asm-generic/ioctls.h * include/uapi/drm/drm.h */ _S(0x4B3A, "KDSETMODE" ) _S(0x4B3B, "KDGETMODE" ) _S(0x5309, "CDROMEJECT" ) _S(0x530F, "CDROMEJECT_SW" ) _S(0x5311, "CDROM_GET_UPC" ) _S(0x5316, "CDROMSEEK" ) _S(0x5401, "TCGETS" ) _S(0x5402, "TCSETS" ) _S(0x5403, "TCSETSW" ) _S(0x5404, "TCSETSF" ) _S(0x5409, "TCSBRK" ) _S(0x540B, "TCFLSH" ) _S(0x540E, "TIOCSCTTY" ) _S(0x540F, "TIOCGPGRP" ) _S(0x5410, "TIOCSPGRP" ) _S(0x5413, "TIOCGWINSZ" ) _S(0x5414, "TIOCSWINSZ" ) _S(0x541B, "TIOCINQ" ) _S(0x5421, "FIONBIO" ) _S(0x5422, "TIOCNOTTY" ) _S(0x8901, "FIOSETOWN" ) _S(0x8903, "FIOGETOWN" ) _S(0x8910, "SIOCGIFNAME" ) _S(0x8927, "SIOCGIFHWADDR" ) _S(0x8933, "SIOCGIFINDEX" ) _S(0x89a2, "SIOCBRADDIF" ) _S(0x40045431, "TIOCSPTLCK" ) // Need a better fix for these _S(0x80045430, "TIOCGPTN" ) _S(0x80045431, "TIOCSPTLCK" ) _S(0xC01C64A3, "DRM_IOCTL_MODE_CURSOR" ) _S(0xC01864B0, "DRM_IOCTL_MODE_PAGE_FLIP" ) _S(0xC01864B1, "DRM_IOCTL_MODE_DIRTYFB" ) audit-4.0.2/auparse/ipccmdtab.h0000644001034500103450000000174114655201403012046 /* ipccmdtab.h -- * Copyright 2013 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb * Location: include/uapi/linux/ipc.h */ _S(00001000, "IPC_CREAT" ) _S(00002000, "IPC_EXCL" ) _S(00004000, "IPC_NOWAIT" ) audit-4.0.2/auparse/openat2-resolvetab.h0000644001034500103450000000212614655201403013632 /* openat2-resolvetab.h -- * Copyright 2021 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Richard Guy Briggs * Location: include/uapi/linux/openat2.h */ _S(0x01, "RESOLVE_NO_XDEV" ) _S(0x02, "RESOLVE_NO_MAGICLINKS" ) _S(0x04, "RESOLVE_NO_SYMLINKS" ) _S(0x08, "RESOLVE_BENEATH" ) _S(0x10, "RESOLVE_IN_ROOT" ) _S(0x20, "RESOLVE_CACHED" ) audit-4.0.2/auparse/lru.h0000644001034500103450000000425514655201403010725 /* * lru.h - Header file for lru.c * Copyright (c) 2016.2017 Red Hat Inc., Durham, North Carolina. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb */ #ifndef LRU_HEADER #define LRU_HEADER #include "dso.h" /* Make these hidden to prevent conflicts */ AUDIT_HIDDEN_START // Queue is implemented using double linked list typedef struct QNode { struct QNode *prev; struct QNode *next; unsigned long uses; unsigned int id; void *str; // the data in the cache } QNode; // Collection of pointers to Queue Nodes typedef struct Hash { unsigned int size; // how many entries QNode **array; // an array of queue nodes } Hash; // FIFO of Queue Nodes typedef struct Queue { unsigned int count; // Number of filled slots unsigned int total; // total number of slots unsigned long hits; // Number of times object was in cache unsigned long misses;// number of times object was not in cache unsigned long evictions;// number of times cached object was not usable QNode *front; QNode *end; Hash *hash; const char *name; // Used for reporting void (*cleanup)(void *); // Function to call when releasing memory } Queue; Queue *init_lru(unsigned int qsize, void (*cleanup)(void *), const char *name); void destroy_lru(Queue *queue); void lru_evict(Queue *queue, unsigned int key); QNode *check_lru_cache(Queue *q, unsigned int key); unsigned int compute_subject_key(const Queue *queue, unsigned int uid); AUDIT_HIDDEN_END #endif audit-4.0.2/auparse/expression-design.txt0000644001034500103450000001175014655201403014157 This is a description of the expression syntax. LEXICAL STRUCTURE White space (ASCII space, tab and new-line characters) between tokens is ignored. The following tokens are recognized: Punctuation ( ) \ Logical operators ! && || Comparison operators < <= == > >= !== i= i!= r= r!= Unquoted strings Any non-empty sequence of ASCII letters, digits, and the _ symbol. Quoted strings A sequence of characters surrounded by the " quotes. The \ character starts an escape sequence. The only defined escape sequences are \\ and \". The semantics of other escape sequences is undefined. Anywhere an unquoted string is valid, a quoted string is valid as well, and vice versa. In particular, field names may be specified using quoted strings, and field values may be specified using unquoted strings. EXPRESSION SYNTAX The primary expression has the following form: field comparison-operator value field is either a string, which specifies the first field with that name within the current audit record, or the \ escape character fol- lowed by a string, which specifies a virtual field with the specified name (virtual fields are defined in a later section). field is a string. operator specifies the comparison to perform r= r!= Get the "raw" string of field, and compare it to value. For fields in audit records, the "raw" string is the exact string stored in the audit record (with all escaping and unprintable character encoding left alone); applications can read the "raw" string using auparse get field str(3). Each virtual field may define a "raw" string. If field is not present or does not define a "raw" string, the result of the comparison is false (regardless of the operator). i= i!= Get the "interpreted" string of field, and compare it to value. For fields in audit records, the "interpreted" string is an "user-readable" interpretation of the field value; applications can read the "interpreted" string using auparse inter- pret field(3). Each virtual field may define an "interpreted" string. If field is not present or does not define an "inter- preted" string, the result of the comparison is false (regard- less of the operator). < <= == > >= !== Evaluate the "value" of field, and compare it to value. A "value" may be defined for any field or virtual field, but no "value" is currently defined for any audit record field. The rules of parsing value for comparing it with the "value" of field are specific for each field. If field is not present, the result of the comparison is false (regardless of the operator). If field does not define a "value", an error is reported when parsing the expression. If E1 and E2 are valid expressions, then ! E1, E1 && E2, and E1 || E2 are valid expressions as well, with the usual C semantics and evalua- tion priorities. Note that ! field op value is interpreted as !(field op value), not as (!field) op value. VIRTUAL FIELDS The following virtual fields are defined: \timestamp The value is the timestamp of the current event. value must have the ts:seconds.milli format, where seconds and milli are decimal numbers specifying the seconds and milliseconds part of the timestamp, respectively. \record_type The value is the type of the current record. value is either the record type name, or a decimal number specifying the type. SEMANTICS The expression as a whole applies to a single record. The expression is true for a specified event if it is true for any record associated with the event. EXAMPLES As a demonstration of the semantics of handling missing fields, the following expression is true if field is present: (field r= "") || (field r!= "") and the same expression surrounded by !( and ) is true if field is not present. FUTURE DIRECTIONS New escape sequences for quoted strings may be defined. For currently defined virtual fields that do not define a "raw" or "interpreted" string, the definition may be added. Therefore, donât rely on the fact that comparing the "raw" or "interpreted" string of the field with any value is false. New formats of value constants for the \timestamp virtual field may be added. audit-4.0.2/auparse/tty_named_keys.h0000644001034500103450000002552614655201403013146 /* tty_named_keys.h -- * Copyright 2008 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Miloslav Trmač */ /* Longest sequences should go first, but these are comparatively common. */ E("\x01", "^A") E("\x02", "^B") E("\x03", "^C") // Or "cancel" (3 terms) E("\x04", "^D") E("\x05", "^E") E("\x06", "^F") E("\x07", "^G") E("\x08", "backspace") E("\t", "tab") E("\n", "nl") E("\x0B", "^K") E("\x0C", "^L") E("\r", "ret") E("\x0E", "^N") E("\x0F", "^O") E("\x10", "^P") E("\x11", "^Q") E("\x12", "^R") E("\x13", "^S") E("\x14", "^T") E("\x15", "^U") E("\x16", "^V") E("\x17", "^W") E("\x18", "^X") E("\x19", "^Y") E("\x1A", "^Z") // Or "suspend" (9 terms) /* \x1B handled only after all other escape sequences */ E("\x7F", "backspace") // 59 terms; alternative: "delete" (11 terms) // Based on terminal descriptions in ncrses-base-5.6-20.20080927.fc10. // Conflicts are marked by comments. Ordering: longest sequences first, then // lexicographically. E("\x1B[11;2~", "F13") E("\x1B[11;3~", "F49") E("\x1B[11;4~", "F61") E("\x1B[11;5~", "F25") E("\x1B[11;6~", "F37") E("\x1B[12;2~", "F14") E("\x1B[12;3~", "F50") E("\x1B[12;4~", "F62") E("\x1B[12;5~", "F26") E("\x1B[12;6~", "F38") E("\x1B[13;2~", "F15") E("\x1B[13;3~", "F51") E("\x1B[13;4~", "F63") E("\x1B[13;5~", "F27") E("\x1B[13;6~", "F39") E("\x1B[14;2~", "F16") E("\x1B[14;3~", "F52") E("\x1B[14;5~", "F28") E("\x1B[14;6~", "F40") E("\x1B[15;2~", "F17") E("\x1B[15;3~", "F53") E("\x1B[15;5~", "F29") E("\x1B[15;6~", "F41") E("\x1B[17;2~", "F18") E("\x1B[17;3~", "F54") E("\x1B[17;5~", "F30") E("\x1B[17;6~", "F42") E("\x1B[18;2~", "F19") E("\x1B[18;3~", "F55") E("\x1B[18;5~", "F31") E("\x1B[18;6~", "F43") E("\x1B[19;2~", "F20") E("\x1B[19;3~", "F56") E("\x1B[19;5~", "F32") E("\x1B[19;6~", "F44") E("\x1B[20;2~", "F21") E("\x1B[20;3~", "F57") E("\x1B[20;5~", "F33") E("\x1B[20;6~", "F45") E("\x1B[21;2~", "F22") E("\x1B[21;3~", "F58") E("\x1B[21;5~", "F34") E("\x1B[21;6~", "F46") E("\x1B[23;2~", "F23") E("\x1B[23;3~", "F59") E("\x1B[23;5~", "F35") E("\x1B[23;6~", "F47") E("\x1B[24;2~", "F24") E("\x1B[24;3~", "F60") E("\x1B[24;5~", "F36") E("\x1B[24;6~", "F48") E("\x1B""O1;2A", "scroll-backward") E("\x1B""O1;2B", "scroll-forward") E("\x1B""O1;2C", "shift-right") E("\x1B""O1;2D", "shift-left") E("\x1B[192z", "F11") E("\x1B[193z", "resume") // 3 terms; alternative "F12" (1 term) E("\x1B[194z", "options") // 3 terms; alternative "F13" (1 term) E("\x1B[195z", "undo") // 4 terms; alternative "F14" (1 term) E("\x1B[196z", "help") // 1 term; alternative "F15" (1 term) E("\x1B[197z", "copy") E("\x1B[198z", "F17") E("\x1B[199z", "F18") E("\x1B[1;2A", "scroll-backward") E("\x1B[1;2B", "scroll-forward") E("\x1B[1;2C", "shift-right") E("\x1B[1;2D", "shift-left") E("\x1B[1;2F", "shift-end") E("\x1B[1;2H", "shift-home") E("\x1B[200z", "find") // 1 term; alternative "F19" (1 term) E("\x1B[201z", "F20") E("\x1B[208z", "F31") E("\x1B[209z", "F32") E("\x1B[210z", "F33") E("\x1B[211z", "F34") E("\x1B[212z", "F35") E("\x1B[213z", "F36") E("\x1B[214z", "home") E("\x1B[215z", "F38") E("\x1B[216z", "page-up") E("\x1B[217z", "F40") E("\x1B[218z", "B2") E("\x1B[219z", "F42") E("\x1B[220z", "end") E("\x1B[221z", "F44") E("\x1B[222z", "page-down") // 4 terms; alternative "F45" (1 term) E("\x1B[224z", "F1") E("\x1B[225z", "F2") E("\x1B[226z", "F3") E("\x1B[227z", "F4") E("\x1B[228z", "F5") E("\x1B[229z", "F6") E("\x1B[230z", "F7") E("\x1B[231z", "F8") E("\x1B[232z", "F9") E("\x1B[233z", "F10") E("\x1B[234z", "F11") // 3 terms; alternative "F46" (1 term) E("\x1B[235z", "F12") // 3 terms; alternative "F47" (1 term) E("\x1B[2;2~", "shift-insert") E("\x1B[2;5~", "shift-insert") E("\x1B[3;2~", "shift-del") E("\x1B[3;5~", "shift-del") E("\x1B[5;2~", "shift-previous") E("\x1B[5;5~", "shift-previous") E("\x1B[6;2~", "shift-next") E("\x1B[6;5~", "shift-next") E("\x1B[11^", "F23") E("\x1B[11~", "F1") E("\x1B[12^", "F24") E("\x1B[12~", "F2") E("\x1B[13^", "F25") E("\x1B[13~", "F3") E("\x1B[14^", "F26") E("\x1B[14~", "F4") E("\x1B[15^", "F27") E("\x1B[15~", "F5") E("\x1B[17^", "F28") E("\x1B[17~", "F6") E("\x1B[18^", "F29") E("\x1B[18~", "F7") E("\x1B[19^", "F30") E("\x1B[19~", "F8") E("\x1B[20^", "F31") E("\x1B[20~", "F9") E("\x1B[21^", "F32") E("\x1B[21~", "F10") // 85 terms; alternative "F0" (9 terms) E("\x1B[23$", "F21") E("\x1B[23@", "F43") E("\x1B[23^", "F33") E("\x1B[23~", "F11") E("\x1B[24$", "F22") E("\x1B[24@", "F44") E("\x1B[24^", "F34") E("\x1B[24~", "F12") E("\x1B[25^", "F35") E("\x1B[25~", "F13") E("\x1B[26^", "F36") E("\x1B[26~", "F14") E("\x1B[28^", "F37") E("\x1B[28~", "F15") // 42 terms; alternative "help" (8 terms) E("\x1B[29^", "F38") E("\x1B[29~", "F16") // 42 terms; alternative "redo" (4 terms) E("\x1B[30~", "insert-line") E("\x1B[31^", "F39") E("\x1B[31~", "F17") // 46 terms; alternative "delete-line" (1 term) E("\x1B[32^", "F40") E("\x1B[32~", "F18") E("\x1B[33^", "F41") E("\x1B[33~", "F19") E("\x1B[34^", "F42") E("\x1B[34~", "F20") E("\x1B""O2A", "scroll-backward") E("\x1B""O2B", "scroll-forward") E("\x1B""O2C", "shift-right") E("\x1B""O2D", "shift-left") E("\x1B""O2P", "F13") E("\x1B""O2Q", "F14") E("\x1B""O2R", "F15") E("\x1B""O2S", "F16") E("\x1B""O3P", "F49") E("\x1B""O3Q", "F50") E("\x1B""O3R", "F51") E("\x1B""O3S", "F52") E("\x1B""O4P", "F61") E("\x1B""O4Q", "F62") E("\x1B""O4R", "F63") E("\x1B""O5C", "shift-right") E("\x1B""O5D", "shift-left") E("\x1B""O5F", "shift-end") E("\x1B""O5H", "shift-home") E("\x1B""O5P", "F25") E("\x1B""O5Q", "F26") E("\x1B""O5R", "F27") E("\x1B""O5S", "F28") E("\x1B""O6P", "F37") E("\x1B""O6Q", "F38") E("\x1B""O6R", "F39") E("\x1B""O6S", "F40") E("\x1B[1~", "home") // 30 terms; alternative "find" (42 terms, but "home" is used in Linux) E("\x1B[2$", "shift-insert") E("\x1B[2z", "insert") E("\x1B[2~", "insert") E("\x1B[3$", "shift-del") E("\x1B[3z", "delete") E("\x1B[3~", "delete") E("\x1B[4~", "end") // 30 terms; alternative "select" (42 terms, but "end" is used in Linux) E("\x1B[5$", "shift-previous") E("\x1B[5~", "page-up") // 86 terms; alternative "A3" (4 terms) E("\x1B[6$", "shift-next") E("\x1B[6~", "page-down") // 86 terms; alternative "C3" (4 terms) E("\x1B[7$", "shift-home") E("\x1B[7~", "home") // 17 terms; alternative "A1" (4 terms) E("\x1B[8$", "shift-end") E("\x1B[8^", "delete-eol") E("\x1B[8~", "end") // 17 terms; alternatives "C1" (4 terms), "delete-eol" (1 term) E("\x1B[>M", "mouse") E("\x1B[[A", "F1") E("\x1B[[B", "F2") E("\x1B[[C", "F3") E("\x1B[[D", "F4") E("\x1B[[E", "F5") E("\x9B""11~", "F1") E("\x9B""12~", "F2") E("\x9B""13~", "F3") E("\x9B""14~", "F4") E("\x9B""15~", "F5") E("\x9B""17~", "F6") E("\x9B""18~", "F7") E("\x9B""19~", "F8") E("\x9B""20~", "F9") E("\x9B""21~", "F10") E("\x9B""23~", "F11") E("\x9B""24~", "F12") E("\x9B""25~", "F13") E("\x9B""26~", "F14") E("\x9B""28~", "F15") E("\x9B""29~", "F16") E("\x9B""31~", "F17") E("\x9B""32~", "F18") E("\x9B""33~", "F19") E("\x9B""34~", "F20") E("\x1B""2$", "shift-insert") E("\x1B""OA", "up") E("\x1B""OB", "down") E("\x1B""OC", "right") E("\x1B""OD", "left") E("\x1B""OE", "B2") // 16 terms; alternative "begin" (5 terms) E("\x1B""OF", "end") E("\x1B""OH", "home") E("\x1B""OM", "send") E("\x1B""OP", "F1") E("\x1B""OQ", "F2") E("\x1B""OR", "F3") E("\x1B""OS", "F4") E("\x1B""OT", "F5") E("\x1B""OU", "F6") E("\x1B""OV", "F7") E("\x1B""OW", "F8") E("\x1B""OX", "F9") E("\x1B""OY", "F10") E("\x1B""OZ", "F11") E("\x1B""O[", "F12") E("\x1B""Ol", "F8") E("\x1B""On", "C3") E("\x1B""Op", "C1") E("\x1B""Oq", "C1") // 17 terms; alternatives "A1" (5 terms), "F0" (1 term) E("\x1B""Or", "B2") E("\x1B""Os", "C3") // 17 terms; alternative "A3" (7 terms) E("\x1B""Ot", "F5") E("\x1B""Ou", "B2") // 21 terms; alternative "F6" (4 terms), "begin" (4 terms) E("\x1B""Ov", "F7") E("\x1B""Ow", "A1") // 17 terms; alternative "F9" (4 terms) E("\x1B""Ox", "F10") E("\x1B""Oy", "A3") // 17 terms; alternative "F0" (5 terms) E("\x1B[9", "delete") E("\x1B[@", "F41") // 4 terms; alternative "insert" (3 terms) E("\x1B[A", "up") E("\x1B[B", "down") E("\x1B[C", "right") E("\x1B[D", "left") E("\x1B[E", "B2") // 9 terms; alternative "begin" (1 term) E("\x1B[F", "end") // 5 terms; alternative "lower-left" (3 terms) E("\x1B[G", "B2") // 9 terms; alternative "page-down" (4 terms) E("\x1B[H", "home") E("\x1B[I", "page-up") E("\x1B[L", "insert") E("\x1B[M", "mouse") // 83 terms; alternative "F1" (4 terms) E("\x1B[N", "F2") E("\x1B[O", "F3") E("\x1B[P", "F4") E("\x1B[Q", "F5") E("\x1B[R", "F6") E("\x1B[S", "F7") E("\x1B[T", "F8") E("\x1B[U", "F9") // 4 terms; alternative "page-down" (3 terms) E("\x1B[V", "F10") // 4 terms; alternative "page-dup" (3 terms) E("\x1B[W", "F11") E("\x1B[X", "F12") E("\x1B[Y", "F13") // 4 terms; alternative "end" (3 terms) E("\x1B[Z", "back-tab") // 59 terms; alternative "F14" (4 terms) E("\x1B[[", "F42") E("\x1B[\\", "F43") E("\x1B[]", "F44") E("\x1B[^", "F45") E("\x1B[_", "F46") E("\x1B[`", "F47") E("\x1B[a", "F15") E("\x1B[b", "F16") E("\x1B[c", "shift-right") // 15 terms; alternative "F17" (4 terms) E("\x1B[d", "shift-left") // 15 terms; alternative "F18" (4 terms) E("\x1B[e", "F19") E("\x1B[f", "F20") E("\x1B[g", "F21") E("\x1B[h", "F22") E("\x1B[i", "F23") E("\x1B[j", "F24") E("\x1B[k", "F25") E("\x1B[l", "F26") E("\x1B[m", "F27") E("\x1B[n", "F28") E("\x1B[o", "F29") E("\x1B[p", "F30") E("\x1B[q", "F31") E("\x1B[r", "F32") E("\x1B[s", "F33") E("\x1B[t", "F34") E("\x1B[u", "F35") E("\x1B[v", "F36") E("\x1B[w", "F37") E("\x1B[x", "F38") E("\x1B[y", "F39") E("\x1B[z", "F40") E("\x1B[{", "F48") E("\x9B""1~", "home") E("\x9B""2~", "insert") E("\x9B""3~", "delete") E("\x9B""4~", "end") E("\x9B""5~", "page-up") E("\x9B""6~", "page-down") E("\x1B""A", "up") E("\x1B""B", "down") E("\x1B""C", "right") E("\x1B""D", "left") E("\x1B""F", "end") E("\x1B""J", "clear") E("\x1B""P", "delete") E("\x1B""Q", "insert") E("\x1B""S", "page-down") E("\x1B""T", "page-up") E("\x1B""h", "home") E("\x1B""p", "F1") E("\x1B""q", "F2") E("\x1B""r", "F3") E("\x1B""s", "F4") E("\x1B""t", "F5") E("\x1B""u", "F6") E("\x1B""v", "F7") E("\x1B""w", "F8") E("\x1B\x09", "back-tab") E("\x8F""A", "up") E("\x8F""B", "down") E("\x8F""C", "right") E("\x8F""D", "left") E("\x8F""E", "begin") E("\x8F""M", "send") E("\x8F""q", "C1") E("\x8F""s", "C3") E("\x8F""u", "A3") E("\x8F""w", "A1") E("\x8F""y", "B2") E("\x9B""M", "mouse") E("\x9B""Z", "back-tab") E("\x1B", "esc") audit-4.0.2/auparse/ellist.h0000644001034500103450000000422614655201403011415 /* * ellist.h - Header file for ellist.c * Copyright (c) 2006-07,2017,2021 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb */ #ifndef ELLIST_HEADER #define ELLIST_HEADER #include "config.h" #include "private.h" #include "auparse-defs.h" #include #include "nvlist.h" /* This is the record linked list head. Only data elements that are 1 per * event goes here. */ typedef struct { rnode *head; // List head rnode *cur; // Pointer to current node unsigned int cnt; // How many items in this list // Data we add as 1 per event au_event_t e; // event - time & serial number const char *cwd; // cwd used for realpath conversion } event_list_t; static inline unsigned int aup_list_get_cnt(const event_list_t *l) { return l ? l->cnt : 0; } static inline void aup_list_first(event_list_t *l) { l->cur = l->head; } static inline rnode *aup_list_get_cur(const event_list_t *l) { return l ? l->cur : NULL; } AUDIT_HIDDEN_START void aup_list_create(event_list_t *l); void aup_list_clear(event_list_t* l); rnode *aup_list_next(event_list_t *l); int aup_list_append(event_list_t *l, char *record, int list_idx, unsigned int line_number); //int aup_list_get_event(event_list_t* l, au_event_t *e); int aup_list_set_event(event_list_t* l, au_event_t *e); /* Seek to a specific record number */ rnode *aup_list_goto_rec(event_list_t *l, int i); int aup_list_first_field(const event_list_t *l); AUDIT_HIDDEN_END #endif audit-4.0.2/auparse/fsconfig.h0000644001034500103450000000230714655201403011715 /* fsconfig.h * Copyright 2023 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; see the file COPYING. If not, write to the * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor * Boston, MA 02110-1335, USA. * * Authors: * Steve Grubb * Location: include/uapi/linux/mount.h */ _S(0, "FSCONFIG_SET_FLAG") _S(1, "FSCONFIG_SET_STRING") _S(2, "FSCONFIG_SET_BINARY") _S(3, "FSCONFIG_SET_PATH") _S(4, "FSCONFIG_SET_PATH_EMPTY") _S(5, "FSCONFIG_SET_FD") _S(6, "FSCONFIG_CMD_CREATE") _S(7, "FSCONFIG_CMD_RECONFIGURE") _S(8, "FSCONFIG_CMD_CREATE_EXCL") audit-4.0.2/auparse/interpret.h0000644001034500103450000000303014655201403012125 /* interpret.h -- * Copyright 2007,08,2016-23 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; see the file COPYING. If not, write to the * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor * Boston, MA 02110-1335, USA. * * Authors: * Steve Grubb */ #ifndef INTERPRET_HEADER #define INTERPRET_HEADER #include "config.h" #include "dso.h" #include "rnode.h" #include /* Make these hidden to prevent conflicts */ AUDIT_HIDDEN_START void init_interpretation_list(void); int load_interpretation_list(const char *buf); void free_interpretation_list(void); unsigned int interpretation_list_cnt(void); int lookup_type(const char *name); const char *do_interpret(rnode *r, auparse_esc_t escape_mode); void aulookup_destroy_uid_list(void); void aulookup_destroy_gid_list(void); void aulookup_metrics(unsigned int *uid, unsigned int *gid); char *au_unescape(char *buf); AUDIT_HIDDEN_END #endif audit-4.0.2/auparse/flagtab.h0000644001034500103450000000220014655201403011507 /* flagtab.h -- * Copyright 2007,2012 Red Hat Inc., Durham, North Carolina. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb * Location: these are only for the RHEL4 kernel */ _S(0x0001, "follow" ) _S(0x0002, "directory" ) _S(0x0004, "continue" ) _S(0x0010, "parent" ) _S(0x0020, "noalt" ) _S(0x0040, "atomic" ) _S(0x0100, "open" ) _S(0x0200, "create" ) _S(0x0400, "access" ) audit-4.0.2/auparse/lru.c0000644001034500103450000002027714655201403010722 /* * lru.c - LRU cache implementation * Copyright (c) 2016-17,20 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb */ #include "config.h" #include #include #include "lru.h" //#define DEBUG #ifdef DEBUG #include #endif // Local declarations static void dequeue(Queue *queue); // The Queue Node will store the 'str' being cached static QNode *new_QNode(void) { QNode *temp = malloc(sizeof(QNode)); if (temp == NULL) return temp; temp->str = NULL; temp->id = (unsigned int)-1; temp->uses = 1; // Setting to 1 because its being used // Initialize prev and next as NULL temp->prev = temp->next = NULL; return temp; } static Hash *create_hash(unsigned int hsize) { unsigned int i; Hash *hash = malloc(sizeof(Hash)); if (hash == NULL) return hash; hash->array = malloc(hsize * sizeof(QNode*)); if (hash->array == NULL) { free(hash); return NULL; } // Initialize all hash entries as empty for (i = 0; i < hsize; i++) hash->array[i] = NULL; return hash; } static void destroy_hash(Hash *hash) { free(hash->array); free(hash); } #ifdef DEBUG static void dump_queue_stats(const Queue *q) { syslog(LOG_DEBUG, "%s queue size: %u", q->name, q->total); syslog(LOG_DEBUG, "%s slots in use: %u", q->name, q->count); syslog(LOG_DEBUG, "%s hits: %lu", q->name, q->hits); syslog(LOG_DEBUG, "%s misses: %lu", q->name, q->misses); syslog(LOG_DEBUG, "%s evictions: %lu", q->name, q->evictions); } #endif static Queue *create_queue(unsigned int qsize, const char *name) { Queue *queue = malloc(sizeof(Queue)); if (queue == NULL) return queue; // The queue is empty queue->count = 0; queue->hits = 0; queue->misses = 0; queue->evictions = 0; queue->front = queue->end = NULL; // Number of slots that can be stored in memory queue->total = qsize; queue->name = name; return queue; } static void destroy_queue(Queue *queue) { #ifdef DEBUG dump_queue_stats(queue); #endif // Some static analysis scanners try to flag this as a use after // free accessing queue->end. This is a false positive. It is freed. // However, static analysis apps are incapable of seeing that in // remove_node, end is updated to a prior node as part of detaching // the current end node. while (queue->count) dequeue(queue); free(queue); } static unsigned int are_all_slots_full(const Queue *queue) { return queue->count == queue->total; } static unsigned int queue_is_empty(const Queue *queue) { return queue->end == NULL; } #ifdef DEBUG static void sanity_check_queue(Queue *q, const char *id) { unsigned int i; QNode *n; if (q == NULL) { syslog(LOG_DEBUG, "%s - q is NULL", id); abort(); } n = q->front; if (n == NULL) return; // Walk bottom to top i = 0; while (n->next) { if (n->next->prev != n) { syslog(LOG_DEBUG, "%s - corruption found %u", id, i); abort(); } if (i == q->count) { syslog(LOG_DEBUG, "%s - forward loop found %u", id, i); abort(); } i++; n = n->next; } // Walk top to bottom n = q->end; while (n->prev) { if (n->prev->next != n) { syslog(LOG_DEBUG, "%s - Corruption found %u", id, i); abort(); } if (i == 0) { syslog(LOG_DEBUG, "%s - backward loop found %u", id, i); abort(); } i--; n = n->prev; } } #else #define sanity_check_queue(a, b) do {} while(0) #endif static void insert_before(Queue *queue, QNode *node, QNode *new_node) { sanity_check_queue(queue, "1 insert_before"); if (queue == NULL || node == NULL || new_node == NULL) return; new_node->prev = node->prev; new_node->next = node; if (node->prev == NULL) queue->front = new_node; else node->prev->next = new_node; node->prev = new_node; sanity_check_queue(queue, "2 insert_before"); } static void insert_beginning(Queue *queue, QNode *new_node) { sanity_check_queue(queue, "1 insert_beginning"); if (queue == NULL || new_node == NULL) return; if (queue->front == NULL) { queue->front = new_node; queue->end = new_node; new_node->prev = NULL; new_node->next = NULL; } else insert_before(queue, queue->front, new_node); sanity_check_queue(queue, "2 insert_beginning"); } static void remove_node(Queue *queue, const QNode *node) { // If we are at the beginning sanity_check_queue(queue, "1 remove_node"); if (node->prev == NULL) { queue->front = node->next; if (queue->front) queue->front->prev = NULL; goto out; } else { if (node->prev->next != node) { #ifdef DEBUG syslog(LOG_ERR, "Linked list corruption detected %s", queue->name); #endif abort(); } node->prev->next = node->next; } // If we are at the end if (node->next == NULL) { queue->end = node->prev; if (queue->end) queue->end->next = NULL; } else { if (node->next->prev != node) { #ifdef DEBUG syslog(LOG_ERR, "Linked List corruption detected %s", queue->name); #endif abort(); } node->next->prev = node->prev; } out: sanity_check_queue(queue, "2 remove_node"); } // Remove from the end of the queue static void dequeue(Queue *queue) { if (queue_is_empty(queue)) return; QNode *temp = queue->end; remove_node(queue, queue->end); // if (queue->cleanup) // queue->cleanup(temp->str); free(temp->str); free(temp); // decrement the total of full slots by 1 queue->count--; } // Remove front of the queue because its a mismatch void lru_evict(Queue *queue, unsigned int key) { if (queue_is_empty(queue)) return; Hash *hash = queue->hash; QNode *temp = queue->front; hash->array[key] = NULL; remove_node(queue, queue->front); // if (queue->cleanup) // queue->cleanup(temp->str); free(temp->str); free(temp); // decrement the total of full slots by 1 queue->count--; queue->evictions++; } // Make a new entry with str to be assigned later // and setup the hash key static void enqueue(Queue *queue, unsigned int key) { QNode *temp; Hash *hash = queue->hash; // If all slots are full, remove the page at the end if (are_all_slots_full(queue)) { // remove page from hash hash->array[key] = NULL; dequeue(queue); } // Create a new node with given page total, // And add the new node to the front of queue temp = new_QNode(); insert_beginning(queue, temp); hash->array[key] = temp; // increment number of full slots queue->count++; } // This function is called needing a str from cache. // There are two scenarios: // 1. Item is not in cache, so add it to the front of the queue // 2. Item is in cache, we move the str to front of queue QNode *check_lru_cache(Queue *queue, unsigned int key) { QNode *reqPage; Hash *hash = queue->hash; // Check for out of bounds key if (key >= queue->total) { return NULL; } reqPage = hash->array[key]; // str is not in cache, make new spot for it if (reqPage == NULL) { enqueue(queue, key); queue->misses++; // str is there but not at front. Move it } else if (reqPage != queue->front) { remove_node(queue, reqPage); reqPage->next = NULL; reqPage->prev = NULL; insert_beginning(queue, reqPage); // Increment cached object metrics queue->front->uses++; queue->hits++; } else queue->hits++; return queue->front; } Queue *init_lru(unsigned int qsize, void (*cleanup)(void *), const char *name) { Queue *q = create_queue(qsize, name); if (q == NULL) return q; q->cleanup = cleanup; q->hash = create_hash(qsize); return q; } void destroy_lru(Queue *queue) { if (queue == NULL) return; destroy_hash(queue->hash); destroy_queue(queue); } unsigned int compute_subject_key(const Queue *queue, unsigned int uid) { if (queue) return uid % queue->total; else return 0; } audit-4.0.2/auparse/message.c0000644001034500103450000000332114655201403011533 /* message.c -- * Copyright 2004, 2005 Red Hat Inc., Durham, North Carolina. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb */ #include "config.h" #include #include #include "libaudit.h" #include "private.h" #include "internal.h" /* The message mode refers to where informational messages go 0 - stderr, 1 - syslog, 2 - quiet. The default is quiet. */ void set_aumessage_mode(auparse_state_t *au, message_t mode, debug_message_t debug) { au->message_mode = mode; au->debug_message = debug; } void audit_msg(const auparse_state_t *au, int priority, const char *fmt, ...) { va_list ap; if (au->message_mode == MSG_QUIET) return; if (priority == LOG_DEBUG && au->debug_message == DBG_NO) return; va_start(ap, fmt); if (au->message_mode == MSG_SYSLOG) vsyslog(priority, fmt, ap); else { vfprintf(stderr, fmt, ap); fputc('\n', stderr); } va_end( ap ); } audit-4.0.2/auparse/typetab.h0000644001034500103450000001260014655201403011564 /* typetab.h -- * Copyright 2007-09,2011-12,2014-18,2023 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb */ _S(AUPARSE_TYPE_UID, "auid" ) _S(AUPARSE_TYPE_UID, "uid" ) _S(AUPARSE_TYPE_UID, "euid" ) _S(AUPARSE_TYPE_UID, "suid" ) _S(AUPARSE_TYPE_UID, "fsuid" ) _S(AUPARSE_TYPE_UID, "ouid" ) _S(AUPARSE_TYPE_UID, "oauid" ) _S(AUPARSE_TYPE_UID, "old-auid" ) _S(AUPARSE_TYPE_UID, "iuid" ) _S(AUPARSE_TYPE_UID, "id" ) _S(AUPARSE_TYPE_UID, "inode_uid" ) _S(AUPARSE_TYPE_UID, "sauid" ) _S(AUPARSE_TYPE_UID, "obj_uid" ) _S(AUPARSE_TYPE_GID, "obj_gid" ) _S(AUPARSE_TYPE_GID, "gid" ) _S(AUPARSE_TYPE_GID, "egid" ) _S(AUPARSE_TYPE_GID, "sgid" ) _S(AUPARSE_TYPE_GID, "fsgid" ) _S(AUPARSE_TYPE_GID, "ogid" ) _S(AUPARSE_TYPE_GID, "igid" ) _S(AUPARSE_TYPE_GID, "inode_gid" ) _S(AUPARSE_TYPE_GID, "new_gid" ) _S(AUPARSE_TYPE_SYSCALL, "syscall" ) _S(AUPARSE_TYPE_SYSCALL, "uring_op" ) _S(AUPARSE_TYPE_ARCH, "arch" ) _S(AUPARSE_TYPE_EXIT, "exit" ) _S(AUPARSE_TYPE_ESCAPED, "path" ) _S(AUPARSE_TYPE_ESCAPED, "comm" ) _S(AUPARSE_TYPE_ESCAPED, "exe" ) _S(AUPARSE_TYPE_ESCAPED, "file" ) _S(AUPARSE_TYPE_ESCAPED_FILE, "name" ) _S(AUPARSE_TYPE_ESCAPED, "watch" ) _S(AUPARSE_TYPE_ESCAPED, "cwd" ) _S(AUPARSE_TYPE_ESCAPED, "cmd" ) _S(AUPARSE_TYPE_ESCAPED, "acct" ) _S(AUPARSE_TYPE_ESCAPED, "dir" ) _S(AUPARSE_TYPE_ESCAPED_KEY, "key" ) _S(AUPARSE_TYPE_ESCAPED, "vm" ) _S(AUPARSE_TYPE_ESCAPED, "old-chardev" ) _S(AUPARSE_TYPE_ESCAPED, "new-chardev" ) _S(AUPARSE_TYPE_ESCAPED, "old-disk" ) _S(AUPARSE_TYPE_ESCAPED, "new-disk" ) _S(AUPARSE_TYPE_ESCAPED, "old-fs" ) _S(AUPARSE_TYPE_ESCAPED, "new-fs" ) _S(AUPARSE_TYPE_ESCAPED, "old-net" ) _S(AUPARSE_TYPE_ESCAPED, "new-net" ) _S(AUPARSE_TYPE_ESCAPED, "device" ) _S(AUPARSE_TYPE_ESCAPED, "cgroup" ) _S(AUPARSE_TYPE_PERM, "perm" ) _S(AUPARSE_TYPE_PERM, "perm_mask" ) _S(AUPARSE_TYPE_MODE, "mode" ) _S(AUPARSE_TYPE_SOCKADDR, "saddr" ) //_S(AUPARSE_TYPE_FLAGS, "flags" ) _S(AUPARSE_TYPE_PROMISC, "prom" ) _S(AUPARSE_TYPE_PROMISC, "old_prom" ) _S(AUPARSE_TYPE_CAPABILITY, "capability" ) _S(AUPARSE_TYPE_SUCCESS, "res" ) _S(AUPARSE_TYPE_SUCCESS, "result" ) _S(AUPARSE_TYPE_A0, "a0" ) _S(AUPARSE_TYPE_A1, "a1" ) _S(AUPARSE_TYPE_A2, "a2" ) _S(AUPARSE_TYPE_A3, "a3" ) _S(AUPARSE_TYPE_SIGNAL, "sig" ) _S(AUPARSE_TYPE_LIST, "list" ) _S(AUPARSE_TYPE_TTY_DATA, "data" ) _S(AUPARSE_TYPE_SESSION, "ses" ) _S(AUPARSE_TYPE_CAP_BITMAP, "cap_pi" ) _S(AUPARSE_TYPE_CAP_BITMAP, "cap_pe" ) _S(AUPARSE_TYPE_CAP_BITMAP, "cap_pp" ) _S(AUPARSE_TYPE_CAP_BITMAP, "cap_pa" ) _S(AUPARSE_TYPE_CAP_BITMAP, "cap_fi" ) _S(AUPARSE_TYPE_CAP_BITMAP, "cap_fp" ) _S(AUPARSE_TYPE_CAP_BITMAP, "fp" ) _S(AUPARSE_TYPE_CAP_BITMAP, "fi" ) _S(AUPARSE_TYPE_CAP_BITMAP, "old_pp" ) _S(AUPARSE_TYPE_CAP_BITMAP, "old_pi" ) _S(AUPARSE_TYPE_CAP_BITMAP, "old_pe" ) _S(AUPARSE_TYPE_CAP_BITMAP, "old_pa" ) _S(AUPARSE_TYPE_CAP_BITMAP, "new_pp" ) _S(AUPARSE_TYPE_CAP_BITMAP, "new_pi" ) _S(AUPARSE_TYPE_CAP_BITMAP, "new_pe" ) _S(AUPARSE_TYPE_CAP_BITMAP, "pp" ) _S(AUPARSE_TYPE_CAP_BITMAP, "pi" ) _S(AUPARSE_TYPE_CAP_BITMAP, "pe" ) _S(AUPARSE_TYPE_CAP_BITMAP, "pa" ) _S(AUPARSE_TYPE_NFPROTO, "family" ) _S(AUPARSE_TYPE_ICMPTYPE, "icmptype" ) _S(AUPARSE_TYPE_PROTOCOL, "proto" ) _S(AUPARSE_TYPE_ADDR, "addr" ) #ifdef WITH_APPARMOR _S(AUPARSE_TYPE_ESCAPED, "apparmor" ) _S(AUPARSE_TYPE_ESCAPED, "operation" ) _S(AUPARSE_TYPE_ESCAPED, "denied_mask" ) _S(AUPARSE_TYPE_ESCAPED, "info" ) _S(AUPARSE_TYPE_ESCAPED, "profile" ) _S(AUPARSE_TYPE_ESCAPED, "requested_mask") #endif _S(AUPARSE_TYPE_PERSONALITY, "per" ) _S(AUPARSE_TYPE_SECCOMP, "code" ) _S(AUPARSE_TYPE_ESCAPED, "old-rng" ) _S(AUPARSE_TYPE_ESCAPED, "new-rng" ) _S(AUPARSE_TYPE_OFLAG, "oflag" ) _S(AUPARSE_TYPE_ESCAPED, "ocomm" ) _S(AUPARSE_TYPE_MMAP, "flags" ) _S(AUPARSE_TYPE_SIGNAL, "sigev_signo" ) _S(AUPARSE_TYPE_MAC_LABEL, "subj" ) _S(AUPARSE_TYPE_MAC_LABEL, "obj" ) _S(AUPARSE_TYPE_MAC_LABEL, "scontext" ) _S(AUPARSE_TYPE_MAC_LABEL, "tcontext" ) _S(AUPARSE_TYPE_MAC_LABEL, "vm-ctx" ) _S(AUPARSE_TYPE_MAC_LABEL, "img-ctx" ) _S(AUPARSE_TYPE_PROCTITLE, "proctitle" ) _S(AUPARSE_TYPE_ESCAPED, "grp" ) _S(AUPARSE_TYPE_ESCAPED, "new_group" ) _S(AUPARSE_TYPE_HOOK, "hook" ) _S(AUPARSE_TYPE_NETACTION, "action" ) _S(AUPARSE_TYPE_MACPROTO, "macproto" ) _S(AUPARSE_TYPE_ESCAPED, "invalid_context") _S(AUPARSE_TYPE_IOCTL_REQ, "ioctlcmd" ) _S(AUPARSE_TYPE_FANOTIFY, "resp" ) _S(AUPARSE_TYPE_ESCAPED, "sw" ) _S(AUPARSE_TYPE_ESCAPED, "root_dir" ) _S(AUPARSE_TYPE_NLMCGRP, "nl-mcgrp" ) _S(AUPARSE_TYPE_RESOLVE, "resolve" ) _S(AUPARSE_TYPE_TRUST, "subj_trust" ) _S(AUPARSE_TYPE_TRUST, "obj_trust" ) _S(AUPARSE_TYPE_FAN_TYPE, "fan_type" ) _S(AUPARSE_TYPE_FAN_INFO, "fan_info" ) _S(AUPARSE_TYPE_ERRNO, "errno" ) audit-4.0.2/auparse/internal.h0000644001034500103450000001440414655201403011734 /* internal.h -- * Copyright 2006-07,2013-17 Red Hat Inc., Durham, North Carolina. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb */ #ifndef AUPARSE_INTERNAL_HEADER #define AUPARSE_INTERNAL_HEADER #include "auparse-defs.h" #include "ellist.h" #include "auditd-config.h" #include "data_buf.h" #include "normalize-llist.h" #include "dso.h" #include /* This is what state the parser is in */ typedef enum { EVENT_EMPTY, EVENT_ACCUMULATING, EVENT_EMITTED } auparser_state_t; /* * NOTES: * Auditd events are made up of one or more records. The auditd system cannot * guarantee that the set of records that make up an event will occur * atomically, that is the stream will have interleaved records of different * events. IE * ... * event0_record0 * event1_record0 * event1_record1 * event2_record0 * event1_record3 * event2_record1 * event1_record4 * event3_record0 * ... * * The auditd system does guarantee that the records that make up an event will * appear in order. Thus, when processing event streams, we need to maintain * a list of events with their own list of records hence List of List (LOL) * event processing. * * When processing an event stream we detect the end of an event via a common * function, audit_is_last_record, or the time of the event is over eoe_timeout * seconds old. eoe_timeout is the configuration item, 'end_of_event_timeout', * in the auditd.conf configuration file. It's default is EOE_TIMEOUT * * So, under LOL_EVENT processing, a event node (au_lolnode) can be either * * EBS_EMPTY: node is scheduled for emptying (freeing) * EBS_BUILDING: node is still building (awaiting more records and/or awaiting * an End of Event action) * EBS_COMPLETE: node is complete and available for use * * The old auparse() library processed events as they appeared and hence failed * to deal with interleaved records. The old library kept a 'current' event * which it would parse. This new LOL_EVENT code maintains the concept of a * 'current' event, but it now points to an event within the list of list * events structure. */ typedef enum { EBS_EMPTY, EBS_BUILDING, EBS_COMPLETE } au_lol_t; /* * Structure to hold an event and it's list of constituent records */ typedef struct _au_lolnode { event_list_t *l; /* the list of this event's records */ au_lol_t status; /* this event's build state */ } au_lolnode; /* * List of events being processed at any one time */ typedef struct { au_lolnode *array; /* array of events */ int maxi; /* largest index in array used */ size_t limit; /* number of events in array */ } au_lol; /* * The list is a dynamically growable list. We initially hold ARRAY_LIMIT * events and grow by ARRAY_LIMIT if we need to maintain more events at * any one time */ #define ARRAY_LIMIT 80 /* This is the name/value pair used by search tables */ struct nv_pair { int value; const char *name; }; typedef uint32_t value_t; typedef struct subj { value_t primary; // typically auid value_t secondary; // typically uid cllist attr; // List of attributes const char *what; // What the subject is } subject; typedef struct obj { value_t primary; value_t secondary; value_t two; // Sometimes we have a second e.g. rename/mount cllist attr; // List of attributes unsigned int what; // What the primary object is } object; typedef struct data { const char *evkind; value_t session; subject actor; const char *action; object thing; value_t results; const char *how; normalize_option_t opt; value_t key; } normalize_data; struct opaque { ausource_t source; // Source type char **source_list; // Array of buffers, or array of // file names int list_idx; // The index into the source list FILE *in; // If source is file, this is the fd unsigned int line_number; // line number of current file, zero // if invalid char *next_buf; // The current buffer being broken down unsigned int off; // The current offset into next_buf char *cur_buf; // The current buffer being parsed int line_pushed; // True if retrieve_next_line() // returns same input event_list_t *le; // Linked list of record in same event struct expr *expr; // Search expression or NULL char *find_field; // Used to store field name when // searching austop_t search_where; // Where to put the cursors on a match auparser_state_t parse_state; // parsing state DataBuf databuf; // input data // function to call to notify user of parsing changes void (*callback)(struct opaque *au, auparse_cb_event_t cb_event_type, void *user_data); void *callback_user_data; // user data supplied to callback // function to call when user_data is destroyed void (*callback_user_data_destroy)(void *user_data); au_lol *au_lo; // List of events int au_ready; // For speed, we note how many EBS_COMPLETE // events we hold at any point in time. Thus // we don't have to scan the list auparse_esc_t escape_mode; message_t message_mode; // Where to send error messages debug_message_t debug_message; // Whether or not messages are debug or not const char *tmp_translation; // Pointer to manage mem for field translation normalize_data norm_data; }; AUDIT_HIDDEN_START // auditd-config.c int aup_load_config(auparse_state_t *au, struct daemon_conf *config, log_test_t lt); void aup_free_config(struct daemon_conf *config); // normalize.c void init_normalizer(normalize_data *d); void clear_normalizer(normalize_data *d); AUDIT_HIDDEN_END #endif audit-4.0.2/auparse/data_buf.h0000644001034500103450000000630414655201403011665 /* data_buf.h -- * Copyright 2007 Red Hat Inc., Durham, North Carolina. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * John Dennis */ #ifndef DATA_BUF_HEADER #define DATA_BUF_HEADER /*****************************************************************************/ /******************************* Include Files *******************************/ /*****************************************************************************/ #include "config.h" #include "private.h" /*****************************************************************************/ /*********************************** Defines *********************************/ /*****************************************************************************/ #define DATABUF_FLAG_PRESERVE_HEAD (1 << 0) /*****************************************************************************/ /******************************* Type Definitions ****************************/ /*****************************************************************************/ typedef struct Databuf { unsigned flags; size_t alloc_size; char *alloc_ptr; size_t offset; size_t len; size_t max_len; } DataBuf; /*****************************************************************************/ /************************* External Global Variables ***********************/ /*****************************************************************************/ /*****************************************************************************/ /***************************** Inline Functions ****************************/ /*****************************************************************************/ static inline char *databuf_beg(const DataBuf *db) {return (db->alloc_ptr == NULL) ? NULL : db->alloc_ptr+db->offset;} /*****************************************************************************/ /**************************** Exported Functions ***************************/ /*****************************************************************************/ AUDIT_HIDDEN_START void databuf_print(const DataBuf *db, int print_data, char *fmt, ...) #ifdef __GNUC__ __attribute__ ((format (printf, 3, 4))); #else ; #endif int databuf_init(DataBuf *db, size_t size, unsigned flags); void databuf_free(DataBuf *db); int databuf_append(DataBuf *db, const char *src, size_t src_size); int databuf_replace(DataBuf *db, const char *src, size_t src_size); int databuf_advance(DataBuf *db, size_t advance); int databuf_reset(DataBuf *db); AUDIT_HIDDEN_END #endif audit-4.0.2/install-sh0000755001034500103450000003577614655201422010333 #!/bin/sh # install - install a program, script, or datafile scriptversion=2020-11-14.01; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. tab=' ' nl=' ' IFS=" $tab$nl" # Set DOITPROG to "echo" to test this script. doit=${DOITPROG-} doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_mkdir= # Desired mode of installed file. mode=0755 # Create dirs (including intermediate dirs) using mode 755. # This is like GNU 'install' as of coreutils 8.32 (2020). mkdir_umask=22 backupsuffix= chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -p pass -p to $cpprog. -s $stripprog installed files. -S SUFFIX attempt to back up existing files, with suffix SUFFIX. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG By default, rm is invoked with -f; when overridden with RMPROG, it's up to you to specify -f if you want it. If -S is not specified, no backups are attempted. Email bug reports to bug-automake@gnu.org. Automake home page: https://www.gnu.org/software/automake/ " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -p) cpprog="$cpprog -p";; -s) stripcmd=$stripprog;; -S) backupsuffix="$2" shift;; -t) is_target_a_directory=always dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done # We allow the use of options -d and -T together, by making -d # take the precedence; this is for compatibility with GNU install. if test -n "$dir_arg"; then if test -n "$dst_arg"; then echo "$0: target directory not allowed when installing a directory." >&2 exit 1 fi fi if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then if test $# -gt 1 || test "$is_target_a_directory" = always; then if test ! -d "$dst_arg"; then echo "$0: $dst_arg: Is not a directory." >&2 exit 1 fi fi fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? # Don't chown directories that already exist. if test $dstdir_status = 0; then chowncmd="" fi else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dstbase=`basename "$src"` case $dst in */) dst=$dst$dstbase;; *) dst=$dst/$dstbase;; esac dstdir_status=0 else dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi case $dstdir in */) dstdirslash=$dstdir;; *) dstdirslash=$dstdir/;; esac obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false # The $RANDOM variable is not portable (e.g., dash). Use it # here however when possible just to lower collision chance. tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap ' ret=$? rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null exit $ret ' 0 # Because "mkdir -p" follows existing symlinks and we likely work # directly in world-writeable /tmp, make sure that the '$tmpdir' # directory is successfully created first before we actually test # 'mkdir -p'. if (umask $mkdir_umask && $mkdirprog $mkdir_mode "$tmpdir" && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. test_tmpdir="$tmpdir/a" ls_ld_tmpdir=`ls -ld "$test_tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null fi trap '' 0;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac oIFS=$IFS IFS=/ set -f set fnord $dstdir shift set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=${dstdirslash}_inst.$$_ rmtmp=${dstdirslash}_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && { test -z "$stripcmd" || { # Create $dsttmp read-write so that cp doesn't create it read-only, # which would cause strip to fail. if test -z "$doit"; then : >"$dsttmp" # No need to fork-exec 'touch'. else $doit touch "$dsttmp" fi } } && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # If $backupsuffix is set, and the file being installed # already exists, attempt a backup. Don't worry if it fails, # e.g., if mv doesn't support -f. if test -n "$backupsuffix" && test -f "$dst"; then $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null fi # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: audit-4.0.2/ChangeLog0000644001034500103450000003623514655201403010067 4.0.2 - Fix musl C builds - Many code cleanups (Yugend) - Use atomic variables if available for signal related flags - Dont rotate audit logs when auditd is in debug mode - Fix a couple memory leaks on error paths - Correct output when displaying rules with exe/path/dir (Attila Lakatos) - Fix auparse lookup test to not use the system libaupaurse - Improve auparse metrics - Update auparse normalizer for recent syscalls - Make status report uniform 4.0.1 - Update TRUSTED_APP interpretation to look for known fields - In auditd plugins, allow variable amount of arguments (Attila Lakatos) - Fix augenrules to work correctly when kernel is in immutable mode - Add ausearch_cur_event to auparse library (Attila Lakatos) - Add audisp-filter plugin (Attila Lakatos) - Improve sorting speed of aureport --summary reports - auditd & audit-rules.service pick up paths automatically (Laurent Bigonville) - Update auparse normalizer for new syscalls 4.0 - Drop python2 support - Drop auvirt and autrace programs - Drop SysVinit support - Require the use of the 5.0 or later kernel headers - New README.md file - Rewrite legacy service functions in terms of systemctl - Consolidate and update end of event detection to a common function - Split off rule loading from auditd.service into audit-rules.service - Refactor libaudit.h to split out logging functions and record numbers - Speed up aureport --summary reports - Limit libaudit python bindings to logging functions - Add a metrics function for auparse - Change auditctl to use pidfd_send_signal for signaling auditd - Adjust watches to optimize syscalls hooked when watch file access - Drop nispom rules - Add intepretations for fsconfig, fsopen, fsmount, & move_mount - Many code fixups (cgzones) - Update syscall and interpretation tables to the 6.8 kernel 3.1.2 - When processing a run level change, make auditd exit - In auditd, fix return code when rules added in immutable mode - In auparse, when files are given, also consider EUID for access - Auparse now interprets unnamed/anonymous sockets (Enzo Matsumiya) - Disable Python bindings from setting rules due to swig bug (S. Trofimovich) - Update all lookup tables for the 6.5 kernel - Don't be as paranoid about auditctl -R file permissions - In ausearch, correct subject/object search to be an and if both are given - Adjust formats for 64 bit time_t - Fix segfault in python bindings around the feed API - Add feed_has_data, get_record_num, and get/goto_field_num to python bindings 3.1.1 - Add user friendly keywords for signals to auditctl - In ausearch, parse up URINGOP and DM_CTRL records - Harden auparse to better handle corrupt logs - Fix a CFLAGS propagation problem in the common directory - Move the audispd af_unix plugin to a standalone program 3.1 - Disable ProtectControlGroups in auditd.service by default - Fix rule checking for exclude filter - Make audit_rule_syscallbyname_data work correctly outside of auditctl - Add new record types - Add io_uring support - Add support for new FANOTIFY record fields - Add keyword, this-hour, to ausearch/report start/end options - Add Requires.private to audit.pc file - Try to interpret OPENAT2 fields correctly 3.0.9 - In auditd, release the async flush lock on stop - Don't allow auditd to log directly into /var/log when log_group is non-zero - Cleanup krb5 memory leaks on error paths - Update auditd.cron to use auditctl --signal - In auparse, if too many fields, realloc array bigger (Paul Wolneykien) - In auparse, special case kernel module name interpretation - If overflow_action is ignore, don't treat as an error 3.0.8 - Add gcc function attributes for access and allocation - Add some more man pages (MIZUTA Takeshi) - In auditd, change the reinitializing of the plugin queue - Fix path normalization in auparse (Sergio Correia) - In libaudit, handle ECONNREFUSED for network uid/gid lookups (Enzo Matsumiya) - In audisp-remote, fix hang with disk_low_action=suspend (Enzo Matsumiya) - Drop ProtectHome from auditd.service as it interferes with rules 3.0.7 - Add support for the OPENAT2 record type (Richard Guy Briggs) - In auditd, close the logging file descriptor when logging is suspended - Update the capabilities lookup table to match 5.16 kernel - Improve interpretation of renamat & faccessat family of syscalls - Update syscall table for the 5.16 kernel - Reduce dependency from initscripts to initscripts-service 3.0.6 - Fixed various issues when dealing with corrupted logs - Make IPX packet interpretation dependent on the ipx header file existing - Add b32/b64 support to ausyscall (Egor Ignatov) - Add support for armv8l (Egor Ignatov) - Fix auditctl list of syscalls in PPC (Egor Ignatov) - auditd.service now restarts auditd under some conditions (Timothée Ravier) 3.0.5 - In auditd, flush uid/gid caches when user/group added/deleted/modified - Fixed various issues when dealing with corrupted logs - In auditd, check if log_file is valid before closing handle 3.0.4 - Apply performance speedups to auparse library - Optimize rule loading in auditctl - Fix an auparse memory leak caused by glibc-2.33 by replacing realpath - Update syscall table to the 5.14 kernel - Fixed various issues when dealing with corrupted logs 3.0.3 - Dont interpret audit netlink groups unless AUDIT_NLGRP_MAX is defined - Add support for AUDIT_RESP_ORIGIN_UNBLOCK_TIMED to ids - Change auparse_feed_has_data in auparse to include incomplete events - Auditd, stop linking against -lrt - Add ProtectHome and RestrictRealtime to auditd.service - In auditd, read up to 3 netlink packets in a row - In auditd, do not validate path to plugin unless active - In auparse, only emit config errors when AUPARSE_DEBUG env variable exists 3.0.2 - In audispd-statsd plugin, use struct sockaddr_storage (Ville Heikkinen) - Optionally interpret auid in auditctl -l - Update some syscall argument interpretations - In auditd, do not allow spaces in the hostname name format - Big documentation cleanup (MIZUTA Takeshi) - Update syscall table to the 5.12 kernel - Update the auparse normalizer for new event types - Fix compiler warnings in ids subsystem - Block a couple signals from flush & reconfigure threads - In auditd, don't wait on flush thread when exiting - Output error message if the path of input files are too long ausearch/report 3.0.1 - Update syscall table to the 5.11 kernel - Add new --eoe-timeout option to ausearch and aureport (Burn Alting) - Only enable periodic timers when listening on the network - Upgrade libev to 4.33 - Add auparse_new_buffer function to auparse library - Use the select libev backend unless aggregating events - Add sudoers to some base audit rules - Update the auparse normalizer for some new syscalls and event types 3.0 - Generate checkpoint file even when no results are returned (Burn Alting) - Fix log file creation when file logging is disabled entirely (Vlad Glagolev) - Convert auparse_test to run with python3 (Tomáš Chvátal) - Drop support for prelude - Adjust backlog_wait_time in rules to the kernel default (#1482848) - Remove ids key syntax checking of rules in auditctl - Use SIGCONT to dump auditd internal state (#1504251) - Fix parsing of virtual timestamp fields in ausearch_expression (#1515903) - Fix parsing of uid & success for ausearch - Add support for not equal operator in audit by executable (Ondrej Mosnacek) - Hide lru symbols in auparse - Add systemd process protections - Fix aureport summary time range reporting - Allow unlimited retries on startup for remote logging - Add queue_depth to remote logging stats and increase default queue_depth size - Fix segfault on shutdown - Merge auditd and audispd code - Close on execute init_pipe fd (#1587995) - Breakout audisp syslog plugin to be standalone program - Create a common internal library to reduce code - Move all audispd config files under /etc/audit/ - Move audispd.conf settings into auditd.conf - Add queue depth statistics to internal state dump report - Add network statistics to internal state dump report - SIGUSR now also restarts queue processing if its suspended - Update lookup tables for the 4.18 kernel - Add auparse_normalizer support for SOFTWARE_UPDATE event - Add 30-ospp-v42.rules to meet new Common Criteria requirements - Deprecate enable_krb and replace with transport config opt for remote logging - Mark netlabel events as simple events so that get processed quicker - When auditd is reconfiguring, only SIGHUP plugins with valid pid (#1614833) - In aureport, fix segfault in file report - Add auparse_normalizer support for labeled networking events - Fix memory leak in audisp-remote plugin when using krb5 transport. (#1622194) - In ausearch/auparse, event aging is off by a second - In ausearch/auparse, correct event ordering to process oldest first - Migrate auparse python test to python3 - auparse_reset was not clearing everything it should - Add support for AUDIT_MAC_CALIPSO_ADD, AUDIT_MAC_CALIPSO_DEL events - In ausearch/report, lightly parse selinux portion of USER_AVC events - Add bpf syscall command argument interpretation to auparse - In ausearch/report, limit record size when malformed - Port af_unix plugin to libev - In auditd, fix extract_type function for network originating events - In auditd, calculate right size and location for network originating events - Make legacy script wait for auditd to terminate (#1643567) - Treat all network originating events as VER2 so dispatcher doesn't format it - If an event has a node name make it VER2 so dispatcher doesnt format it - In audisp-remote do an initial connection attempt (#1625156) - In auditd, allow expression of space left as a percentage (#1650670) - On PPC64LE systems, only allow 64 bit rules (#1462178) - Make some parts of auditd state report optional based on config - Update to libev-4.25 - Fix ausearch when checkpointing a single file (Burn Alting) - Fix scripting in 31-privileged.rules wrt filecap (#1662516) - In ausearch, do not checkpoint if stdin is input source - In libev, remove __cold__ attribute for functions to allow proper hardening - Add tests to configure.ac for openldap support - Make systemd support files use /run rather than /var/run (Christian Hesse) - Fix minor memory leak in auditd kerberos credentials code - Allow exclude and user filter by executable name (Ondrej Mosnacek) - Fix auditd regression where keep_logs is limited by rotate_logs 2 file test - In ausearch/report fix --end to use midnight time instead of now (#1671338) - Add substitute functions for strndupa & rawmemchr - Fix memleak in auparse caused by corrected event ordering - Fix legacy reload script to reload audit rules when daemon is reloaded - Support for unescaping in trusted messages (Dmitry Voronin) - In auditd, use standard template for DAEMON events (Richard Guy Briggs) - In aureport, fix segfault for malformed USER_CMD events - Add exe field to audit_log_user_command in libaudit - In auditctl support filter on socket address families (Richard Guy Briggs) - Deprecate support for Alpha & IA64 processors - If space_left_action is rotate, allow it every time (#1718444) - In auparse, drop standalone EOE events - Add milliseconds column for ausearch extra time csv format - Fix aureport first event reporting when no start given - In audisp-remote, add new config item for startup connection errors - Remove dependency on chkconfig - Install rules to /usr/share/audit/sample-rules/ - Split up ospp rules to make SCAP scanning easier (#1746018) - In audisp-syslog, support interpreting records (#1497279) - Audit USER events now sends msg as name value pair - Add support for AUDIT_BPF event - Auditd should not process AUDIT_REPLACE events - Update syscall tables to the 5.5 kernel - Improve personality interpretation by using PERS_MASK - Speedup ausearch/report parsing RAW logging format by caching uid/name lookup - Change auparse python bindings to shared object (Issue #121) - Add error messages for watch permissions - If audit rules file doesn't exist log error message instead of info message - Revise error message for unmatched options in auditctl - In audisp-remote, fixup remote endpoint disappearing in ascii format - Add backlog_wait_time_actual reporting / resetting to auditctl (Max Englander) - In auditctl, add support for sending a signal to auditd 2.8.3 - Correct msg function name in LRU debug code - Fix a segfault in auditd when dns resolution isn't available - Make a reload legacy service for auditd - In auparse python bindings, expose some new types that were missing - In normalizer, pickup subject kind for user_login events - Fix interpretation of unknown ioctcmds (#1540507) - Add ANOM_LOGIN_SERVICE, RESP_ORIGIN_BLOCK, & RESP_ORIGIN_BLOCK_TIMED events - In auparse_normalize for USER_LOGIN events, map acct for subj_kind - Fix logging of IPv6 addresses in DAEMON_ACCEPT events (#1534748) - Do not rotate auditd logs when num_logs < 2 (brozs) 2.8.2 - Update tables for 4.14 kernel - Fixup ipv6 server side binding - AVC report from aureport was missing result column header (#1511606) - Add SOFTWARE_UPDATE event - In ausearch/report pickup any path and new-disk fields as a file - Fix value returned by auditctl --reset-lost (Richard Guy Briggs) - In auparse, fix expr_create_timestamp_comparison_ex to be numeric field - Fix building on old systems without linux/fanotify.h - Fix shell portability issues reported by shellcheck - Auditd validate_email should not use gethostbyname 2.8.1 - Fix NULL ptr dereference in audispd plugin_dir parser - Signed/unsigned cleanup 2.8 - Add support for ambient capability fields (Richard Guy Briggs) - Update auparse-normalizer to support TTY events - Add auparse_normalize_object_primary2 API - In ausearch text format, add 'to xxx' for mount operations - In ausearch add new --extra-obj2 option for CSV output - In auparse_normalize, pick up second file name for rename syscalls - In auparse_normalize, pick up permission & ownership changes as obj2 - In auparse_normalize, pick up uid/gid for setuid/gid syscalls as obj2 - In auparse_normalize, pick up link for symlink syscalls as obj2 - In auparse_normalize, correct mount records based on success - In auparse_normalize, correct object for USER_MGMT, ACCT_LOCK, & ACCT_UNLOCK - Add default port to auditd.conf (#1455598) - Fix auvirt to report AVC's (#982154) - Add sockaddr accessor functions in auparse - In ausearch, use auparse_interpret_sock_address for text mode output - In remote logging, inform client auditd is suspended and please disconnect - Auditd and audisp-remote now supports IPv6 - In auparse function auparse_goto_record_num, make it positioned on first field - In auparse_normalize, finish support for MAC_STATUS and MAC_CONFIG events - Add support for filesystem filter type (Richard Guy Briggs) - Add file system type table for fstype lookup - Add command line option to auditd & audispd for config dir path (Dan Born) - Fix auparse serial parsing of event when system time < 9 characters (kruvin) - In auparse, allow non-equality comparisons for uid & gid fields (#1399314) - In auparse_normalize, add support for USER_DEVICE events - In audispd.conf, add new plugin_dir config item to customize plugin location - Add support for FANOTIFY event - Improve auparse_normalize support for SECCOMP events - In auparse_normalize, pick up comm for successful memory allocations audit-4.0.2/configure.ac0000644001034500103450000003424114655201403010576 dnl define([AC_INIT_NOTICE], [### Generated automatically using autoconf version] AC_ACVERSION [ ### Copyright 2005-24 Steve Grubb ### ### 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 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR ### OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ### ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ### OTHER DEALINGS IN THE SOFTWARE. ### ### For usage, run `./configure --help' ### For more detailed information on installation, read the file `INSTALL'. ### ### If configuration succeeds, status is in the file `config.status'. ### A log of configuration tests is in `config.log'. ]) AC_REVISION($Revision: 1.3 $)dnl AC_INIT([audit], [4.0.2]) AC_PREREQ([2.50])dnl AC_CONFIG_HEADERS([config.h]) echo Configuring auditd $VERSION AC_CONFIG_MACRO_DIR([m4]) AC_CANONICAL_TARGET AM_INIT_AUTOMAKE([subdir-objects]) LT_INIT AC_SUBST(LIBTOOL_DEPS) OLDLIBS="$LIBS" m4_include([src/libev/libev.m4]) libev_LIBS="$LIBS" LIBS="$OLDLIBS" echo . echo Checking for programs AC_PROG_CC AC_PROG_INSTALL AC_PROG_AWK AX_PROG_CC_FOR_BUILD echo . echo Checking for header files AC_CHECK_SIZEOF([unsigned int]) AC_CHECK_SIZEOF([unsigned long]) AC_CHECK_SIZEOF([long]) AC_CHECK_SIZEOF([time_t]) dnl; next is needed for old compilers and plugins/ids/Makefile.am AM_PROG_CC_C_O AC_CHECK_DECLS([AUDIT_FEATURE_VERSION], [], [], [[#include ]]) AC_CHECK_MEMBERS([struct audit_status.feature_bitmap], [], [], [[#include ]]) AC_CHECK_DECLS([AUDIT_VERSION_BACKLOG_WAIT_TIME], [], [], [[#include ]]) AC_CHECK_DECLS([AUDIT_STATUS_BACKLOG_WAIT_TIME], [], [], [[#include ]]) AC_CHECK_DECLS([AUDIT_STATUS_BACKLOG_WAIT_TIME_ACTUAL], [], [], [[#include ]]) AC_CHECK_DECLS([ADDR_NO_RANDOMIZE],,, [#include ]) dnl; posix_fallocate is used in audisp-remote AC_CHECK_FUNCS([posix_fallocate]) dnl; signalfd is needed for libev AC_CHECK_FUNC([signalfd], [], [ AC_MSG_ERROR([The signalfd system call is necessary for auditd]) ]) dnl; check if rawmemchr is available AC_CHECK_FUNCS([rawmemchr]) dnl; check if faccessat is available AC_CHECK_FUNCS([faccessat]) dnl; check if strndupa is available AC_LINK_IFELSE( [AC_LANG_SOURCE( [[ #define _GNU_SOURCE #include int main() { (void) strndupa("test", 10); return 0; }]])], [AC_DEFINE(HAVE_STRNDUPA, 1, [Let us know if we have it or not])], [] ) AC_CHECK_HEADERS([stdatomic.h], [ AC_DEFINE([HAVE_ATOMIC], 1, [Define to 1 if you have the header file.]) AC_DEFINE([ATOMIC_INT], atomic_int, [Define atomic_int if you have the header file.]) AC_DEFINE([ATOMIC_UNSIGNED], atomic_uint, [Define atomic_uint if you have the header file.]) ], [ AC_DEFINE([ATOMIC_INT], int, [Define to the type of an int if is not available.]) AC_DEFINE([ATOMIC_UNSIGNED], unsigned, [Define to the type of an unsigned if is not available.]) ]) AC_MSG_CHECKING(__attr_access support) AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[ #include int audit_fgets(char *buf, size_t blen, int fd) __attr_access ((__write_only__, 1, 2)); int main(void) { return 0; }]])], [ACCESS="yes"], [ACCESS="no"] ) AC_MSG_RESULT($ACCESS) AC_MSG_CHECKING(__attr_dealloc_free support) AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[ #include extern char *audit_encode_nv_string(const char *name, const char *value, unsigned int vlen) __attr_dealloc_free; int main(void) { return 0; }]])], [DEALLOC="yes"], [DEALLOC="no"] ) AC_MSG_RESULT($DEALLOC) dnl; pthread_yield is used in zos-remote OLDLIBS="$LIBS" AC_SEARCH_LIBS(pthread_yield, pthread, [AC_DEFINE(HAVE_PTHREAD_YIELD, 1, [Define to 1 if we have pthread_yield])], []) LIBS="$OLDLIBS" withval="" AC_MSG_CHECKING(whether to create python3 bindings) AC_ARG_WITH(python3, AS_HELP_STRING([--with-python3],[enable building python3 bindings]), use_python3=$withval, use_python3=auto) if test "x$use_python3" = xno ; then AC_MSG_RESULT(no) else AC_MSG_RESULT(investigating) AC_PATH_PROG([use_python3], [python3-config], [no]) if test "x$use_python3" = xno ; then if test "x$withval" = xyes ; then echo "Python3 bindings were selected but python3-config was not found." echo "Please ensure that it's installed or pass --without-python3 to ./configure" exit 1 fi echo "Python3 bindings will NOT be built" else echo "Python3 bindings WILL be built" use_python3=yes AM_PATH_PYTHON([3.1],, [:]) PYTHON3_CFLAGS=`python3-config --cflags 2> /dev/null` PYTHON3_LIBS=`python3-config --libs 2> /dev/null` PYTHON3_INCLUDES=`python3-config --includes 2> /dev/null` AC_SUBST(PYTHON3_CFLAGS) AC_SUBST(PYTHON3_LIBS) AC_SUBST(PYTHON3_INCLUDES) fi fi AM_CONDITIONAL(USE_PYTHON3, test ${use_python3} = "yes") if test "x$use_python" = "xyes" || test "x$use_python3" = "xyes" ; then AC_CHECK_PROG([SWIG],[swig],[swig], [no]) AS_IF([test x"$SWIG" == x"no"], [AC_MSG_ERROR([Please install swig before configuring (required by python/python3).])]) fi withval="" AC_MSG_CHECKING(whether to create Go language bindings) AC_ARG_WITH(golang, AS_HELP_STRING([--with-golang],[enable building golang bindings]), use_golang=$withval, use_golang=auto) if test "x$use_golang" = xno ; then golang_found="no" AC_MSG_RESULT(no) else AC_MSG_RESULT(testing) AC_CHECK_PROG([GOLANG],[go],[go],[no]) AS_IF([test "x$GOLANG" != "xno"],[ AC_MSG_NOTICE(Go bindings will be built) golang_found="yes" # Substitute some golang environment. GOROOT=`$GOLANG env GOROOT` AC_SUBST([GOROOT]) ], [ if test "x$use_golang" = xyes ; then AC_MSG_ERROR([Go language explicitly requested and program not found]) else AC_MSG_WARN(Go not found - go bindings will not be made) fi ]) fi AM_CONDITIONAL(HAVE_GOLANG, test "x${golang_found}" = "xyes") #auditd listener AC_MSG_CHECKING(whether to include auditd network listener support) AC_ARG_ENABLE(listener, [AS_HELP_STRING([--disable-listener], [Disable auditd network listener support])], enable_listener=$enableval, enable_listener=yes) if test "x$enable_listener" != "xno"; then AC_DEFINE(USE_LISTENER, 1, [Define if you want to use the auditd network listener.]) fi AM_CONDITIONAL(ENABLE_LISTENER, test "x$enable_listener" != "xno") AC_MSG_RESULT($enable_listener) #audisp zos-remote plugin AC_ARG_ENABLE(zos-remote, [AS_HELP_STRING([--disable-zos-remote], [Disable audisp ZOS remote plugin])], enable_zos_remote=$enableval, enable_zos_remote=yes) if test $enable_zos_remote = yes; then AC_CHECK_HEADER(lber.h, ldap_headers=yes, ldap_headers=no) AC_CHECK_LIB(lber, ber_free, LDAP_LDADD=-llber) if test x$LDAP_LDADD = x ; then AC_MSG_ERROR(zos remote support was requested but the openldap library was not found) fi if test $ldap_headers = no ; then AC_MSG_ERROR(openldap libraries found but headers are missing) fi fi AC_MSG_CHECKING(whether to include audisp ZOS remote plugin) AM_CONDITIONAL(ENABLE_ZOS_REMOTE, test "x$enable_zos_remote" != "xno") AC_MSG_RESULT($enable_zos_remote) #gssapi AC_ARG_ENABLE(gssapi_krb5, [AS_HELP_STRING([--enable-gssapi-krb5],[Enable GSSAPI Kerberos 5 support @<:@default=no@:>@])], [case "${enableval}" in yes) want_gssapi_krb5="yes" ;; no) want_gssapi_krb5="no" ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-gssapi-krb5) ;; esac], [want_gssapi_krb5="no"] ) if test $want_gssapi_krb5 = yes; then AC_CHECK_LIB(gssapi_krb5, gss_acquire_cred, [ AC_CHECK_HEADER(gssapi/gssapi.h, [ AC_DEFINE(USE_GSSAPI,, Define if you want to use GSSAPI) gss_libs="-lgssapi_krb5 -lkrb5" AC_SUBST(gss_libs) ]) ]) fi AM_CONDITIONAL(ENABLE_GSSAPI, test x$want_gssapi_krb5 = xyes) # ids AC_MSG_CHECKING(whether to enable experimental options) AC_ARG_ENABLE(experimental, [AS_HELP_STRING([--enable-experimental],[Enable experimental audit components @<:@default=no@:>@])], [case "${enableval}" in yes) want_exper="yes" ;; no) want_exper="no" ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-experimental) ;; esac], [want_exper="no"] ) AM_CONDITIONAL(ENABLE_EXPERIMENTAL, test x$want_exper = xyes) AC_MSG_RESULT($want_exper) # linux/fanotify.h AC_CHECK_HEADER(linux/fanotify.h, [ AC_DEFINE(USE_FANOTIFY, [], [Defined when fanotify headers are found]) ]) withval="" ALLDEBUG="-g" AC_ARG_WITH(debug, [ --with-debug turn on debugging [[default=no]]], [ if test "x${withval}" = xyes; then DEBUG="$ALLDEBUG" OPT="-O" AM_CONDITIONAL(DEBUG, true) else DEBUG="-DNDEBUG" AM_CONDITIONAL(DEBUG, false) fi ], [ DEBUG="-DNDEBUG"; AM_CONDITIONAL(DEBUG, false) ]) WFLAGS="" AC_MSG_CHECKING(for -Wformat-truncation) TMPCFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} -Wformat-truncation" AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[WFLAGS="-Wno-format-truncation" AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)]) CFLAGS="${TMPCFLAGS}" CFLAGS="${CFLAGS} -Wunused-but-set-variable" AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[WFLAGS="${WFLAGS} -Wno-unused-but-set-variable" AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)]) CFLAGS="${TMPCFLAGS}" AC_SUBST(WFLAGS) withval="" AC_MSG_CHECKING(whether to include arm eabi processor support) AC_ARG_WITH(arm, AS_HELP_STRING([--with-arm],[enable Arm eabi processor support]), use_arm=$withval, use_arm=no) if test x$use_arm != xno ; then AC_DEFINE(WITH_ARM,1,[Define if you want to enable Arm eabi processor support.]) fi AM_CONDITIONAL(USE_ARM, test x$use_arm = xyes) AC_MSG_RESULT($use_arm) withval="" AC_MSG_CHECKING(whether to include aarch64 processor support) AC_ARG_WITH(aarch64, AS_HELP_STRING([--with-aarch64],[enable Aarch64 processor support]), use_aarch64=$withval, use_aarch64=no) if test x$use_aarch64 != xno ; then AC_DEFINE(WITH_AARCH64,1,[Define if you want to enable Aarch64 processor support.]) fi AM_CONDITIONAL(USE_AARCH64, test x$use_aarch64 = xyes) AC_MSG_RESULT($use_aarch64) withval="" AC_MSG_CHECKING(whether to use apparmor) AC_ARG_WITH(apparmor, AS_HELP_STRING([--with-apparmor],[enable AppArmor events]), use_apparmor=$withval, use_apparmor=no) if test x$use_apparmor != xno ; then AC_DEFINE(WITH_APPARMOR,1,[Define if you want to enable AppArmor events.]) fi AC_MSG_RESULT($use_apparmor) withval="" AC_MSG_CHECKING(whether to use libwrap) AC_ARG_WITH(libwrap, [ --with-libwrap[=PATH] Compile in libwrap (tcp_wrappers) support.], [ case "$withval" in no) AC_MSG_RESULT(no) ;; yes) AC_MSG_RESULT(yes) AC_CHECK_HEADER(tcpd.h, [], AC_MSG_ERROR([Could not find libwrap headers]),) AC_CHECK_LIB(wrap, request_init, [ LIBWRAP_LIBS="-lwrap" ]) AC_CHECK_LIB(nsl, yp_get_default_domain, [ LIBWRAP_LIBS="$LIBWRAP_LIBS -lnsl" ]) ;; *) AC_MSG_RESULT(yes) if test -d "$withval"; then LIBWRAP_LIBS="-L$withval -lwrap" else LIBWRAP_LIBS="$withval" fi AC_CHECK_HEADER(tcpd.h, [], AC_MSG_ERROR([Could not find libwrap headers])) AC_CHECK_LIB(wrap, request_init, []) AC_CHECK_LIB(nsl, yp_get_default_domain, [ LIBWRAP_LIBS="$LIBWRAP_LIBS -lnsl" ]) OLDLIBS="$LIBS" LIBS="$LIBWRAP_LIBS $LIBS" AC_LINK_IFELSE([AC_LANG_PROGRAM( [[ int allow_severity; int deny_severity; ]], [[ hosts_access(); ]])],[], [ AC_MSG_ERROR(Could not find the $withval library. You must first install tcp_wrappers.) ]) LIBS="$OLDLIBS" ;; esac ], AC_MSG_RESULT(no) ) if test x"$LIBWRAP_LIBS" != "x"; then AC_DEFINE_UNQUOTED(HAVE_LIBWRAP, [], Define if tcp_wrappers support is enabled ) fi withval="" AC_MSG_CHECKING(whether to include io_uring support) AC_ARG_WITH(io_uring, AS_HELP_STRING([--with-io_uring],[enable io_uring support]), use_io_uring=$withval, use_io_uring=no) if test x$use_io_uring != xno ; then AC_DEFINE(WITH_IO_URING,1,[Define if you want to enable io_uring support.]) fi # AM_CONDITIONAL(USE_IO_URING, test x$use_io_uring = xyes) AC_MSG_RESULT($use_io_uring) # linux/ipx.h - deprecated in 2018 AC_CHECK_HEADER(linux/ipx.h, ipx_headers=yes, ipx_headers=no) if test $ipx_headers = yes ; then AC_DEFINE(HAVE_IPX_HEADERS,1,[IPX packet interpretation]) fi # See if we want to support lower capabilities for plugins LIBCAP_NG_PATH AC_SUBST(DEBUG) AC_SUBST(LIBWRAP_LIBS) #AC_SUBST(libev_LIBS) AC_CONFIG_FILES(Makefile common/Makefile lib/Makefile lib/audit.pc lib/test/Makefile auparse/Makefile auparse/test/Makefile auparse/auparse.pc src/Makefile src/libev/Makefile src/test/Makefile docs/Makefile rules/Makefile init.d/Makefile audisp/Makefile audisp/plugins/Makefile audisp/plugins/af_unix/Makefile audisp/plugins/remote/Makefile audisp/plugins/zos-remote/Makefile audisp/plugins/syslog/Makefile audisp/plugins/filter/Makefile audisp/plugins/ids/Makefile audisp/plugins/ids/rules/Makefile audisp/plugins/statsd/Makefile bindings/Makefile bindings/python/Makefile bindings/python/python3/Makefile bindings/golang/Makefile bindings/swig/Makefile bindings/swig/src/Makefile bindings/swig/python3/Makefile tools/Makefile tools/aulast/Makefile tools/aulastlog/Makefile tools/ausyscall/Makefile m4/Makefile) AC_OUTPUT echo . echo " Auditd Version: $VERSION Target: $target Installation prefix: $prefix Compiler: $CC Compiler flags: `echo $CFLAGS | fmt -w 50 | sed 's,^, ,'` __attr_access support: $ACCESS __attr_dealloc_free support: $DEALLOC " audit-4.0.2/compile0000755001034500103450000001635014655201422007670 #! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1999-2021 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN* | MSYS*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/* | msys/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: audit-4.0.2/audisp/0000755001034500103450000000000014655201457007662 5audit-4.0.2/audisp/audispd-config.h0000644001034500103450000000214714655201403012642 /* audispd-config.h -- * Copyright 2007-08,2018 Red Hat Inc., Durham, North Carolina. * All Rights Reserved. * * 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 * * Authors: * Steve Grubb * */ #ifndef AUDISPD_CONFIG_H #define AUDISPD_CONFIG_H #include "auditd-config.h" typedef struct disp_conf { unsigned int q_depth; overflow_action_t overflow_action; unsigned int max_restarts; char *plugin_dir; } daemon_conf_t; #endif audit-4.0.2/audisp/audispd-pconfig.c0000644001034500103450000003031114655201403013007 /* audispd-pconfig.c -- * Copyright 2007,2010,2015,2021-23 Red Hat Inc. * All Rights Reserved. * * This software may be freely redistributed and/or modified 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, Inc., 51 Franklin Street, Fifth Floor * Boston, MA 02110-1335, USA. * * Authors: * Steve Grubb * */ #include "config.h" #include #include #include #include #include #include #include #include #include "audispd-pconfig.h" #include "private.h" /* Local prototypes */ struct nv_pair { const char *name; char **values; int nvalues; }; struct kw_pair { const char *name; int (*parser)(struct nv_pair *, int, plugin_conf_t *); int max_options; /* -1 means any number of options */ }; struct nv_list { const char *name; int option; }; static char *get_line(FILE *f, char *buf, unsigned size, int *lineno, const char *file) __attr_access ((__write_only__, 2, 3)); static void nv_free(struct nv_pair *nv); static int nv_split(char *buf, struct nv_pair *nv); static const struct kw_pair *kw_lookup(const char *val); static int active_parser(struct nv_pair *nv, int line, plugin_conf_t *config); static int direction_parser(struct nv_pair *nv, int line, plugin_conf_t *config); static int path_parser(struct nv_pair *nv, int line, plugin_conf_t *config); static int service_type_parser(struct nv_pair *nv, int line, plugin_conf_t *config); static int args_parser(struct nv_pair *nv, int line, plugin_conf_t *config); static int format_parser(struct nv_pair *nv, int line, plugin_conf_t *config); static int sanity_check(plugin_conf_t *config, const char *file); static const struct kw_pair keywords[] = { {"active", active_parser, 0 }, {"direction", direction_parser, 0 }, {"path", path_parser, 0 }, {"type", service_type_parser, 0 }, {"args", args_parser, -1 }, {"format", format_parser, 0 }, { NULL, NULL, 0 } }; static const struct nv_list active[] = { {"yes", A_YES }, {"no", A_NO }, { NULL, 0 } }; static const struct nv_list directions[] = { // {"in", D_IN }, FIXME: not supported yet {"out", D_OUT }, { NULL, 0 } }; static const struct nv_list service_type[] = { {"builtin", S_BUILTIN }, {"always", S_ALWAYS }, { NULL, 0 } }; static const struct nv_list formats[] = { {"binary", F_BINARY }, {"string", F_STRING }, { NULL, 0 } }; /* * Set everything to its default value */ void clear_pconfig(plugin_conf_t *config) { config->active = A_NO; config->direction = D_UNSET; config->path = NULL; config->type = S_ALWAYS; config->args = NULL; config->nargs = 0; config->format = F_STRING; config->plug_pipe[0] = -1; config->plug_pipe[1] = -1; config->pid = 0; config->inode = 0; config->checked = 0; config->name = NULL; config->restart_cnt = 0; } int load_pconfig(plugin_conf_t *config, char *file) { int fd, rc, mode, lineno = 1; struct stat st; FILE *f; char buf[160]; clear_pconfig(config); /* open the file */ mode = O_RDONLY; rc = open(file, mode); if (rc < 0) { if (errno != ENOENT) { audit_msg(LOG_ERR, "Error opening %s (%s)", file, strerror(errno)); return 1; } audit_msg(LOG_WARNING, "Config file %s doesn't exist, skipping", file); return 0; } fd = rc; /* check the file's permissions: owned by root, not world writable, * not symlink. */ if (fstat(fd, &st) < 0) { audit_msg(LOG_ERR, "Error fstat'ing config file (%s)", strerror(errno)); close(fd); return 1; } if (st.st_uid != 0) { audit_msg(LOG_ERR, "Error - %s isn't owned by root", file); close(fd); return 1; } if ((st.st_mode & S_IWOTH) == S_IWOTH) { audit_msg(LOG_ERR, "Error - %s is world writable", file); close(fd); return 1; } if (!S_ISREG(st.st_mode)) { audit_msg(LOG_ERR, "Error - %s is not a regular file", file); close(fd); return 1; } /* it's ok, read line by line */ f = fdopen(fd, "rm"); if (f == NULL) { audit_msg(LOG_ERR, "Error - fdopen failed (%s)", strerror(errno)); close(fd); return 1; } while (get_line(f, buf, sizeof(buf), &lineno, file)) { // convert line into name-value pair const struct kw_pair *kw; struct nv_pair nv; rc = nv_split(buf, &nv); switch (rc) { case 0: // fine break; case 1: // not the right number of tokens. audit_msg(LOG_ERR, "Wrong number of arguments for line %d in %s", lineno, file); break; case 2: // no '=' sign audit_msg(LOG_ERR, "Missing equal sign for line %d in %s", lineno, file); break; default: // something else went wrong... audit_msg(LOG_ERR, "Unknown error for line %d in %s", lineno, file); break; } if (nv.name == NULL) { lineno++; continue; } if (nv.values == NULL) { fclose(f); return 1; } /* identify keyword or error */ kw = kw_lookup(nv.name); if (kw->name == NULL) { audit_msg(LOG_ERR, "Unknown keyword \"%s\" in line %d of %s", nv.name, lineno, file); fclose(f); return 1; } /* Check number of options * nv.nvalues is always >= 1, because that's the right part of a 'key = value' conf line */ const int noptions = nv.nvalues - 1; if (kw->max_options != -1 && kw->max_options < noptions) { audit_msg(LOG_ERR, "Keyword \"%s\" has invalid options " "in line %d of %s", nv.name, lineno, file); fclose(f); return 1; } /* dispatch to keyword's local parser */ rc = kw->parser(&nv, lineno, config); if (rc != 0) { fclose(f); return 1; // local parser puts message out } nv_free(&nv); lineno++; } fclose(f); config->name = strdup(basename(file)); if (lineno > 1) return sanity_check(config, file); return 0; } static char *get_line(FILE *f, char *buf, unsigned size, int *lineno, const char *file) { int too_long = 0; while (fgets_unlocked(buf, size, f)) { /* remove newline */ char *ptr = strchr(buf, 0x0a); if (ptr) { if (!too_long) { *ptr = 0; return buf; } // Reset and start with the next line too_long = 0; *lineno = *lineno + 1; } else { // If a line is too long skip it. // Only output 1 warning if (!too_long) audit_msg(LOG_ERR, "Skipping line %d in %s: too long", *lineno, file); too_long = 1; } } return NULL; } static void nv_free(struct nv_pair *nv) { free(nv->values); } static int nv_split(char *buf, struct nv_pair *nv) { /* Get the name part */ char *ptr, *saved; nv->name = NULL; nv->values = NULL; nv->nvalues = 0; ptr = strtok_r(buf, " ", &saved); if (ptr == NULL) return 0; /* If there's nothing, go to next line */ if (ptr[0] == '#') return 0; /* If there's a comment, go to next line */ nv->name = ptr; /* Check for a '=' */ ptr = strtok_r(NULL, " ", &saved); if (ptr == NULL) return 1; if (strcmp(ptr, "=") != 0) return 2; /* get the value part */ while ((ptr = strtok_r(NULL, " ", &saved)) != NULL) { nv->values = realloc(nv->values, (nv->nvalues + 1) * sizeof(char *)); if (nv->values == NULL) { return 1; } nv->values[nv->nvalues++] = ptr; } /* Check if at least 1 value was present */ if (nv->values == NULL) return 1; /* Everything is OK */ return 0; } static const struct kw_pair *kw_lookup(const char *val) { int i = 0; while (keywords[i].name != NULL) { if (strcasecmp(keywords[i].name, val) == 0) break; i++; } return &keywords[i]; } static int active_parser(struct nv_pair *nv, int line, plugin_conf_t *config) { int i; for (i=0; active[i].name != NULL; i++) { if (strcasecmp(nv->values[0], active[i].name) == 0) { config->active = active[i].option; return 0; } } audit_msg(LOG_ERR, "Option %s not found - line %d", nv->values[0], line); return 1; } static int direction_parser(struct nv_pair *nv, int line, plugin_conf_t *config) { int i; for (i=0; directions[i].name != NULL; i++) { if (strcasecmp(nv->values[0], directions[i].name) == 0) { config->direction = directions[i].option; return 0; } } audit_msg(LOG_ERR, "Option %s not found - line %d", nv->values[0], line); return 1; } static const char *BUILTIN_PATH="/sbin/audisp-af_unix"; static int path_parser(struct nv_pair *nv, int line, plugin_conf_t *config) { char *dir = NULL, *tdir; if (nv->values == NULL) { config->path = NULL; return 0; } if (strncasecmp(nv->values[0], "builtin_", 8) == 0) { audit_msg(LOG_WARNING, "Option %s line %d is obsolete - using %s", nv->values[0], line, BUILTIN_PATH); config->path = strdup(BUILTIN_PATH); return 0; } /* get dir form name. */ tdir = strdup(nv->values[0]); if (tdir) dir = dirname(tdir); if (dir == NULL || strlen(dir) < 4) { // '/var' is shortest dirname audit_msg(LOG_ERR, "The directory name: %s is too short - line %d", dir, line); free(tdir); return 1; } free((void *)tdir); free((void *)config->path); config->path = strdup(nv->values[0]); if (config->path == NULL) return 1; return 0; } static int service_type_parser(struct nv_pair *nv, int line, plugin_conf_t *config) { int i; for (i=0; service_type[i].name != NULL; i++) { if (strcasecmp(nv->values[0], service_type[i].name) == 0) { config->type = service_type[i].option; if (config->type == S_BUILTIN) { audit_msg(LOG_WARNING, "Option %s line %d is obsolete - update it", nv->values[0], line); config->type = S_ALWAYS; } return 0; } } audit_msg(LOG_ERR, "Option %s not found - line %d", nv->values[0], line); return 1; } static int args_parser(struct nv_pair *nv, int line, plugin_conf_t *config) { config->args = calloc(nv->nvalues, sizeof(char *)); config->nargs = nv->nvalues; for (int i = 0; i < nv->nvalues; i++) { config->args[i] = strdup(nv->values[nv->nvalues - i - 1]); } return 0; } static int format_parser(struct nv_pair *nv, int line, plugin_conf_t *config) { int i; for (i=0; formats[i].name != NULL; i++) { if (strcasecmp(nv->values[0], formats[i].name) == 0) { config->format = formats[i].option; return 0; } } audit_msg(LOG_ERR, "Option %s not found - line %d", nv->values[0], line); return 1; } /* * This function is where we do the integrated check of the audispd config * options. At this point, all fields have been read. Returns 0 if no * problems and 1 if problems detected. */ static int sanity_check(plugin_conf_t *config, const char *file) { /* Error checking */ if (config->active == A_YES) { struct stat buf; if (config->path == NULL) { audit_msg(LOG_ERR, "Error - plugin (%s) is active but no path given", file); return 1; } // Don't check builtins if (strncasecmp(config->path, "builtin_", 8) == 0) goto out; /* If the file exists, see that its regular, owned by root, * and not world anything */ if (stat(config->path, &buf) < 0) { audit_msg(LOG_ERR, "Unable to stat %s (%s)", config->path, strerror(errno)); return 1; } if (!S_ISREG(buf.st_mode)) { audit_msg(LOG_ERR, "%s is not a regular file", config->path); return 1; } if (buf.st_uid != 0) { audit_msg(LOG_ERR, "%s is not owned by root", config->path); return 1; } if ((buf.st_mode & (S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP)) != (S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP)) { audit_msg(LOG_ERR, "%s permissions should be 0750", config->path); return 1; } // Passes, record inode config->inode = buf.st_ino; } out: return 0; } void free_pconfig(plugin_conf_t *config) { int i; if (config == NULL) return; for (i = 0; i < config->nargs; i++) { free(config->args[i]); } free(config->args); if (config->plug_pipe[0] >= 0) close(config->plug_pipe[0]); if (config->plug_pipe[1] >= 0) close(config->plug_pipe[1]); free((void *)config->path); free((void *)config->name); } audit-4.0.2/audisp/audispd.c0000644001034500103450000003610514655201403011373 /* audispd.c -- * Copyright 2007-08,2013,2016-23 Red Hat Inc. * All Rights Reserved. * * This software may be freely redistributed and/or modified 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, Inc., 51 Franklin Street, Fifth Floor * Boston, MA 02110-1335, USA. * * Authors: * Steve Grubb */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_ATOMIC #include #endif #include "audispd-pconfig.h" #include "audispd-config.h" #include "audispd-llist.h" #include "queue.h" #include "libaudit.h" #include "private.h" /* Global Data */ static volatile ATOMIC_INT stop = 0; volatile ATOMIC_INT disp_hup = 0; /* Local data */ static daemon_conf_t daemon_config; static conf_llist plugin_conf; static pthread_t outbound_thread; static int need_queue_depth_change = 0; /* Local function prototypes */ static void signal_plugins(int sig); static int event_loop(void); static int safe_exec(plugin_conf_t *conf); static void *outbound_thread_main(void *arg); static int write_to_plugin(event_t *e, const char *string, size_t string_len, lnode *conf) __attr_access ((__read_only__, 2, 3)); /* * Handle child plugins when they exit */ void plugin_child_handler(pid_t pid) { if (pid > 0) { // Mark the child pid as 0 in the configs lnode *tpconf; plist_first(&plugin_conf); tpconf = plist_get_cur(&plugin_conf); while (tpconf) { if (tpconf->p && tpconf->p->pid == pid) { tpconf->p->pid = 0; break; } tpconf = plist_next(&plugin_conf); } } } static int count_dots(const char *s) { const char *ptr; int cnt = 0; while ((ptr = strchr(s, '.'))) { cnt++; s = ptr + 1; } return cnt; } static void load_plugin_conf(conf_llist *plugin) { DIR *d; /* init plugin list */ plist_create(plugin); /* read configs */ d = opendir(daemon_config.plugin_dir); if (d) { struct dirent *e; while ((e = readdir(d))) { plugin_conf_t config; char fname[PATH_MAX]; // Don't run backup files, hidden files, or dirs if (e->d_name[0] == '.' || count_dots(e->d_name) > 1) continue; snprintf(fname, sizeof(fname), "%s/%s", daemon_config.plugin_dir, e->d_name); clear_pconfig(&config); if (load_pconfig(&config, fname) == 0) { /* Push onto config list only if active */ if (config.active == A_YES) plist_append(plugin, &config); else free_pconfig(&config); } else audit_msg(LOG_ERR, "Skipping %s plugin due to errors", e->d_name); } closedir(d); } } static int start_one_plugin(lnode *conf) { if (conf->p->restart_cnt > daemon_config.max_restarts) return 1; if (conf->p->type == S_ALWAYS) { if (safe_exec(conf->p)) { audit_msg(LOG_ERR, "Error running %s (%s) continuing without it", conf->p->path, strerror(errno)); conf->p->active = A_NO; return 0; } /* Close the parent's read side */ close(conf->p->plug_pipe[0]); conf->p->plug_pipe[0] = -1; /* Avoid leaking descriptor */ fcntl(conf->p->plug_pipe[1], F_SETFD, FD_CLOEXEC); } return 1; } static int start_plugins(conf_llist *plugin) { /* spawn children */ lnode *conf; int active = 0; plist_first(plugin); conf = plist_get_cur(plugin); if (conf == NULL || conf->p == NULL) return active; do { if (conf->p && conf->p->active == A_YES) { if (start_one_plugin(conf)) active++; } } while ((conf = plist_next(plugin))); return active; } static void copy_config(const struct daemon_conf *c) { if (c->q_depth > daemon_config.q_depth) need_queue_depth_change = 1; daemon_config.q_depth = c->q_depth; daemon_config.overflow_action = c->overflow_action; daemon_config.max_restarts = c->max_restarts; if (daemon_config.plugin_dir == NULL) daemon_config.plugin_dir = c->plugin_dir ? strdup(c->plugin_dir) : NULL; else if (daemon_config.plugin_dir && c->plugin_dir && strcmp(daemon_config.plugin_dir, c->plugin_dir)) { free(daemon_config.plugin_dir); daemon_config.plugin_dir = strdup(c->plugin_dir); } // else c->plugin_dir is NULL or they are the same // Either way, let's leave them alone. } static int reconfigure(void) { conf_llist tmp_plugin; lnode *tpconf; if (need_queue_depth_change) { need_queue_depth_change = 0; increase_queue_depth(daemon_config.q_depth); } reset_suspended(); /* The idea for handling SIGHUP to children goes like this: * 1) load the current config in temp list * 2) mark all in real list unchecked * 3) for each one in tmp list, scan old list * 4) if new, start it, append to list, mark done * 5) else check if there was a change to active state * 6) if so, copy config over and start * 7) If no change, send sighup to non-builtins and mark done * 8) Finally, scan real list for unchecked, terminate and deactivate */ load_plugin_conf(&tmp_plugin); plist_mark_all_unchecked(&plugin_conf); plist_first(&tmp_plugin); tpconf = plist_get_cur(&tmp_plugin); while (tpconf && tpconf->p) { lnode *opconf; opconf = plist_find_name(&plugin_conf, tpconf->p->name); if (opconf == NULL) { /* We have a new service */ if (tpconf->p->active == A_YES) { tpconf->p->checked = 1; plist_last(&plugin_conf); plist_append(&plugin_conf, tpconf->p); free(tpconf->p); tpconf->p = NULL; start_one_plugin(plist_get_cur(&plugin_conf)); } } else { if (opconf->p->active == tpconf->p->active) { /* If active and no state change, sighup it */ if (opconf->p->type == S_ALWAYS && opconf->p->active == A_YES) { if (opconf->p->inode==tpconf->p->inode){ if (opconf->p->pid) kill(opconf->p->pid, SIGHUP); } else { /* Binary changed, restart */ audit_msg(LOG_INFO, "Restarting %s since binary changed", opconf->p->path); if (opconf->p->pid) kill(opconf->p->pid, SIGTERM); usleep(50000); // 50 msecs close(opconf->p->plug_pipe[1]); opconf->p->plug_pipe[1] = -1; opconf->p->pid = 0; start_one_plugin(opconf); opconf->p->inode = tpconf->p->inode; } } opconf->p->checked = 1; } else { /* A change in state */ if (tpconf->p->active == A_YES) { /* starting - copy config and exec */ free_pconfig(opconf->p); free(opconf->p); opconf->p = tpconf->p; opconf->p->checked = 1; start_one_plugin(opconf); tpconf->p = NULL; } } } tpconf = plist_next(&tmp_plugin); } /* Now see what's left over */ while ( (tpconf = plist_find_unchecked(&plugin_conf)) ) { /* Anything not checked is something removed from the config */ tpconf->p->active = A_NO; audit_msg(LOG_INFO, "Terminating %s because its now inactive", tpconf->p->path); if (tpconf->p->type == S_ALWAYS) { if (tpconf->p->pid) kill(tpconf->p->pid, SIGTERM); close(tpconf->p->plug_pipe[1]); } tpconf->p->plug_pipe[1] = -1; tpconf->p->pid = 0; tpconf->p->checked = 1; } /* Release memory from temp config */ plist_first(&tmp_plugin); tpconf = plist_get_cur(&tmp_plugin); while (tpconf) { free_pconfig(tpconf->p); tpconf = plist_next(&tmp_plugin); } plist_clear(&tmp_plugin); return plist_count_active(&plugin_conf); } /* * Return 0 on success and 1 on failure * * Call tree: auditd.c main * auditd-dispatch.c init_dispatcher * * And: auditd-event.c reconfigure * auditd-dispatch.c reconfigure_dispatcher * * */ int libdisp_init(const struct daemon_conf *c) { int i; /* Init the dispatcher's config */ copy_config(c); /* Load all plugin configs */ load_plugin_conf(&plugin_conf); /* If no plugins - exit */ if (plist_count(&plugin_conf) == 0) { free(daemon_config.plugin_dir); daemon_config.plugin_dir = NULL; audit_msg(LOG_NOTICE, "No plugins found, not dispatching events"); return 0; } /* Plugins are started with the auditd priority */ i = start_plugins(&plugin_conf); /* Let the queue initialize */ init_queue(daemon_config.q_depth); audit_msg(LOG_INFO, "audit dispatcher initialized with q_depth=%d and %d active plugins", daemon_config.q_depth, i); /* Create outbound thread */ pthread_create(&outbound_thread, NULL, outbound_thread_main, NULL); pthread_detach(outbound_thread); return 0; } /* outbound thread - dequeue data to plugins */ static void *outbound_thread_main(void *arg) { lnode *conf; sigset_t sigs; /* This is a worker thread. Don't handle signals. */ sigemptyset(&sigs); sigaddset(&sigs, SIGTERM); sigaddset(&sigs, SIGHUP); sigaddset(&sigs, SIGUSR1); sigaddset(&sigs, SIGUSR2); sigaddset(&sigs, SIGCHLD); sigaddset(&sigs, SIGCONT); pthread_sigmask(SIG_SETMASK, &sigs, NULL); /* Start event loop */ while (event_loop()) { if (reconfigure() == 0) { audit_msg(LOG_INFO, "After reconfigure, there are no active plugins, exiting"); break; } disp_hup = 0; } /* Tell plugins we are going down */ signal_plugins(SIGTERM); /* Release configs */ plist_first(&plugin_conf); conf = plist_get_cur(&plugin_conf); while (conf) { free_pconfig(conf->p); conf = plist_next(&plugin_conf); } plist_clear(&plugin_conf); /* Cleanup the queue */ destroy_queue(); free(daemon_config.plugin_dir); daemon_config.plugin_dir = NULL; audit_msg(LOG_DEBUG, "Finished cleaning up dispatcher"); return 0; } static int safe_exec(plugin_conf_t *conf) { char **argv; int pid, i; /* Set up IPC with child */ if (socketpair(AF_UNIX, SOCK_STREAM, 0, conf->plug_pipe) != 0) return -1; pid = fork(); if (pid > 0) { conf->pid = pid; return 0; /* Parent...normal exit */ } if (pid < 0) { close(conf->plug_pipe[0]); close(conf->plug_pipe[1]); conf->pid = 0; return -1; /* Failed to fork */ } /* Set up comm with child */ if (dup2(conf->plug_pipe[0], 0) < 0) { close(conf->plug_pipe[0]); close(conf->plug_pipe[1]); conf->pid = 0; return -1; /* Failed to fork */ } for (i=3; i<24; i++) /* Arbitrary number */ close(i); argv = calloc(conf->nargs + 2, sizeof(char *)); if (argv == NULL) { return -1; } /* Child */ argv[0] = (char *)conf->path; for (i = 0; i < conf->nargs; i++) { argv[i+1] = conf->args[conf->nargs-i-1]; } argv[conf->nargs+1] = NULL; execve(conf->path, argv, NULL); exit(1); /* Failed to exec */ } static void signal_plugins(int sig) { lnode *conf; plist_first(&plugin_conf); conf = plist_get_cur(&plugin_conf); while (conf) { if (conf->p && conf->p->pid && conf->p->type == S_ALWAYS) kill(conf->p->pid, sig); conf = plist_next(&plugin_conf); } } static int write_to_plugin(event_t *e, const char *string, size_t string_len, lnode *conf) { int rc; if (conf->p->format == F_STRING) { do { rc = write(conf->p->plug_pipe[1], string, string_len); } while (rc < 0 && errno == EINTR); } else { struct iovec vec[2]; vec[0].iov_base = &e->hdr; vec[0].iov_len = sizeof(struct audit_dispatcher_header); vec[1].iov_base = e->data; vec[1].iov_len = MAX_AUDIT_MESSAGE_LENGTH; do { rc = writev(conf->p->plug_pipe[1], vec, 2); } while (rc < 0 && errno == EINTR); } return rc; } /* Returns 0 on stop, and 1 on HUP */ static int event_loop(void) { /* Figure out the format for the af_unix socket */ while (stop == 0) { event_t *e; char *v, *ptr, unknown[32]; int len; lnode *conf; /* This is where we block until we have an event */ e = dequeue(); if (e == NULL) { if (disp_hup) return 1; continue; } // Protocol 1 is not formatted if (e->hdr.ver == AUDISP_PROTOCOL_VER) { const char *type; /* Get the event formatted */ type = audit_msg_type_to_name(e->hdr.type); if (type == NULL) { snprintf(unknown, sizeof(unknown), "UNKNOWN[%u]", e->hdr.type); type = unknown; } len = asprintf(&v, "type=%s msg=%.*s\n", type, e->hdr.size, e->data); // Protocol 2 events are already formatted } else if (e->hdr.ver == AUDISP_PROTOCOL_VER2) { len = asprintf(&v, "%.*s\n", e->hdr.size, e->data); } else len = 0; if (len <= 0) { v = NULL; free(e); /* Either corrupted event or no memory */ continue; } /* Strip newlines from event record */ ptr = v; while ((ptr = strchr(ptr, 0x0A)) != NULL) { if (ptr != &v[len-1]) *ptr = ' '; else break; /* Done - exit loop */ } /* Distribute event to the plugins */ plist_first(&plugin_conf); conf = plist_get_cur(&plugin_conf); do { if (conf == NULL || conf->p == NULL) continue; if (conf->p->active == A_NO || stop) continue; /* Now send the event to the child */ if (conf->p->type == S_ALWAYS && !stop) { int rc; rc = write_to_plugin(e, v, len, conf); if (rc < 0 && errno == EPIPE) { /* Child disappeared ? */ if (!stop) audit_msg(LOG_ERR, "plugin %s terminated unexpectedly", conf->p->path); conf->p->pid = 0; conf->p->restart_cnt++; close(conf->p->plug_pipe[1]); conf->p->plug_pipe[1] = -1; conf->p->active = A_NO; if (!stop && conf->p->restart_cnt > daemon_config.max_restarts) { audit_msg(LOG_ERR, "plugin %s has exceeded max_restarts", conf->p->path); } if (!stop && start_one_plugin(conf)) { rc = write_to_plugin(e, v, len, conf); audit_msg(LOG_NOTICE, "plugin %s was restarted", conf->p->path); conf->p->active = A_YES; } } } } while (!stop && (conf = plist_next(&plugin_conf))); /* Done with the memory...release it */ free(v); free(e); if (disp_hup) break; } audit_msg(LOG_DEBUG, "Dispatcher event loop exit"); if (stop) return 0; else return 1; } /* returns > 0 if plugins and 0 if none */ int libdisp_active(void) { // If there's no plugins, the other thread is dead return plist_count(&plugin_conf); } /* returns 0 on success and -1 on error */ int libdisp_enqueue(event_t *e) { return enqueue(e, &daemon_config); } void libdisp_nudge_queue(void) { // Only nudge if there is something to nudge if (plist_count(&plugin_conf)) nudge_queue(); } /* * Called by: auditd-event.c reconfigure * auditd-dispatch.c reconfigure_dispatcher */ void libdisp_reconfigure(const struct daemon_conf *c) { // If the dispatcher thread is dead, start a new one if (plist_count(&plugin_conf) == 0) libdisp_init(c); else { // Otherwise we do a reconfigure copy_config(c); disp_hup = 1; nudge_queue(); } } void libdisp_write_queue_state(FILE *f) { fprintf(f, "Number of active plugins = %u\n", plist_count(&plugin_conf)); write_queue_state(f); } void libdisp_resume(void) { resume_queue(); } /* Used during startup and something failed */ void libdisp_shutdown(void) { stop = 1; libdisp_nudge_queue(); } audit-4.0.2/audisp/queue.h0000644001034500103450000000244014655201403011066 /* queue.h -- * Copyright 2007,2018 Red Hat Inc., Durham, North Carolina. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb */ #ifndef QUEUE_HEADER #define QUEUE_HEADER #include #include "libdisp.h" #include "audispd-config.h" void reset_suspended(void); int init_queue(unsigned int size); int enqueue(event_t *e, struct disp_conf *config); event_t *dequeue(void); void nudge_queue(void); void increase_queue_depth(unsigned int size); void write_queue_state(FILE *f); void resume_queue(void); void destroy_queue(void); #endif audit-4.0.2/audisp/queue.c0000644001034500103450000001551014655201403011063 /* queue.c -- * Copyright 2007,2013,2015,2018,2022 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb */ #include "config.h" #include #include #include #include #ifdef HAVE_ATOMIC #include #endif #include "queue.h" static volatile event_t **q; static pthread_mutex_t queue_lock; static pthread_cond_t queue_nonempty; static unsigned int q_next, q_last, q_depth, processing_suspended, overflowed; static ATOMIC_UNSIGNED currently_used, max_used; static const char *SINGLE = "1"; static const char *HALT = "0"; static int queue_full_warning = 0; extern volatile ATOMIC_INT disp_hup; #define QUEUE_FULL_LIMIT 5 void reset_suspended(void) { processing_suspended = 0; queue_full_warning = 0; } int init_queue(unsigned int size) { // The global variables are initialized to zero by the // compiler. We can sometimes get here by a reconfigure. // If the queue was already initialized, q_depth will be // non-zero. In that case, leave everything alone. If the // queue was destroyed due to lack of plugins, q_depth, // as well as other queue variables, is set to zero so // they do not need reinitializing. if (q_depth == 0) { unsigned int i; q_depth = size; q = malloc(q_depth * sizeof(event_t *)); if (q == NULL) { processing_suspended = 1; return -1; } for (i=0; i < q_depth; i++) q[i] = NULL; /* Setup IPC mechanisms */ pthread_mutex_init(&queue_lock, NULL); pthread_cond_init(&queue_nonempty, NULL); reset_suspended(); } return 0; } static void change_runlevel(const char *level) { char *argv[3]; int pid; static const char *init_pgm = "/sbin/init"; pid = fork(); if (pid < 0) { syslog(LOG_ALERT, "Audispd failed to fork switching runlevels"); return; } if (pid) /* Parent */ return; /* Child */ argv[0] = (char *)init_pgm; argv[1] = (char *)level; argv[2] = NULL; execve(init_pgm, argv, NULL); syslog(LOG_ALERT, "Audispd failed to exec %s", init_pgm); exit(1); } static int do_overflow_action(struct disp_conf *config) { int rc = -1; overflowed = 1; switch (config->overflow_action) { case O_IGNORE: rc = 0; break; case O_SYSLOG: if (queue_full_warning < QUEUE_FULL_LIMIT) { syslog(LOG_ERR, "queue to plugins is full - dropping event"); queue_full_warning++; if (queue_full_warning == QUEUE_FULL_LIMIT) syslog(LOG_ERR, "auditd queue full reporting " "limit reached - ending " "dropped event notifications"); } break; case O_SUSPEND: syslog(LOG_ALERT, "Auditd is suspending event passing to plugins due to overflowing its queue."); processing_suspended = 1; break; case O_SINGLE: syslog(LOG_ALERT, "Auditd is now changing the system to single user mode due to overflowing its queue"); change_runlevel(SINGLE); break; case O_HALT: syslog(LOG_ALERT, "Auditd is now halting the system due to overflowing its queue"); change_runlevel(HALT); break; default: syslog(LOG_ALERT, "Unknown overflow action requested"); break; } return rc; } /* returns 0 on success and -1 on error */ int enqueue(event_t *e, struct disp_conf *config) { unsigned int n, retry_cnt = 0; if (processing_suspended) { free(e); return 0; } retry: // We allow 3 retries and then its over if (retry_cnt > 3) { free(e); return do_overflow_action(config); } pthread_mutex_lock(&queue_lock); // OK, have lock add event n = q_next%q_depth; if (q[n] == NULL) { q[n] = e; q_next = (n+1) % q_depth; currently_used++; if (currently_used > max_used) max_used = currently_used; pthread_cond_signal(&queue_nonempty); pthread_mutex_unlock(&queue_lock); } else { pthread_mutex_unlock(&queue_lock); struct timespec ts; ts.tv_sec = 0; ts.tv_nsec = 2 * 1000 * 1000; // 2 milliseconds nanosleep(&ts, NULL); /* Let other thread try to log it. */ retry_cnt++; goto retry; } return 0; } event_t *dequeue(void) { event_t *e; unsigned int n; // Wait until its got something in it pthread_mutex_lock(&queue_lock); if (disp_hup) { pthread_mutex_unlock(&queue_lock); return NULL; } n = q_last%q_depth; if (q[n] == NULL) { pthread_cond_wait(&queue_nonempty, &queue_lock); if (disp_hup) { pthread_mutex_unlock(&queue_lock); return NULL; } n = q_last%q_depth; } // OK, grab the next event if (q[n] != NULL) { e = (event_t *)q[n]; q[n] = NULL; q_last = (n+1) % q_depth; } else e = NULL; currently_used--; pthread_mutex_unlock(&queue_lock); // Process the event return e; } void nudge_queue(void) { pthread_cond_signal(&queue_nonempty); } void increase_queue_depth(unsigned int size) { pthread_mutex_lock(&queue_lock); if (size > q_depth) { unsigned int i; void *tmp_q; tmp_q = realloc(q, size * sizeof(event_t *)); if (tmp_q == NULL) { fprintf(stderr, "Out of Memory. Check %s file, %d line", __FILE__, __LINE__); pthread_mutex_unlock(&queue_lock); return; } q = tmp_q; for (i=q_depth; i */ #ifndef AUDISP_LIST_HEADER #define AUDISP_LIST_HEADER #include "config.h" #include #include "audispd-pconfig.h" /* This is the node of the linked list. message & item are the only elements * at this time. Any data elements that are per item goes here. */ typedef struct _lnode{ plugin_conf_t *p; // The rule from the kernel struct _lnode *next; // Next node pointer } lnode; /* This is the linked list head. Only data elements that are 1 per * event goes here. */ typedef struct { lnode *head; // List head lnode *cur; // Pointer to current node unsigned int cnt; // How many items in this list } conf_llist; void plist_create(conf_llist *l); static inline void plist_first(conf_llist *l) { l->cur = l->head; } static inline unsigned int plist_count(conf_llist *l) { return l->cnt; } unsigned int plist_count_active(const conf_llist *l); void plist_last(conf_llist *l); lnode *plist_next(conf_llist *l); static inline lnode *plist_get_cur(conf_llist *l) { return l->cur; } int plist_append(conf_llist *l, plugin_conf_t *p); void plist_clear(conf_llist* l); void plist_mark_all_unchecked(conf_llist* l); lnode *plist_find_unchecked(conf_llist* l); lnode *plist_find_name(conf_llist* l, const char *name); #endif audit-4.0.2/audisp/Makefile.in0000644001034500103450000007265714655201422011660 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am-- # Copyright 2007,2011,2015-23 Red Hat Inc. # All Rights Reserved. # # 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; see the file COPYING. If not, write to the # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor # Boston, MA 02110-1335, USA. # # Authors: # Steve Grubb # 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@ subdir = audisp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prog_cc_for_build.m4 \ $(top_srcdir)/m4/cap-ng.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/src/libev/libev.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libdisp_la_LIBADD = am_libdisp_la_OBJECTS = libdisp_la-audispd.lo \ libdisp_la-audispd-pconfig.lo libdisp_la-queue.lo \ libdisp_la-audispd-llist.lo libdisp_la_OBJECTS = $(am_libdisp_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libdisp_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libdisp_la_CFLAGS) \ $(CFLAGS) $(libdisp_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libdisp_la-audispd-llist.Plo \ ./$(DEPDIR)/libdisp_la-audispd-pconfig.Plo \ ./$(DEPDIR)/libdisp_la-audispd.Plo \ ./$(DEPDIR)/libdisp_la-queue.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libdisp_la_SOURCES) DIST_SOURCES = $(libdisp_la_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILD_EXEEXT = @BUILD_EXEEXT@ BUILD_OBJEXT = @BUILD_OBJEXT@ CAPNG_LDADD = @CAPNG_LDADD@ CAPNG_PKG = @CAPNG_PKG@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_FOR_BUILD = @CC_FOR_BUILD@ CFLAGS = @CFLAGS@ CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ CPP_FOR_BUILD = @CPP_FOR_BUILD@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG = @DEBUG@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GOLANG = @GOLANG@ GOROOT = @GOROOT@ 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@ LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ LIBOBJS = @LIBOBJS@ LIBS = ${top_builddir}/lib/libaudit.la LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBWRAP_LIBS = @LIBWRAP_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PYTHON = @PYTHON@ PYTHON3_CFLAGS = @PYTHON3_CFLAGS@ PYTHON3_INCLUDES = @PYTHON3_INCLUDES@ PYTHON3_LIBS = @PYTHON3_LIBS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ VERSION = @VERSION@ WFLAGS = @WFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CC_FOR_BUILD = @ac_ct_CC_FOR_BUILD@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gss_libs = @gss_libs@ 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@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ use_python3 = @use_python3@ SUBDIRS = plugins CONFIG_CLEAN_FILES = *.rej *.orig AM_CPPFLAGS = -D_GNU_SOURCE -fPIC -DPIC -I${top_srcdir} -I${top_srcdir}/lib -I${top_srcdir}/src -I${top_srcdir}/src/libev LDADD = -lpthread noinst_HEADERS = audispd-pconfig.h audispd-llist.h audispd-config.h \ queue.h libdisp.h libdisp_la_SOURCES = audispd.c audispd-pconfig.c queue.c \ audispd-llist.c libdisp_la_CFLAGS = -fno-strict-aliasing ${WFLAGS} libdisp_la_LDFLAGS = -no-undefined -static noinst_LTLIBRARIES = libdisp.la all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu audisp/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu audisp/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libdisp.la: $(libdisp_la_OBJECTS) $(libdisp_la_DEPENDENCIES) $(EXTRA_libdisp_la_DEPENDENCIES) $(AM_V_CCLD)$(libdisp_la_LINK) $(libdisp_la_OBJECTS) $(libdisp_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdisp_la-audispd-llist.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdisp_la-audispd-pconfig.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdisp_la-audispd.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdisp_la-queue.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< libdisp_la-audispd.lo: audispd.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdisp_la_CFLAGS) $(CFLAGS) -MT libdisp_la-audispd.lo -MD -MP -MF $(DEPDIR)/libdisp_la-audispd.Tpo -c -o libdisp_la-audispd.lo `test -f 'audispd.c' || echo '$(srcdir)/'`audispd.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdisp_la-audispd.Tpo $(DEPDIR)/libdisp_la-audispd.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='audispd.c' object='libdisp_la-audispd.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdisp_la_CFLAGS) $(CFLAGS) -c -o libdisp_la-audispd.lo `test -f 'audispd.c' || echo '$(srcdir)/'`audispd.c libdisp_la-audispd-pconfig.lo: audispd-pconfig.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdisp_la_CFLAGS) $(CFLAGS) -MT libdisp_la-audispd-pconfig.lo -MD -MP -MF $(DEPDIR)/libdisp_la-audispd-pconfig.Tpo -c -o libdisp_la-audispd-pconfig.lo `test -f 'audispd-pconfig.c' || echo '$(srcdir)/'`audispd-pconfig.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdisp_la-audispd-pconfig.Tpo $(DEPDIR)/libdisp_la-audispd-pconfig.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='audispd-pconfig.c' object='libdisp_la-audispd-pconfig.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdisp_la_CFLAGS) $(CFLAGS) -c -o libdisp_la-audispd-pconfig.lo `test -f 'audispd-pconfig.c' || echo '$(srcdir)/'`audispd-pconfig.c libdisp_la-queue.lo: queue.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdisp_la_CFLAGS) $(CFLAGS) -MT libdisp_la-queue.lo -MD -MP -MF $(DEPDIR)/libdisp_la-queue.Tpo -c -o libdisp_la-queue.lo `test -f 'queue.c' || echo '$(srcdir)/'`queue.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdisp_la-queue.Tpo $(DEPDIR)/libdisp_la-queue.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='queue.c' object='libdisp_la-queue.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdisp_la_CFLAGS) $(CFLAGS) -c -o libdisp_la-queue.lo `test -f 'queue.c' || echo '$(srcdir)/'`queue.c libdisp_la-audispd-llist.lo: audispd-llist.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdisp_la_CFLAGS) $(CFLAGS) -MT libdisp_la-audispd-llist.lo -MD -MP -MF $(DEPDIR)/libdisp_la-audispd-llist.Tpo -c -o libdisp_la-audispd-llist.lo `test -f 'audispd-llist.c' || echo '$(srcdir)/'`audispd-llist.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdisp_la-audispd-llist.Tpo $(DEPDIR)/libdisp_la-audispd-llist.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='audispd-llist.c' object='libdisp_la-audispd-llist.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdisp_la_CFLAGS) $(CFLAGS) -c -o libdisp_la-audispd-llist.lo `test -f 'audispd-llist.c' || echo '$(srcdir)/'`audispd-llist.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-recursive -rm -f ./$(DEPDIR)/libdisp_la-audispd-llist.Plo -rm -f ./$(DEPDIR)/libdisp_la-audispd-pconfig.Plo -rm -f ./$(DEPDIR)/libdisp_la-audispd.Plo -rm -f ./$(DEPDIR)/libdisp_la-queue.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f ./$(DEPDIR)/libdisp_la-audispd-llist.Plo -rm -f ./$(DEPDIR)/libdisp_la-audispd-pconfig.Plo -rm -f ./$(DEPDIR)/libdisp_la-audispd.Plo -rm -f ./$(DEPDIR)/libdisp_la-queue.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--depfiles check check-am clean clean-generic clean-libtool \ clean-noinstLTLIBRARIES cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: audit-4.0.2/audisp/Makefile.am0000644001034500103450000000255614655201403011635 # Makefile.am-- # Copyright 2007,2011,2015-23 Red Hat Inc. # All Rights Reserved. # # 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; see the file COPYING. If not, write to the # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor # Boston, MA 02110-1335, USA. # # Authors: # Steve Grubb # SUBDIRS = plugins CONFIG_CLEAN_FILES = *.rej *.orig AM_CPPFLAGS = -D_GNU_SOURCE -fPIC -DPIC -I${top_srcdir} -I${top_srcdir}/lib -I${top_srcdir}/src -I${top_srcdir}/src/libev LIBS = ${top_builddir}/lib/libaudit.la LDADD = -lpthread noinst_HEADERS = audispd-pconfig.h audispd-llist.h audispd-config.h \ queue.h libdisp.h libdisp_la_SOURCES = audispd.c audispd-pconfig.c queue.c \ audispd-llist.c libdisp_la_CFLAGS = -fno-strict-aliasing ${WFLAGS} libdisp_la_LDFLAGS = -no-undefined -static noinst_LTLIBRARIES = libdisp.la audit-4.0.2/audisp/audispd-llist.c0000644001034500103450000000603114655201403012513 /* * audispd-llist.c - Minimal linked list library * Copyright (c) 2007,2013 Red Hat Inc. * All Rights Reserved. * * This software may be freely redistributed and/or modified 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, Inc., 51 Franklin Street, Fifth Floor * Boston, MA 02110-1335, USA. * * Authors: * Steve Grubb */ #include "config.h" #include #include #include "audispd-llist.h" void plist_create(conf_llist *l) { l->head = NULL; l->cur = NULL; l->cnt = 0; } void plist_last(conf_llist *l) { register lnode* node; if (l->head == NULL) return; node = l->head; while (node->next) node = node->next; l->cur = node; } lnode *plist_next(conf_llist *l) { if (l->cur == NULL) return NULL; l->cur = l->cur->next; return l->cur; } unsigned int plist_count_active(const conf_llist *l) { register lnode* current; unsigned int cnt = 0; current = l->head; while (current) { if (current->p && current->p->active == A_YES) cnt++; current=current->next; } return cnt; } int plist_append(conf_llist *l, plugin_conf_t *p) { lnode* newnode; newnode = malloc(sizeof(lnode)); if (newnode == NULL) return 1; if (p) { void *pp = malloc(sizeof(struct plugin_conf)); if (pp) memcpy(pp, p, sizeof(struct plugin_conf)); newnode->p = pp; } else newnode->p = NULL; newnode->next = 0; // if we are at top, fix this up if (l->head == NULL) l->head = newnode; else // Otherwise add pointer to newnode l->cur->next = newnode; // make newnode current l->cur = newnode; l->cnt++; return 0; } void plist_clear(conf_llist* l) { lnode* nextnode; register lnode* current; current = l->head; while (current) { nextnode=current->next; free(current->p); free(current); current=nextnode; } l->head = NULL; l->cur = NULL; l->cnt = 0; } void plist_mark_all_unchecked(conf_llist* l) { register lnode* current; current = l->head; while (current) { if (current->p) current->p->checked = 0; current=current->next; } } lnode *plist_find_unchecked(conf_llist* l) { register lnode* current; current = l->head; while (current) { if (current->p && current->p->checked == 0) return current; current=current->next; } return NULL; } lnode *plist_find_name(conf_llist* l, const char *name) { register lnode* current; if (name == NULL) return NULL; current = l->head; while (current) { if (current->p && current->p->name) { if (strcmp(current->p->name, name) == 0) return current; } current=current->next; } return NULL; } audit-4.0.2/audisp/libdisp.h0000644001034500103450000000107714655201403011375 #ifndef LIBDISP_HEADERS #define LIBDISP_HEADERS #include #include "libaudit.h" #include "auditd-config.h" typedef struct event { struct audit_dispatcher_header hdr; char data[MAX_AUDIT_MESSAGE_LENGTH]; } event_t; int libdisp_init(const struct daemon_conf *config); void libdisp_shutdown(void); void libdisp_reconfigure(const struct daemon_conf *config); void plugin_child_handler(pid_t pid); int libdisp_enqueue(event_t *e); int libdisp_active(void); void libdisp_nudge_queue(void); void libdisp_write_queue_state(FILE *f); void libdisp_resume(void); #endif audit-4.0.2/audisp/audispd-pconfig.h0000644001034500103450000000364714655201403013030 /* audispd-pconfig.h -- * Copyright 2007,2013,2023 Red Hat Inc. * All Rights Reserved. * * This software may be freely redistributed and/or modified 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, Inc., 51 Franklin Street, Fifth Floor * Boston, MA 02110-1335, USA. * * Authors: * Steve Grubb */ #ifndef AUDISPD_PCONFIG_H #define AUDISPD_PCONFIG_H #include #include "libaudit.h" typedef enum { A_NO, A_YES } active_t; typedef enum { D_UNSET, D_IN, D_OUT } direction_t; typedef enum { S_ALWAYS, S_BUILTIN } service_t; typedef enum { F_BINARY, F_STRING } format_t; typedef struct plugin_conf { active_t active; /* Current state - active or not */ direction_t direction; /* in or out kind of plugin */ const char *path; /* path to binary */ service_t type; /* builtin or always */ char **args; /* args to be passed to plugin */ int nargs; format_t format; /* Event format */ int plug_pipe[2]; /* Communication pipe for events */ pid_t pid; /* Used to signal children */ ino_t inode; /* Use to see if new binary was installed */ int checked; /* Used for internal housekeeping on HUP */ char *name; /* Used to distinguish plugins for HUP */ unsigned restart_cnt; /* Number of times its crashed */ } plugin_conf_t; void clear_pconfig(plugin_conf_t *config); int load_pconfig(plugin_conf_t *config, char *file); void free_pconfig(plugin_conf_t *config); #endif audit-4.0.2/audisp/plugins/0000755001034500103450000000000014655201457011343 5audit-4.0.2/audisp/plugins/syslog/0000755001034500103450000000000014655201457012663 5audit-4.0.2/audisp/plugins/syslog/syslog.conf0000644001034500103450000000101114655201403014752 # This file controls the configuration of the syslog plugin. # It simply takes events and writes them to syslog. The # arguments provided can be the default priority that you # want the events written with. And optionally, you can give # a second argument indicating the facility that you want events # logged to. Valid options are LOG_LOCAL0 through 7, LOG_AUTH, # LOG_AUTHPRIV, LOG_DAEMON, LOG_SYSLOG, and LOG_USER. active = no direction = out path = /sbin/audisp-syslog type = always args = LOG_INFO format = string audit-4.0.2/audisp/plugins/syslog/audisp-syslog.c0000644001034500103450000001521614655201403015546 /* audisp-syslog.c -- * Copyright 2018 Red Hat Inc. * All Rights Reserved. * * 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 * * Authors: * Steve Grubb * */ #include "config.h" #include #include #include #include #include #include #include #ifdef HAVE_LIBCAP_NG #include #endif #include "libaudit.h" #include "common.h" #include "auparse.h" /* Global Data */ static volatile int stop = 0; static volatile int hup = 0; static int priority; static int interpret = 0; /* * SIGTERM handler */ static void term_handler( int sig ) { stop = 1; } /* * SIGHUP handler: re-read config */ static void hup_handler( int sig ) { hup = 1; } static void reload_config(void) { hup = 0; } static int init_syslog(int argc, const char *argv[]) { int i, facility = LOG_USER; priority = LOG_INFO; for (i = 1; i < argc; i++) { if (argv[i]) { if (strcasecmp(argv[i], "LOG_DEBUG") == 0) priority = LOG_DEBUG; else if (strcasecmp(argv[i], "LOG_INFO") == 0) priority = LOG_INFO; else if (strcasecmp(argv[i], "LOG_NOTICE") == 0) priority = LOG_NOTICE; else if (strcasecmp(argv[i], "LOG_WARNING") == 0) priority = LOG_WARNING; else if (strcasecmp(argv[i], "LOG_ERR") == 0) priority = LOG_ERR; else if (strcasecmp(argv[i], "LOG_CRIT") == 0) priority = LOG_CRIT; else if (strcasecmp(argv[i], "LOG_ALERT") == 0) priority = LOG_ALERT; else if (strcasecmp(argv[i], "LOG_EMERG") == 0) priority = LOG_EMERG; else if (strcasecmp(argv[i], "LOG_LOCAL0") == 0) facility = LOG_LOCAL0; else if (strcasecmp(argv[i], "LOG_LOCAL1") == 0) facility = LOG_LOCAL1; else if (strcasecmp(argv[i], "LOG_LOCAL2") == 0) facility = LOG_LOCAL2; else if (strcasecmp(argv[i], "LOG_LOCAL3") == 0) facility = LOG_LOCAL3; else if (strcasecmp(argv[i], "LOG_LOCAL4") == 0) facility = LOG_LOCAL4; else if (strcasecmp(argv[i], "LOG_LOCAL5") == 0) facility = LOG_LOCAL5; else if (strcasecmp(argv[i], "LOG_LOCAL6") == 0) facility = LOG_LOCAL6; else if (strcasecmp(argv[i], "LOG_LOCAL7") == 0) facility = LOG_LOCAL7; else if (strcasecmp(argv[i], "LOG_AUTH") == 0) facility = LOG_AUTH; else if (strcasecmp(argv[i], "LOG_AUTHPRIV") == 0) facility = LOG_AUTHPRIV; else if (strcasecmp(argv[i], "LOG_DAEMON") == 0) facility = LOG_DAEMON; else if (strcasecmp(argv[i], "LOG_SYSLOG") == 0) facility = LOG_SYSLOG; else if (strcasecmp(argv[i], "LOG_USER") == 0) facility = LOG_USER; else if (strcasecmp(argv[i], "interpret") == 0) interpret = 1; else { syslog(LOG_ERR, "Unknown log priority/facility %s", argv[i]); return 1; } } } syslog(LOG_INFO, "syslog plugin initialized with facility %d and priority %d", facility, priority); if (facility != LOG_USER) openlog("audispd", 0, facility); return 0; } static char *record = NULL; static inline void write_syslog(char *s) { if (interpret) { int rc, header = 0; char *mptr, tbuf[64]; // Setup record buffer if (record == NULL) record = malloc(MAX_AUDIT_MESSAGE_LENGTH); if (record == NULL) return; auparse_state_t *au = auparse_init(AUSOURCE_BUFFER, s); if (au == NULL) return; rc = auparse_first_record(au); // AUDIT_EOE has no fields - drop it if (auparse_get_num_fields(au) == 0) { auparse_destroy(au); return; } // Now iterate over the fields and print each one mptr = record; while (rc > 0 && ((mptr-record) < (MAX_AUDIT_MESSAGE_LENGTH-128))) { int ftype = auparse_get_field_type(au); const char *fname = auparse_get_field_name(au); const char *fval; switch (ftype) { case AUPARSE_TYPE_ESCAPED_FILE: fval = auparse_interpret_realpath(au); break; case AUPARSE_TYPE_SOCKADDR: fval = auparse_interpret_sock_address(au); if (fval == NULL) fval = auparse_interpret_sock_family(au); break; default: fval = auparse_interpret_field(au); break; } mptr = stpcpy(mptr, fname ? fname : "?"); mptr = stpcpy(mptr, "="); mptr = stpcpy(mptr, fval ? fval : "?"); mptr = stpcpy(mptr, " "); rc = auparse_next_field(au); if (!header && fname && strcmp(fname, "type") == 0) { mptr = stpcpy(mptr, "msg=audit("); time_t t = auparse_get_time(au); struct tm *tv = localtime(&t); if (tv) strftime(tbuf, sizeof(tbuf), "%x %T", tv); else strcpy(tbuf, "?"); mptr = stpcpy(mptr, tbuf); mptr = stpcpy(mptr, ") : "); header = 1; } } // Record is complete, dump it to syslog syslog(priority, "%s", record); auparse_destroy(au); } else { char *c = strchr(s, AUDIT_INTERP_SEPARATOR); if (c) *c = ' '; syslog(priority, "%s", s); } } int main(int argc, const char *argv[]) { char tmp[MAX_AUDIT_MESSAGE_LENGTH+1]; struct sigaction sa; if (init_syslog(argc, argv)) return 1; /* Register sighandlers */ sa.sa_flags = 0; sigemptyset(&sa.sa_mask); /* Set handler for the ones we care about */ sa.sa_handler = term_handler; sigaction(SIGTERM, &sa, NULL); sa.sa_handler = hup_handler; sigaction(SIGHUP, &sa, NULL); #ifdef HAVE_LIBCAP_NG // Drop capabilities capng_clear(CAPNG_SELECT_BOTH); if (capng_apply(CAPNG_SELECT_BOTH)) syslog(LOG_WARNING, "audisp-syslog plugin was unable to drop capabilities, continuing with elevated priviles"); #endif do { fd_set read_mask; int retval = -1; /* Load configuration */ if (hup) { reload_config(); } do { FD_ZERO(&read_mask); FD_SET(0, &read_mask); retval= select(1, &read_mask, NULL, NULL, NULL); } while (retval == -1 && errno == EINTR && !hup && !stop); /* Now the event loop */ if (!stop && !hup && retval > 0) { if (FD_ISSET(0, &read_mask)) { do { if (audit_fgets(tmp, MAX_AUDIT_MESSAGE_LENGTH, 0) > 0) write_syslog(tmp); } while (audit_fgets_more( MAX_AUDIT_MESSAGE_LENGTH)); } } if (audit_fgets_eof()) break; } while (stop == 0); free(record); return 0; } audit-4.0.2/audisp/plugins/syslog/Makefile.in0000644001034500103450000006725314655201422014655 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am -- # Copyright 2018,19 Red Hat Inc., Durham, North Carolina. # All Rights Reserved. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. If not, write to the # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor # Boston, MA 02110-1335, USA. # # Authors: # Steve Grubb # 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@ sbin_PROGRAMS = audisp-syslog$(EXEEXT) subdir = audisp/plugins/syslog ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prog_cc_for_build.m4 \ $(top_srcdir)/m4/cap-ng.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/src/libev/libev.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man8dir)" PROGRAMS = $(sbin_PROGRAMS) am_audisp_syslog_OBJECTS = audisp_syslog-audisp-syslog.$(OBJEXT) audisp_syslog_OBJECTS = $(am_audisp_syslog_OBJECTS) am__DEPENDENCIES_1 = AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = audisp_syslog_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(audisp_syslog_CFLAGS) \ $(CFLAGS) $(audisp_syslog_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/audisp_syslog-audisp-syslog.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(audisp_syslog_SOURCES) DIST_SOURCES = $(audisp_syslog_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man8dir = $(mandir)/man8 NROFF = nroff MANS = $(man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILD_EXEEXT = @BUILD_EXEEXT@ BUILD_OBJEXT = @BUILD_OBJEXT@ CAPNG_LDADD = @CAPNG_LDADD@ CAPNG_PKG = @CAPNG_PKG@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_FOR_BUILD = @CC_FOR_BUILD@ CFLAGS = @CFLAGS@ CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ CPP_FOR_BUILD = @CPP_FOR_BUILD@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG = @DEBUG@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GOLANG = @GOLANG@ GOROOT = @GOROOT@ 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@ LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBWRAP_LIBS = @LIBWRAP_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PYTHON = @PYTHON@ PYTHON3_CFLAGS = @PYTHON3_CFLAGS@ PYTHON3_INCLUDES = @PYTHON3_INCLUDES@ PYTHON3_LIBS = @PYTHON3_LIBS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ VERSION = @VERSION@ WFLAGS = @WFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CC_FOR_BUILD = @ac_ct_CC_FOR_BUILD@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gss_libs = @gss_libs@ 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@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ use_python3 = @use_python3@ CONFIG_CLEAN_FILES = *.loT *.rej *.orig EXTRA_DIST = syslog.conf $(man_MANS) AM_CPPFLAGS = -I${top_srcdir} -I${top_srcdir}/lib -I${top_srcdir}/common -I${top_srcdir}/auparse prog_confdir = $(sysconfdir)/audit plugin_confdir = $(prog_confdir)/plugins.d plugin_conf = syslog.conf man_MANS = audisp-syslog.8 audisp_syslog_DEPENDENCIES = ${top_builddir}/common/libaucommon.la audisp_syslog_SOURCES = audisp-syslog.c audisp_syslog_CFLAGS = -fPIE -DPIE -g -D_GNU_SOURCE -Wundef ${WFLAGS} audisp_syslog_LDFLAGS = -pie -Wl,-z,relro -Wl,-z,now audisp_syslog_LDADD = $(CAPNG_LDADD) ${top_builddir}/common/libaucommon.la ${top_builddir}/auparse/libauparse.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu audisp/plugins/syslog/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu audisp/plugins/syslog/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(sbindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ } \ ; done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(sbindir)" && rm -f $$files clean-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list audisp-syslog$(EXEEXT): $(audisp_syslog_OBJECTS) $(audisp_syslog_DEPENDENCIES) $(EXTRA_audisp_syslog_DEPENDENCIES) @rm -f audisp-syslog$(EXEEXT) $(AM_V_CCLD)$(audisp_syslog_LINK) $(audisp_syslog_OBJECTS) $(audisp_syslog_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audisp_syslog-audisp-syslog.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< audisp_syslog-audisp-syslog.o: audisp-syslog.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_syslog_CFLAGS) $(CFLAGS) -MT audisp_syslog-audisp-syslog.o -MD -MP -MF $(DEPDIR)/audisp_syslog-audisp-syslog.Tpo -c -o audisp_syslog-audisp-syslog.o `test -f 'audisp-syslog.c' || echo '$(srcdir)/'`audisp-syslog.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audisp_syslog-audisp-syslog.Tpo $(DEPDIR)/audisp_syslog-audisp-syslog.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='audisp-syslog.c' object='audisp_syslog-audisp-syslog.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_syslog_CFLAGS) $(CFLAGS) -c -o audisp_syslog-audisp-syslog.o `test -f 'audisp-syslog.c' || echo '$(srcdir)/'`audisp-syslog.c audisp_syslog-audisp-syslog.obj: audisp-syslog.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_syslog_CFLAGS) $(CFLAGS) -MT audisp_syslog-audisp-syslog.obj -MD -MP -MF $(DEPDIR)/audisp_syslog-audisp-syslog.Tpo -c -o audisp_syslog-audisp-syslog.obj `if test -f 'audisp-syslog.c'; then $(CYGPATH_W) 'audisp-syslog.c'; else $(CYGPATH_W) '$(srcdir)/audisp-syslog.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audisp_syslog-audisp-syslog.Tpo $(DEPDIR)/audisp_syslog-audisp-syslog.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='audisp-syslog.c' object='audisp_syslog-audisp-syslog.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_syslog_CFLAGS) $(CFLAGS) -c -o audisp_syslog-audisp-syslog.obj `if test -f 'audisp-syslog.c'; then $(CYGPATH_W) 'audisp-syslog.c'; else $(CYGPATH_W) '$(srcdir)/audisp-syslog.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man8: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man8dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man8dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man8dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.8[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \ done; } uninstall-man8: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man8dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.8[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man8dir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(MANS) installdirs: for dir in "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man8dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-sbinPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/audisp_syslog-audisp-syslog.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-sbinPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man8 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/audisp_syslog-audisp-syslog.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-man uninstall-sbinPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook uninstall-man: uninstall-man8 .MAKE: install-am install-data-am install-strip uninstall-am .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-sbinPROGRAMS cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-data-hook install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man8 \ install-pdf install-pdf-am install-ps install-ps-am \ install-sbinPROGRAMS install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-hook \ uninstall-man uninstall-man8 uninstall-sbinPROGRAMS .PRECIOUS: Makefile install-data-hook: mkdir -p -m 0750 ${DESTDIR}${plugin_confdir} $(INSTALL_DATA) -D -m 640 ${srcdir}/$(plugin_conf) ${DESTDIR}${plugin_confdir} uninstall-hook: rm ${DESTDIR}${plugin_confdir}/$(plugin_conf) # 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: audit-4.0.2/audisp/plugins/syslog/Makefile.am0000644001034500103450000000337214655201403014633 # Makefile.am -- # Copyright 2018,19 Red Hat Inc., Durham, North Carolina. # All Rights Reserved. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. If not, write to the # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor # Boston, MA 02110-1335, USA. # # Authors: # Steve Grubb # CONFIG_CLEAN_FILES = *.loT *.rej *.orig EXTRA_DIST = syslog.conf $(man_MANS) AM_CPPFLAGS = -I${top_srcdir} -I${top_srcdir}/lib -I${top_srcdir}/common -I${top_srcdir}/auparse prog_confdir = $(sysconfdir)/audit plugin_confdir=$(prog_confdir)/plugins.d plugin_conf = syslog.conf sbin_PROGRAMS = audisp-syslog man_MANS = audisp-syslog.8 audisp_syslog_DEPENDENCIES = ${top_builddir}/common/libaucommon.la audisp_syslog_SOURCES = audisp-syslog.c audisp_syslog_CFLAGS = -fPIE -DPIE -g -D_GNU_SOURCE -Wundef ${WFLAGS} audisp_syslog_LDFLAGS = -pie -Wl,-z,relro -Wl,-z,now audisp_syslog_LDADD = $(CAPNG_LDADD) ${top_builddir}/common/libaucommon.la ${top_builddir}/auparse/libauparse.la install-data-hook: mkdir -p -m 0750 ${DESTDIR}${plugin_confdir} $(INSTALL_DATA) -D -m 640 ${srcdir}/$(plugin_conf) ${DESTDIR}${plugin_confdir} uninstall-hook: rm ${DESTDIR}${plugin_confdir}/$(plugin_conf) audit-4.0.2/audisp/plugins/syslog/audisp-syslog.80000644001034500103450000000272314655201403015472 .TH AUDISP-SYSLOG "8" "August 2018" "Red Hat" "System Administration Utilities" .SH NAME audisp-syslog \- plugin to push audit events into syslog .SH SYNOPSIS .B audisp-syslog [ \fIOPTIONS\fP ] .SH DESCRIPTION \fBaudisp-syslog\fP is a plugin for the audit event dispatcher that wraps audit events back around to syslog. It can be passed three options: one which is the syslog facility, one that is the syslog level that all events are logged with, and one that determines if events should be interpreted. Valid facilities are LOG_LOCAL0 through 7, LOG_AUTH, LOG_AUTHPRIV, LOG_DAEMON, LOG_SYSLOG, and LOG_USER. Valid levels are LOG_DEBUG through LOG_EMERG. Setting these options is done in the /etc/audit/syslog.conf file on the args line. If it is desired that events are interpreted, add the word .B interpret to the args line. This will cause all events to be interpreted. The drawback to this approach is that naive parsers can be tricked by an adversary that has the ability to name files, processes, or other user controlled objects. If you are aggregating multiple machines, you should edit auditd.conf to set the name_format to something meaningful and the log_format to enriched. This way you can tell where the event came from and have the user name and groups resolved locally before it is sent off of the machine. .SH FILES /etc/audit/plugins/syslog.conf /etc/audit/auditd.conf .SH "SEE ALSO" .BR auditd.conf (8), .BR auditd-plugins (5), .BR syslog (3). .SH AUTHOR Steve Grubb audit-4.0.2/audisp/plugins/Makefile.in0000644001034500103450000005032614655201422013326 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am -- # Copyright 2007-08,2018-23 Red Hat Inc. # All Rights Reserved. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. If not, write to the # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor # Boston, MA 02110-1335, USA. # # Authors: # Steve Grubb # 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@ @ENABLE_EXPERIMENTAL_TRUE@am__append_1 = ids statsd @ENABLE_ZOS_REMOTE_TRUE@am__append_2 = zos-remote subdir = audisp/plugins ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prog_cc_for_build.m4 \ $(top_srcdir)/m4/cap-ng.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/src/libev/libev.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` DIST_SUBDIRS = af_unix remote syslog filter ids statsd zos-remote am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILD_EXEEXT = @BUILD_EXEEXT@ BUILD_OBJEXT = @BUILD_OBJEXT@ CAPNG_LDADD = @CAPNG_LDADD@ CAPNG_PKG = @CAPNG_PKG@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_FOR_BUILD = @CC_FOR_BUILD@ CFLAGS = @CFLAGS@ CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ CPP_FOR_BUILD = @CPP_FOR_BUILD@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG = @DEBUG@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GOLANG = @GOLANG@ GOROOT = @GOROOT@ 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@ LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBWRAP_LIBS = @LIBWRAP_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PYTHON = @PYTHON@ PYTHON3_CFLAGS = @PYTHON3_CFLAGS@ PYTHON3_INCLUDES = @PYTHON3_INCLUDES@ PYTHON3_LIBS = @PYTHON3_LIBS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ VERSION = @VERSION@ WFLAGS = @WFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CC_FOR_BUILD = @ac_ct_CC_FOR_BUILD@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gss_libs = @gss_libs@ 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@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ use_python3 = @use_python3@ CONFIG_CLEAN_FILES = *.loT *.rej *.orig SUBDIRS = af_unix remote syslog filter $(am__append_1) $(am__append_2) all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu audisp/plugins/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu audisp/plugins/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: audit-4.0.2/audisp/plugins/statsd/0000755001034500103450000000000014655201457012645 5audit-4.0.2/audisp/plugins/statsd/audisp-statsd.c0000644001034500103450000002644314655201403015516 /* audisp-statsd.c -- * Copyright 2021 Steve Grubb * All Rights Reserved. * * 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 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor * Boston, MA 02110-1335, USA. * * Authors: * Steve Grubb */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include "libaudit.h" #include "auparse.h" /* Global Definitions */ #define STATE_REPORT "/var/run/auditd.state" #define CONFIG "/etc/audit/audisp-statsd.conf" struct daemon_config { char address[65]; unsigned int port; unsigned int interval; int sock; struct sockaddr_storage addr; socklen_t addrlen; }; struct audit_report { unsigned int backlog; unsigned int lost; long long unsigned int free_space; unsigned int plugin_current_depth; unsigned int plugin_max_depth; unsigned int events_total_count; unsigned int events_total_failed; unsigned int events_avc_count; unsigned int events_fanotify_count; unsigned int events_logins_success; unsigned int events_logins_failed; unsigned int events_anomaly_count; unsigned int events_response_count; }; /* Global Data */ static volatile int stop = 0; static volatile int hup = 0; static int audit_fd = -1; static pid_t auditd_pid = 0; static auparse_state_t *au = NULL; static int timer_fd = -1; static char msg[MAX_AUDIT_MESSAGE_LENGTH + 1]; static struct daemon_config d; static struct audit_report r; /* Local function prototypes */ static void handle_event(auparse_state_t *au, auparse_cb_event_t cb_event_type, void *user_data); /* * SIGTERM handler: exit time */ static void term_handler(int sig) { stop = sig; } /* * SIGHUP handler: re-read config */ static void hup_handler(int sig) { hup = sig; } /* * Get the next config file line and clean it up a little */ static char *get_line(FILE *f, char *buf, size_t len) { if (fgets(buf, len, f)) { /* remove newline */ char *ptr = strchr(buf, 0x0a); if (ptr) *ptr = 0; return buf; } return NULL; } /* * Load the plugin's configuration. Returns 1 on failure and 0 on success. */ static int load_config(void) { unsigned int status = 0; char buf[128]; FILE *f = fopen(CONFIG, "rt"); if (f == NULL) { fprintf(stderr, "Cannot open config file\n"); return 1; } while (get_line(f, buf, sizeof(buf))) { switch (buf[0]) { case 'a': sscanf(buf, "address = %64s", d.address); status |= 0x01; break; case 'p': sscanf(buf, "port = %u", &d.port); status |= 0x02; break; case 'i': sscanf(buf, "interval = %u", &d.interval); status |= 0x04; break; case 0: case '#': // Comments break; default: fprintf(stderr, "unknown option\n"); fclose(f); return 1; } } fclose(f); if (status != 0x07) { fprintf(stderr, "Not all config options specified\n"); return 1; } return 0; } /* * Given the configuration data, turn it into a usable address for use * with sendto later. */ int make_socket(void) { int rc; struct addrinfo hints, *ai; char port[16]; // Resolve the remote host memset(&hints, '\0', sizeof(hints)); hints.ai_flags = AI_ADDRCONFIG|AI_NUMERICSERV; hints.ai_socktype = SOCK_DGRAM; snprintf(port, sizeof(port), "%u", d.port); rc = getaddrinfo(d.address, port, &hints, &ai); if (rc) { syslog(LOG_ERR, "error looking up statsd service\n"); return -1; } d.sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol); memcpy(&d.addr, ai->ai_addr, ai->ai_addrlen); d.addrlen = ai->ai_addrlen; freeaddrinfo(ai); return d.sock; } /* * Reset all the report parameters */ static void clear_report(void) { r.lost = 0; r.backlog = 0; r.free_space = 0; r.plugin_current_depth = 0; r.plugin_max_depth = 0; r.events_total_count = 0; r.events_total_failed = 0; r.events_avc_count = 0; r.events_fanotify_count = 0; r.events_logins_success = 0; r.events_logins_failed = 0; r.events_anomaly_count = 0; r.events_response_count = 0; } /* * Pull the current status from the kernel */ static void get_kernel_status(void) { struct audit_reply rep; audit_request_status(audit_fd); int rc = audit_get_reply(audit_fd, &rep, GET_REPLY_BLOCKING, 0); if (rc > 0 && rep.type == AUDIT_GET) { // add info to global audit event struct r.lost = rep.status->lost; r.backlog = rep.status->backlog; } } /* * Collect free_space, plugin_current_depth, and plugin_max_depth * out of the auditd state report. */ static void get_auditd_status(void) { // SIGCONT was sent previously, hopefully the report is ready now FILE *f = fopen(STATE_REPORT, "rt"); if (f) { char buf[80]; __fsetlocking(f, FSETLOCKING_BYCALLER); while (fgets(buf, sizeof(buf), f)) { if (memcmp(buf, "Logging", 7) == 0) { sscanf(buf, "Logging partition free space = %llu", &r.free_space); } else if (memcmp(buf, "current plugin", 14) == 0) { sscanf(buf, "current plugin queue depth = %u", &r.plugin_current_depth); } else if (memcmp(buf, "max plugin", 10) == 0) { sscanf(buf, "max plugin queue depth used = %u", &r.plugin_max_depth); break; // This is last item, break free } } fclose(f); } } /* * Format and send the report metrics to the statsd service. */ static void send_statsd(void) { // The message size has to stay under the MTU for the network // 512 should be low enough to survive the commodity internet char message[512]; int len; // grab the global audit event struct and format it // format - :| // Things pulled from kernel or auditd are gauges. Anything // incremented (events) are counters. len = snprintf(message, sizeof(message), "kernel.lost:%u|g\nkernel.backlog:%u|g\n" "auditd.free_space:%llu|g\nauditd.plugin_current_depth:%u|g\nauditd.plugin_max_depth:%u|g\n" "events.total_count:%u|c\nevents.total_failed:%u|c\n" "events.avc_count:%u|c\nevents.fanotify_count:%u|c\n" "events.logins_success:%u|c\nevents.logins_failed:%u|c\n" "events.anomaly_count:%u|c\nevents.response_count:%u|c\n", r.lost, r.backlog, r.free_space, r.plugin_current_depth, r.plugin_max_depth, r.events_total_count, r.events_total_failed, r.events_avc_count, r.events_fanotify_count, r.events_logins_success, r.events_logins_failed, r.events_anomaly_count, r.events_response_count); if (len > 0 && len < (int)sizeof(message)) sendto(d.sock, message, len, 0, (struct sockaddr *)&d.addr, d.addrlen); } int main(void) { struct sigaction sa; struct pollfd pfd[2]; struct itimerspec itval; int rc; if (geteuid() != 0) { fprintf(stderr, "You need to be root to run this\n"); return 1; } if (load_config()) { syslog(LOG_ERR, "Failed loading config - exiting"); return 1; } // Setup signal handlers sa.sa_flags = 0; sigemptyset(&sa.sa_mask); /* Set handler for the ones we care about */ sa.sa_handler = term_handler; sigaction(SIGTERM, &sa, NULL); sa.sa_handler = hup_handler; sigaction(SIGHUP, &sa, NULL); // Create the socket d.sock = make_socket(); if (d.sock < 0) { syslog(LOG_ERR, "Failed creating socket - exiting"); return 1; } // Initialize audit clear_report(); au = auparse_init(AUSOURCE_FEED, 0); if (au == NULL) { close(d.sock); syslog(LOG_ERR, "exiting due to auparse init errors"); return 1; } auparse_set_eoe_timeout(5); auparse_add_callback(au, handle_event, NULL, NULL); audit_fd = audit_open(); if (audit_fd < 0) { close(d.sock); syslog(LOG_ERR, "unable to open audit socket"); return 1; } auditd_pid = getppid(); fcntl(0, F_SETFL, O_NONBLOCK); /* Set STDIN non-blocking */ pfd[0].fd = 0; // add stdin to the poll group pfd[0].events = POLLIN; // Initialize interval timer timer_fd = timerfd_create (CLOCK_MONOTONIC, 0); if (timer_fd < 0) { syslog(LOG_ERR, "unable to open a timerfd"); return 1; } pfd[1].fd = timer_fd; pfd[1].events = POLLIN; itval.it_interval.tv_sec = d.interval; itval.it_interval.tv_nsec = 0; itval.it_value.tv_sec = itval.it_interval.tv_sec; itval.it_value.tv_nsec = 0; timerfd_settime(timer_fd, 0, &itval, NULL); // Start event loop while (!stop) { rc = poll(pfd, 2, -1); if (rc < 0) { if (errno == EINTR) continue; } else if (rc > 0) { // timer if (pfd[1].revents & POLLIN) { unsigned long long missed; missed=read(timer_fd, &missed, sizeof (missed)); kill(auditd_pid, SIGCONT); // Run auditd report // Clear any old events if possible if (auparse_feed_has_data(au)) auparse_feed_age_events(au); get_kernel_status(); get_auditd_status(); send_statsd(); clear_report(); } // audit event if (pfd[0].revents & POLLIN) { int len; while ((len = read(0, msg, MAX_AUDIT_MESSAGE_LENGTH)) > 0) { msg[len] = 0; auparse_feed(au, msg, len); } } } } // tear down everything close(timer_fd); auparse_destroy(au); close(audit_fd); close(d.sock); if (stop) syslog(LOG_INFO, "audisp-statsd is exiting on stop request"); else syslog(LOG_INFO, "audisp-statsd is exiting"); return 0; } /* * Given a completed event, parse it up and increment various counters * based on what we see. */ static void handle_event(auparse_state_t *au, auparse_cb_event_t cb_event_type, void *user_data __attribute__((unused))) { int type; const char *success; if (cb_event_type != AUPARSE_CB_EVENT_READY) return; // Need to put everything in the global struct // r.events_total_count; // r.events_total_failed; // r.events_avc_count; // r.events_fanotify_count; // r.events_logins_success; // r.events_logins_failed; // r.events_anomaly_count; // r.events_response_count r.events_total_count++; auparse_normalize(au, NORM_OPT_NO_ATTRS); auparse_normalize_get_results(au); success = auparse_interpret_field(au); if (success && strcmp(success, "no") == 0) r.events_total_failed++; auparse_first_record(au); type = auparse_get_type(au); switch (type) { // These take advantage of knowing that this is the first // record in the whole event. If this ever changes then all // bets are off. case AUDIT_USER_LOGIN: if (success) { if (strcmp(success, "no") == 0) r.events_logins_failed++; else r.events_logins_success++; } break; case AUDIT_FANOTIFY: r.events_fanotify_count++; break; case AUDIT_AVC: r.events_avc_count++; break; case AUDIT_FIRST_ANOM_MSG...AUDIT_LAST_ANOM_MSG: r.events_anomaly_count++; break; case AUDIT_FIRST_ANOM_RESP...AUDIT_LAST_ANOM_RESP: r.events_response_count++; break; } } audit-4.0.2/audisp/plugins/statsd/au-statsd.conf0000644001034500103450000000031714655201403015331 # This file controls the configuration of the statsd plugin. # It picks out metrics and writes them to statsd. active = no direction = out path = /sbin/audisp-statsd type = always # args = format = string audit-4.0.2/audisp/plugins/statsd/audisp-statsd.conf0000644001034500103450000000023414655201403016207 # This file points audisp-statsd to the statsd server. The interval is # the time in seconds between updates. address = localhost port = 8125 interval = 15 audit-4.0.2/audisp/plugins/statsd/Makefile.in0000644001034500103450000006731414655201422014635 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ sbin_PROGRAMS = audisp-statsd$(EXEEXT) subdir = audisp/plugins/statsd ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prog_cc_for_build.m4 \ $(top_srcdir)/m4/cap-ng.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/src/libev/libev.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man8dir)" PROGRAMS = $(sbin_PROGRAMS) am_audisp_statsd_OBJECTS = audisp_statsd-audisp-statsd.$(OBJEXT) audisp_statsd_OBJECTS = $(am_audisp_statsd_OBJECTS) audisp_statsd_DEPENDENCIES = ${top_builddir}/auparse/libauparse.la \ ${top_builddir}/lib/libaudit.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = audisp_statsd_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(audisp_statsd_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/audisp_statsd-audisp-statsd.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(audisp_statsd_SOURCES) DIST_SOURCES = $(audisp_statsd_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man8dir = $(mandir)/man8 NROFF = nroff MANS = $(man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILD_EXEEXT = @BUILD_EXEEXT@ BUILD_OBJEXT = @BUILD_OBJEXT@ CAPNG_LDADD = @CAPNG_LDADD@ CAPNG_PKG = @CAPNG_PKG@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_FOR_BUILD = @CC_FOR_BUILD@ CFLAGS = @CFLAGS@ CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ CPP_FOR_BUILD = @CPP_FOR_BUILD@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG = @DEBUG@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GOLANG = @GOLANG@ GOROOT = @GOROOT@ 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@ LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBWRAP_LIBS = @LIBWRAP_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PYTHON = @PYTHON@ PYTHON3_CFLAGS = @PYTHON3_CFLAGS@ PYTHON3_INCLUDES = @PYTHON3_INCLUDES@ PYTHON3_LIBS = @PYTHON3_LIBS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ VERSION = @VERSION@ WFLAGS = @WFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CC_FOR_BUILD = @ac_ct_CC_FOR_BUILD@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gss_libs = @gss_libs@ 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@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ use_python3 = @use_python3@ # Makefile.am -- # Copyright 2021 Steve Grubb. # All Rights Reserved. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. If not, write to the # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor # Boston, MA 02110-1335, USA. # # Authors: # Steve Grubb # CONFIG_CLEAN_FILES = *.loT *.rej *.orig EXTRA_DIST = au-statsd.conf audisp-statsd.conf $(man_MANS) AM_CPPFLAGS = -I${top_srcdir} -I${top_srcdir}/lib -I${top_srcdir}/auparse prog_confdir = $(sysconfdir)/audit prog_conf = audisp-statsd.conf plugin_confdir = $(prog_confdir)/plugins.d plugin_conf = au-statsd.conf man_MANS = audisp-statsd.8 audisp_statsd_SOURCES = audisp-statsd.c audisp_statsd_CFLAGS = -g -D_GNU_SOURCE ${WFLAGS} audisp_statsd_LDADD = ${top_builddir}/auparse/libauparse.la ${top_builddir}/lib/libaudit.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu audisp/plugins/statsd/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu audisp/plugins/statsd/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(sbindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ } \ ; done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(sbindir)" && rm -f $$files clean-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list audisp-statsd$(EXEEXT): $(audisp_statsd_OBJECTS) $(audisp_statsd_DEPENDENCIES) $(EXTRA_audisp_statsd_DEPENDENCIES) @rm -f audisp-statsd$(EXEEXT) $(AM_V_CCLD)$(audisp_statsd_LINK) $(audisp_statsd_OBJECTS) $(audisp_statsd_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audisp_statsd-audisp-statsd.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< audisp_statsd-audisp-statsd.o: audisp-statsd.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_statsd_CFLAGS) $(CFLAGS) -MT audisp_statsd-audisp-statsd.o -MD -MP -MF $(DEPDIR)/audisp_statsd-audisp-statsd.Tpo -c -o audisp_statsd-audisp-statsd.o `test -f 'audisp-statsd.c' || echo '$(srcdir)/'`audisp-statsd.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audisp_statsd-audisp-statsd.Tpo $(DEPDIR)/audisp_statsd-audisp-statsd.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='audisp-statsd.c' object='audisp_statsd-audisp-statsd.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_statsd_CFLAGS) $(CFLAGS) -c -o audisp_statsd-audisp-statsd.o `test -f 'audisp-statsd.c' || echo '$(srcdir)/'`audisp-statsd.c audisp_statsd-audisp-statsd.obj: audisp-statsd.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_statsd_CFLAGS) $(CFLAGS) -MT audisp_statsd-audisp-statsd.obj -MD -MP -MF $(DEPDIR)/audisp_statsd-audisp-statsd.Tpo -c -o audisp_statsd-audisp-statsd.obj `if test -f 'audisp-statsd.c'; then $(CYGPATH_W) 'audisp-statsd.c'; else $(CYGPATH_W) '$(srcdir)/audisp-statsd.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audisp_statsd-audisp-statsd.Tpo $(DEPDIR)/audisp_statsd-audisp-statsd.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='audisp-statsd.c' object='audisp_statsd-audisp-statsd.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_statsd_CFLAGS) $(CFLAGS) -c -o audisp_statsd-audisp-statsd.obj `if test -f 'audisp-statsd.c'; then $(CYGPATH_W) 'audisp-statsd.c'; else $(CYGPATH_W) '$(srcdir)/audisp-statsd.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man8: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man8dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man8dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man8dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.8[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \ done; } uninstall-man8: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man8dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.8[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man8dir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(MANS) installdirs: for dir in "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man8dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-sbinPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/audisp_statsd-audisp-statsd.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-sbinPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man8 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/audisp_statsd-audisp-statsd.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-man uninstall-sbinPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook uninstall-man: uninstall-man8 .MAKE: install-am install-data-am install-strip uninstall-am .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-sbinPROGRAMS cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-data-hook install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man8 \ install-pdf install-pdf-am install-ps install-ps-am \ install-sbinPROGRAMS install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-hook \ uninstall-man uninstall-man8 uninstall-sbinPROGRAMS .PRECIOUS: Makefile install-data-hook: mkdir -p -m 0750 ${DESTDIR}${plugin_confdir} $(INSTALL_DATA) -D -m 640 ${srcdir}/$(plugin_conf) ${DESTDIR}${plugin_confdir} $(INSTALL_DATA) -D -m 640 ${srcdir}/$(prog_conf) ${DESTDIR}${prog_confdir} uninstall-hook: rm ${DESTDIR}${plugin_confdir}/$(plugin_conf) rm ${DESTDIR}${prog_confdir}/$(prog_conf) # 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: audit-4.0.2/audisp/plugins/statsd/audisp-statsd.80000644001034500103450000000311614655201403015433 .TH AUDISP-STATSD "8" "February 2021" "Red Hat" "System Administration Utilities" .SH NAME audisp-statsd \- plugin to push audit metrics to a statsd service .SH SYNOPSIS .B audisp-statsd [ \fIOPTIONS\fP ] .SH DESCRIPTION \fBaudisp-statsd\fP is a plugin for the audit event dispatcher that pushes various audit metrics to a statsd service using UDP. Currently it collects the following metrics as gauges: .RS .TP .B backlog number of kernel events pending transfer to user space .TP .B lost number of kernel events dropped .TP .B free_space how much disk free space auditd sees in MB .TP .B plugin_current_depth number of events in auditd pending transfer to plugins .TP .B plugin_max_depth historical maximum number of events backlogged while pending transfer to plugins .RE as counters: .RS .TP .B events_total_count total number of events seen during interval .TP .B events_total_failed total number of events seen during interval with failed outcome .TP .B events_avc_count total number of AVC events seen during interval .TP .B events_fanotify_count total number of FANOTIFY events seen during interval .TP .B events_logins_success total number of successful login events seen during interval .TP .B events_logins_failed total number of failed login events seen during interval .TP .B events_anamoly_count total number of anamoly events seen during interval .TP .B events_response_count total number of anamoly response events seen during interval .RE .SH FILES /etc/audit/audisp-statsd.conf /etc/audit/plugins/au-statsd.conf .SH "SEE ALSO" .BR auditd.conf (8), .BR auditd-plugins (5). .SH AUTHOR Steve Grubb audit-4.0.2/audisp/plugins/statsd/Makefile.am0000644001034500103450000000332314655201403014611 # Makefile.am -- # Copyright 2021 Steve Grubb. # All Rights Reserved. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. If not, write to the # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor # Boston, MA 02110-1335, USA. # # Authors: # Steve Grubb # CONFIG_CLEAN_FILES = *.loT *.rej *.orig EXTRA_DIST = au-statsd.conf audisp-statsd.conf $(man_MANS) AM_CPPFLAGS = -I${top_srcdir} -I${top_srcdir}/lib -I${top_srcdir}/auparse prog_confdir = $(sysconfdir)/audit prog_conf = audisp-statsd.conf plugin_confdir=$(prog_confdir)/plugins.d plugin_conf = au-statsd.conf sbin_PROGRAMS = audisp-statsd man_MANS = audisp-statsd.8 audisp_statsd_SOURCES = audisp-statsd.c audisp_statsd_CFLAGS = -g -D_GNU_SOURCE ${WFLAGS} audisp_statsd_LDADD = ${top_builddir}/auparse/libauparse.la ${top_builddir}/lib/libaudit.la install-data-hook: mkdir -p -m 0750 ${DESTDIR}${plugin_confdir} $(INSTALL_DATA) -D -m 640 ${srcdir}/$(plugin_conf) ${DESTDIR}${plugin_confdir} $(INSTALL_DATA) -D -m 640 ${srcdir}/$(prog_conf) ${DESTDIR}${prog_confdir} uninstall-hook: rm ${DESTDIR}${plugin_confdir}/$(plugin_conf) rm ${DESTDIR}${prog_confdir}/$(prog_conf) audit-4.0.2/audisp/plugins/filter/0000755001034500103450000000000014655201457012630 5audit-4.0.2/audisp/plugins/filter/audisp-filter.80000644001034500103450000000624014655201403015402 .TH AUDISP-SYSLOG "8" "February 2024" "Red Hat" "System Administration Utilities" .SH NAME audisp-filter \- plugin to filter audit events and forward them to other plugins .SH SYNOPSIS .B audisp-filter \fIMODE CONFIG_FILE BINARY\fP [ \fIBINARY_ARGS\fP ] .SH DESCRIPTION \fBaudisp-filter\fP is an audit event dispatcher plugin designed to filter out specific events based on its provided configuration. Moreover, it possesses the capability to forward the remaining logs to other plugins. The plugin is universally compatible, allowing seamless integration with any existing audit plugin that expects audit messages on its standard input. Currently it supports the following arguments: .RS .TP .B MODE The operational mode can be either allowlist or blocklist. In allowlist mode, the plugin forwards everything except for events that match the specified ausearch expressions in the configuration. Conversely, in blocklist mode, it refrains from forwarding anything except for events listed in the configuration. .TP .B CONFIG_FILE Path to the main configuration file containing ausearch expressions. .TP .B BINARY Path to an external program that will consistently receive filtered audit events through its standard input. .TP .B BINARY_ARGS Optionally, you can pass additional arguments to the external program. .RE .SH CONFIGURATION AND RULES EVALUATION Every single plugin that wants to benefit from the event filtering capability needs to create its own configuration file. It's a good practice to place this file inside the audit config directory, following the naming convention audisp-filter-pluginname.conf, for instance, .B audisp-filter-syslog.conf to filter audit events before sending them to syslog. Each line within a configuration represents an ausearch-expression (5). Internally, these expressions are joined using the OR operator. Therefore, every expression is substituted with (PE || CE), where PE represents the previous expression and CE denotes the current expression being processed. Lines starting with a .B '#' character are treated as comments and do not influence the final rule set. Upon the creation of an audit event, the filtering engine goes through the list of expressions, constructing the final expression representing our rule set. The event in question will be searched using this expression. The decision to forward an audit event to the configured binary depends on two factors: the operational mode of audisp-filter and whether the expression matches the ongoing event. .SH EXAMPLE Example1: Do not syslog audit events containing unsuccessful openat syscalls. First, in the plugin config, make sure that operation mode is set to allowlist, the binary points to /sbin/audispFyslog and provide any additional arguments if needed. Next, create the plugin specific config file with the content below. Before enabling the audit plugin, always make sure the syntax is correct. This can be checked by calling audisp-filter --check path/to/config/file. .B (type r= SYSCALL && syscall r= openat && success r= yes) .SH FILES /etc/audit/plugins/filter.conf /etc/audit/auditd.conf .SH "SEE ALSO" .BR auditd.conf (8), .BR ausearch-expression (5), .BR auditd-plugins (5). .SH AUTHOR Attila Lakatos audit-4.0.2/audisp/plugins/filter/filter.conf0000644001034500103450000000115714655201403014677 # # The audisp-filter plugin is designed to address # the need for event filtering in the Linux audit system. # It empowers users to selectively process audit events # based on specified criteria before they are e.g. forwarded # to syslog or sent to a remote destination for analysis. # The filter is generic and is designed to work in tandem # with other plugins which expect audit messages on their # standard input. # See audisp-filter(8) active = no direction = out path = /sbin/audisp-filter type = always args = allowlist /etc/audit/audisp-filter.conf /sbin/audisp-syslog LOG_USER LOG_INFO interpret format = string audit-4.0.2/audisp/plugins/filter/Makefile.in0000644001034500103450000006752414655201422014623 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am -- # Copyright 2024 Red Hat Inc., Durham, North Carolina. # All Rights Reserved. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. If not, write to the # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor # Boston, MA 02110-1335, USA. # # Authors: # Attila Lakatos # 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@ sbin_PROGRAMS = audisp-filter$(EXEEXT) subdir = audisp/plugins/filter ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prog_cc_for_build.m4 \ $(top_srcdir)/m4/cap-ng.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/src/libev/libev.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man8dir)" PROGRAMS = $(sbin_PROGRAMS) am_audisp_filter_OBJECTS = audisp_filter-audisp-filter.$(OBJEXT) audisp_filter_OBJECTS = $(am_audisp_filter_OBJECTS) am__DEPENDENCIES_1 = AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = audisp_filter_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(audisp_filter_CFLAGS) \ $(CFLAGS) $(audisp_filter_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/audisp_filter-audisp-filter.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(audisp_filter_SOURCES) DIST_SOURCES = $(audisp_filter_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man8dir = $(mandir)/man8 NROFF = nroff MANS = $(man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILD_EXEEXT = @BUILD_EXEEXT@ BUILD_OBJEXT = @BUILD_OBJEXT@ CAPNG_LDADD = @CAPNG_LDADD@ CAPNG_PKG = @CAPNG_PKG@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_FOR_BUILD = @CC_FOR_BUILD@ CFLAGS = @CFLAGS@ CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ CPP_FOR_BUILD = @CPP_FOR_BUILD@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG = @DEBUG@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GOLANG = @GOLANG@ GOROOT = @GOROOT@ 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@ LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBWRAP_LIBS = @LIBWRAP_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PYTHON = @PYTHON@ PYTHON3_CFLAGS = @PYTHON3_CFLAGS@ PYTHON3_INCLUDES = @PYTHON3_INCLUDES@ PYTHON3_LIBS = @PYTHON3_LIBS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ VERSION = @VERSION@ WFLAGS = @WFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CC_FOR_BUILD = @ac_ct_CC_FOR_BUILD@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gss_libs = @gss_libs@ 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@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ use_python3 = @use_python3@ CONFIG_CLEAN_FILES = *.loT *.rej *.orig EXTRA_DIST = filter.conf audisp-filter.conf $(man_MANS) AM_CPPFLAGS = -I${top_srcdir} -I${top_srcdir}/lib -I${top_srcdir}/common -I${top_srcdir}/auparse prog_confdir = $(sysconfdir)/audit prog_conf = audisp-filter.conf plugin_confdir = $(prog_confdir)/plugins.d plugin_conf = filter.conf man_MANS = audisp-filter.8 audisp_filter_DEPENDENCIES = ${top_builddir}/common/libaucommon.la audisp_filter_SOURCES = audisp-filter.c audisp_filter_CFLAGS = -fPIE -DPIE -g -D_GNU_SOURCE -Wundef ${WFLAGS} audisp_filter_LDFLAGS = -pie -Wl,-z,relro -Wl,-z,now audisp_filter_LDADD = $(CAPNG_LDADD) ${top_builddir}/common/libaucommon.la ${top_builddir}/auparse/libauparse.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu audisp/plugins/filter/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu audisp/plugins/filter/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(sbindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ } \ ; done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(sbindir)" && rm -f $$files clean-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list audisp-filter$(EXEEXT): $(audisp_filter_OBJECTS) $(audisp_filter_DEPENDENCIES) $(EXTRA_audisp_filter_DEPENDENCIES) @rm -f audisp-filter$(EXEEXT) $(AM_V_CCLD)$(audisp_filter_LINK) $(audisp_filter_OBJECTS) $(audisp_filter_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audisp_filter-audisp-filter.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< audisp_filter-audisp-filter.o: audisp-filter.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_filter_CFLAGS) $(CFLAGS) -MT audisp_filter-audisp-filter.o -MD -MP -MF $(DEPDIR)/audisp_filter-audisp-filter.Tpo -c -o audisp_filter-audisp-filter.o `test -f 'audisp-filter.c' || echo '$(srcdir)/'`audisp-filter.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audisp_filter-audisp-filter.Tpo $(DEPDIR)/audisp_filter-audisp-filter.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='audisp-filter.c' object='audisp_filter-audisp-filter.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_filter_CFLAGS) $(CFLAGS) -c -o audisp_filter-audisp-filter.o `test -f 'audisp-filter.c' || echo '$(srcdir)/'`audisp-filter.c audisp_filter-audisp-filter.obj: audisp-filter.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_filter_CFLAGS) $(CFLAGS) -MT audisp_filter-audisp-filter.obj -MD -MP -MF $(DEPDIR)/audisp_filter-audisp-filter.Tpo -c -o audisp_filter-audisp-filter.obj `if test -f 'audisp-filter.c'; then $(CYGPATH_W) 'audisp-filter.c'; else $(CYGPATH_W) '$(srcdir)/audisp-filter.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audisp_filter-audisp-filter.Tpo $(DEPDIR)/audisp_filter-audisp-filter.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='audisp-filter.c' object='audisp_filter-audisp-filter.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_filter_CFLAGS) $(CFLAGS) -c -o audisp_filter-audisp-filter.obj `if test -f 'audisp-filter.c'; then $(CYGPATH_W) 'audisp-filter.c'; else $(CYGPATH_W) '$(srcdir)/audisp-filter.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man8: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man8dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man8dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man8dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.8[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \ done; } uninstall-man8: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man8dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.8[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man8dir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(MANS) installdirs: for dir in "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man8dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-sbinPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/audisp_filter-audisp-filter.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-sbinPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man8 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/audisp_filter-audisp-filter.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-man uninstall-sbinPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook uninstall-man: uninstall-man8 .MAKE: install-am install-data-am install-strip uninstall-am .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-sbinPROGRAMS cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-data-hook install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man8 \ install-pdf install-pdf-am install-ps install-ps-am \ install-sbinPROGRAMS install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-hook \ uninstall-man uninstall-man8 uninstall-sbinPROGRAMS .PRECIOUS: Makefile install-data-hook: mkdir -p -m 0750 ${DESTDIR}${plugin_confdir} $(INSTALL_DATA) -D -m 640 ${srcdir}/$(plugin_conf) ${DESTDIR}${plugin_confdir} $(INSTALL_DATA) -D -m 640 ${srcdir}/$(prog_conf) ${DESTDIR}${prog_confdir} uninstall-hook: rm ${DESTDIR}${plugin_confdir}/$(plugin_conf) rm ${DESTDIR}${prog_confdir}/$(prog_conf) # 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: audit-4.0.2/audisp/plugins/filter/Makefile.am0000644001034500103450000000364314655201403014601 # Makefile.am -- # Copyright 2024 Red Hat Inc., Durham, North Carolina. # All Rights Reserved. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. If not, write to the # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor # Boston, MA 02110-1335, USA. # # Authors: # Attila Lakatos # CONFIG_CLEAN_FILES = *.loT *.rej *.orig EXTRA_DIST = filter.conf audisp-filter.conf $(man_MANS) AM_CPPFLAGS = -I${top_srcdir} -I${top_srcdir}/lib -I${top_srcdir}/common -I${top_srcdir}/auparse prog_confdir = $(sysconfdir)/audit prog_conf = audisp-filter.conf plugin_confdir=$(prog_confdir)/plugins.d plugin_conf = filter.conf sbin_PROGRAMS = audisp-filter man_MANS = audisp-filter.8 audisp_filter_DEPENDENCIES = ${top_builddir}/common/libaucommon.la audisp_filter_SOURCES = audisp-filter.c audisp_filter_CFLAGS = -fPIE -DPIE -g -D_GNU_SOURCE -Wundef ${WFLAGS} audisp_filter_LDFLAGS = -pie -Wl,-z,relro -Wl,-z,now audisp_filter_LDADD = $(CAPNG_LDADD) ${top_builddir}/common/libaucommon.la ${top_builddir}/auparse/libauparse.la install-data-hook: mkdir -p -m 0750 ${DESTDIR}${plugin_confdir} $(INSTALL_DATA) -D -m 640 ${srcdir}/$(plugin_conf) ${DESTDIR}${plugin_confdir} $(INSTALL_DATA) -D -m 640 ${srcdir}/$(prog_conf) ${DESTDIR}${prog_confdir} uninstall-hook: rm ${DESTDIR}${plugin_confdir}/$(plugin_conf) rm ${DESTDIR}${prog_confdir}/$(prog_conf) audit-4.0.2/audisp/plugins/filter/audisp-filter.c0000644001034500103450000002774714655201403015474 /* audisp-filter.c -- * Copyright 2024 Red Hat Inc. * All Rights Reserved. * * 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 * * Authors: * Attila Lakatos * */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_LIBCAP_NG #include #endif #include "auparse.h" #include "common.h" #include "libaudit.h" struct filter_rule { char* expr; int lineno; struct filter_rule* next; }; struct filter_list { struct filter_rule* head; struct filter_rule* tail; }; enum { ALLOWLIST, BLOCKLIST }; struct filter_conf { int mode; /* allowlist or blocklist */ const char* binary; /* external program that will receive filter audit events */ char** binary_args; /* arguments for external program */ const char* config_file; /* file containing audit expressions */ int only_check; /* just verify the syntax of the config_file and exit */ }; /* Global Data */ static volatile int stop = 0; static volatile int hup = 0; static int pipefd[2]; static int errors = 0; static struct filter_list list; pid_t cpid = -1; static struct filter_conf config = { .mode = -1, .binary = NULL, .binary_args = NULL, .config_file = NULL, .only_check = 0 }; static void handle_event(auparse_state_t* au, auparse_cb_event_t cb_event_type, void* user_data) { if (cb_event_type != AUPARSE_CB_EVENT_READY) return; int rc, forward_event; // Determine whether to forward or drop the event rc = ausearch_cur_event(au); if (rc > 0) { /* matched */ forward_event = (config.mode == ALLOWLIST) ? 0 : 1; } else if (rc == 0) { /* not matched */ forward_event = (config.mode == ALLOWLIST) ? 1 : 0; } else { syslog(LOG_ERR, "The ausearch_next_event returned %d", rc); return; } if (forward_event) { const int records = auparse_get_num_records(au); for (int i = 0; i < records; i++) { const char* txt = auparse_get_record_text(au); // Need to add new line character to signal end of the current record if (write(pipefd[1], txt, strlen(txt)) == -1 || write(pipefd[1], "\n", 1) == -1) { syslog(LOG_ERR, "Failed to write to pipe"); return; } } } } static void free_args() { if (config.binary_args) { for (int i = 0; config.binary_args[i] != NULL; i++) { free(config.binary_args[i]); } free(config.binary_args); } } static int parse_args(int argc, const char* argv[]) { if (argc == 3 && (strcmp("--check", argv[1]) == 0)) { config.config_file = argv[2]; config.only_check = 1; return 0; } if (argc <= 3) { syslog(LOG_ERR, "Not enough command line arguments"); return 1; } if (strcasecmp(argv[1], "allowlist") == 0) config.mode = ALLOWLIST; else if (strcasecmp(argv[1], "blocklist") == 0) config.mode = BLOCKLIST; else { syslog(LOG_ERR, "Invalid mode '%s' specified, possible values are: allowlist, " "blocklist.", argv[1]); return 1; } config.config_file = argv[2]; config.binary = argv[3]; argc -= 3; argv += 3; config.binary_args = malloc(sizeof(char*) * (argc + 1)); /* +1 is for the last NULL */ if (!config.binary_args) return 1; for (int i = 0; i < argc; i++) { config.binary_args[i] = strdup(argv[i]); if (!config.binary_args[i]) { while (i > 0) { free(config.binary_args[--i]); } free(config.binary_args); return 1; } } config.binary_args[argc] = NULL; return 0; } static char* get_line(FILE* f, char* buf, unsigned size, int* lineno, const char* file) { int too_long = 0; while (fgets_unlocked(buf, size, f)) { /* remove newline */ char* ptr = strchr(buf, 0x0a); if (ptr) { if (!too_long) { *ptr = 0; return buf; } // Reset and start with the next line too_long = 0; *lineno = *lineno + 1; } else { // If a line is too long skip it. // Only output 1 warning if (!too_long) syslog(LOG_WARNING, "Skipping line %d in %s: too long", *lineno, file); too_long = 1; } } return NULL; } // static void print_rules(struct filter_list* list) { // struct filter_rule* rule; // int count = 0; // // for (rule = list->head; rule != NULL; rule = rule->next, count++) { // printf("Rule %d on line %d: %s\n", count, rule->lineno, rule->expr); // } // } static void reset_rules(struct filter_list* list) { list->head = list->tail = NULL; } static void free_rule(struct filter_rule* rule) { free(rule->expr); } static void free_rules(struct filter_list* list) { struct filter_rule* current = list->head, * to_delete; while (current != NULL) { to_delete = current; current = current->next; free_rule(to_delete); free(to_delete); } } static void append_rule(struct filter_list* list, struct filter_rule* rule) { if (list->head == NULL) { list->head = list->tail = rule; } else { list->tail->next = rule; list->tail = rule; } } static struct filter_rule* parse_line(char* line, int lineno) { struct filter_rule* rule; auparse_state_t* au; const char* buf[] = { NULL }; char* error = NULL; /* dummy instance of the audit parsing library, we use it to validate search expressions that will be added to the filter engine */ if ((au = auparse_init(AUSOURCE_BUFFER_ARRAY, buf)) == NULL) { syslog(LOG_ERR, "The auparse_init failed"); return NULL; } // Skip whitespace while (*line == ' ') line++; // Empty line or it's a comment if (!*line || *line == '#') { auparse_destroy(au); return NULL; } if ((rule = malloc(sizeof(struct filter_rule))) == NULL) { auparse_destroy(au); return NULL; } rule->lineno = lineno; rule->next = NULL; if ((rule->expr = strdup(line)) == NULL) { auparse_destroy(au); free(rule); return NULL; } if (ausearch_add_expression(au, rule->expr, &error, AUSEARCH_RULE_OR) != 0) { syslog(LOG_ERR, "Invalid expression: %s (%s)", rule->expr, error); free_rule(rule); free(rule); rule = NULL; errors++; } auparse_destroy(au); return rule; } /* * Load rules from config into our linked list */ static int load_rules(struct filter_list* list) { int fd, lineno = 0; struct stat st; char buf[1024]; FILE* f; reset_rules(list); errors = 0; /* open the file */ if ((fd = open(config.config_file, O_RDONLY)) < 0) { if (errno != ENOENT) { syslog(LOG_ERR, "Error opening config file (%s)", strerror(errno)); return 1; } syslog(LOG_ERR, "Config file %s doesn't exist, skipping", config.config_file); return 1; } if (fstat(fd, &st) < 0) { syslog(LOG_ERR, "Error fstat'ing config file (%s)", strerror(errno)); close(fd); return 1; } if (st.st_uid != 0) { syslog(LOG_ERR, "Error - %s isn't owned by root", config.config_file); close(fd); return 1; } if ((st.st_mode & S_IWOTH) == S_IWOTH) { syslog(LOG_ERR, "Error - %s is world writable", config.config_file); close(fd); return 1; } if (!S_ISREG(st.st_mode)) { syslog(LOG_ERR, "Error - %s is not a regular file", config.config_file); close(fd); return 1; } /* it's ok, read line by line */ f = fdopen(fd, "rm"); if (f == NULL) { syslog(LOG_ERR, "Error - fdopen failed (%s)", strerror(errno)); close(fd); return 1; } while (get_line(f, buf, sizeof(buf), &lineno, config.config_file)) { lineno++; struct filter_rule* rule; if ((rule = parse_line(buf, lineno)) == NULL) continue; append_rule(list, rule); } fclose(f); return errors; } /* * SIGCHLD handler: reap exiting processes */ static void child_handler(int sig) { while (waitpid(-1, NULL, WNOHANG) > 0) ; /* empty */ stop = 1; } /* * SIGTERM handler */ static void term_handler(int sig) { kill(cpid, sig); stop = 1; } /* * SIGHUP handler: re-read config */ static void hup_handler(int sig) { kill(cpid, sig); hup = 1; } static void reload_config(void) { hup = 0; struct filter_list new_list; /* load new rules */ if (load_rules(&new_list)) { syslog(LOG_INFO, "The rules were not reloaded because of a syntax error"); free_rules(&new_list); return; } /* remove unused previous rules */ free_rules(&list); list = new_list; syslog(LOG_INFO, "Successfully reloaded rules"); } int main(int argc, const char* argv[]) { auparse_state_t* au = NULL; struct sigaction sa; char buffer[MAX_AUDIT_MESSAGE_LENGTH]; /* validate args */ if (parse_args(argc, argv)) return 1; /* create a list of rules from config file */ if (load_rules(&list)) { free_rules(&list); free_args(); return 1; } /* validate the ruleset and exit */ if (config.only_check) { free_rules(&list); free_args(); return 0; } /* Register sighandlers */ sa.sa_flags = 0; sigemptyset(&sa.sa_mask); /* Set handler for the ones we care about */ sa.sa_handler = term_handler; sigaction(SIGTERM, &sa, NULL); sa.sa_handler = hup_handler; sigaction(SIGHUP, &sa, NULL); sa.sa_handler = child_handler; sigaction(SIGCHLD, &sa, NULL); #ifdef HAVE_LIBCAP_NG // Drop capabilities capng_clear(CAPNG_SELECT_BOTH); if (capng_apply(CAPNG_SELECT_BOTH)) syslog(LOG_WARNING, "%s: unable to drop capabilities, continuing with " "elevated privileges", argv[0]); #endif if (pipe(pipefd) == -1) { syslog(LOG_ERR, "%s: unable to open a pipe (%s)", argv[0], strerror(errno)); return -1; } cpid = fork(); if (cpid == -1) { syslog(LOG_ERR, "%s: unable to create fork (%s)", argv[0], strerror(errno)); return -1; } if (cpid == 0) { /* Child reads filtered input*/ close(pipefd[1]); dup2(pipefd[0], STDIN_FILENO); close(pipefd[0]); execve(config.binary, config.binary_args, NULL); syslog(LOG_ERR, "%s: execve failed (%s)", argv[0], strerror(errno)); exit(1); } else { /* Parent reads input and forwards data after filters have been applied */ close(pipefd[0]); au = auparse_init(AUSOURCE_FEED, 0); if (au == NULL) { syslog(LOG_ERR, "%s: failed to initialize auparse data feed", argv[0]); kill(cpid, SIGTERM); return -1; } auparse_set_eoe_timeout(2); auparse_add_callback(au, handle_event, NULL, NULL); ausearch_set_stop(au, AUSEARCH_STOP_EVENT); // add rules(expressions) to the ausearch engine for (struct filter_rule* rule = list.head; rule != NULL; rule = rule->next) { char* error = NULL; int rc = ausearch_add_expression(au, rule->expr, &error, AUSEARCH_RULE_OR); if (rc != 0) { /* this should not happen because rules were pre-tested in parse_line() */ syslog(LOG_ERR, "Failed to add expression '%s' to ausearch (%s)", rule->expr, error); } free(error); } do { fd_set read_mask; int retval; int read_size = 1; /* Set to 1 so it's not EOF */ /* Load configuration */ if (hup) { reload_config(); } do { FD_ZERO(&read_mask); FD_SET(0, &read_mask); if (auparse_feed_has_data(au)) { struct timeval tv; tv.tv_sec = 1; tv.tv_usec = 0; retval = select(1, &read_mask, NULL, NULL, &tv); } else retval = select(1, &read_mask, NULL, NULL, NULL); /* If we timed out & have events, shake them loose */ if (retval == 0 && auparse_feed_has_data(au)) auparse_feed_age_events(au); } while (retval == -1 && errno == EINTR && !hup && !stop); /* Now the event loop */ if (!stop && !hup && retval > 0) { while ((read_size = read(0, buffer, MAX_AUDIT_MESSAGE_LENGTH)) > 0) { auparse_feed(au, buffer, read_size); } } if (read_size == 0) /* EOF */ break; } while (stop == 0); auparse_flush_feed(au); ausearch_clear(au); auparse_destroy(au); } free_rules(&list); free_args(); return 0; } audit-4.0.2/audisp/plugins/filter/audisp-filter.conf0000644001034500103450000000045614655201403016163 # Here you can specify a list of ausearch-expression(8) # # In allowlist mode, the plugin forwards everything except # for events that match the specified ausearch expressions. # In blocklist mode, it refrains from forwarding anything # except for events matching these expressions. # See audisp-filteraudit-4.0.2/audisp/plugins/Makefile.am0000644001034500103450000000204514655201403013307 # Makefile.am -- # Copyright 2007-08,2018-23 Red Hat Inc. # All Rights Reserved. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. If not, write to the # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor # Boston, MA 02110-1335, USA. # # Authors: # Steve Grubb # CONFIG_CLEAN_FILES = *.loT *.rej *.orig SUBDIRS = af_unix remote syslog filter if ENABLE_EXPERIMENTAL SUBDIRS += ids statsd endif if ENABLE_ZOS_REMOTE SUBDIRS += zos-remote endif audit-4.0.2/audisp/plugins/af_unix/0000755001034500103450000000000014655201457012774 5audit-4.0.2/audisp/plugins/af_unix/af_unix.conf0000644001034500103450000000054714655201403015211 # This file controls the configuration of the # af_unix socket plugin. It simply takes events # and writes them to a unix domain socket. This # plugin can take 2 arguments, the path for the # socket and the socket permissions in octal. active = no direction = out path = /sbin/audisp-af_unix type = always args = 0640 /var/run/audispd_events format = string audit-4.0.2/audisp/plugins/af_unix/audisp-af_unix.c0000644001034500103450000001577214655201403015777 /* * af_unix.c - implementation of the audisp-af_unix plugin * Copyright (c) 2023 Red Hat Inc. * All Rights Reserved. * * This software may be freely redistributed and/or modified 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, Inc., 51 Franklin Street, Fifth Floor * Boston, MA 02110-1335, USA. * * Authors: * Steve Grubb */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_LIBCAP_NG #include #endif #include "libaudit.h" #include "common.h" #define DEFAULT_PATH "/var/run/audispd_events" //#define DEBUG /* Global Data */ static volatile int stop = 0, hup = 0; char rx_buf[MAX_AUDIT_MESSAGE_LENGTH]; int sock = -1, conn = -1, client = 0; struct pollfd pfd[3]; unsigned mode = 0; char *path = NULL; /* * SIGTERM handler */ static void term_handler(int sig) { stop = 1; } /* * SIGHUP handler: re-read config */ static void hup_handler(int sig) { hup = 1; } int create_af_unix_socket(const char *spath, int mode) { struct sockaddr_un addr; socklen_t len; int rc, cmd, one = 1; sock = socket(PF_UNIX, SOCK_STREAM, 0); if (sock < 0) { syslog(LOG_ERR, "Couldn't open af_unix socket (%s)", strerror(errno)); return -1; } setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char *)&one, sizeof (int)); #ifdef DEBUG printf("%o %s\n", mode, spath); #else memset(&addr, 0, sizeof(addr)); addr.sun_family = AF_UNIX; snprintf(&addr.sun_path[0], 108, "%.107s", spath); len = sizeof(addr); rc = bind(sock, (const struct sockaddr *)&addr, len); if (rc < 0) { syslog(LOG_ERR, "Couldn't bind af_unix socket (%s)", strerror(errno)); close(sock); return -1; } rc = chmod(spath, mode); if (rc < 0) { syslog(LOG_ERR, "Couldn't chmod %s to %04o (%s)", spath, mode, strerror(errno)); close(sock); unlink(spath); return -1; } // Put socket in nonblock mode and don't leak the descriptor cmd = fcntl(sock, F_GETFL); fcntl(sock, F_SETFL, cmd|FNDELAY|FD_CLOEXEC); // Make socket listening...won't block (void)listen(sock, 1); #endif return 0; } int setup_socket(int argc, char *argv[]) { if (argc != 3) { syslog(LOG_ERR, "Missing arguments, using defaults"); mode = 0640; path = DEFAULT_PATH; } else { int i; for (i=1; i < 3; i++) { if (isdigit((unsigned char)argv[i][0])) { errno = 0; mode = strtoul(argv[i], NULL, 8); if (errno) { syslog(LOG_ERR, "Error converting %s (%s)", argv[i], strerror(errno)); mode = 0; } } else { char *base; path = argv[i]; // Make sure there are directories base = strchr(path, '/'); if (base) { DIR *d; char *dir = strdup(path); base = dirname(dir); d = opendir(base); if (d) { closedir(d); unlink(path); free(dir); } else { syslog(LOG_ERR, "Couldn't open %s (%s)", base, strerror(errno)); free(dir); exit(1); } } else { syslog(LOG_ERR, "Malformed path %s", path); exit(1); } } } if (mode == 0 || path == NULL) { syslog(LOG_ERR, "Bad arguments, using defaults"); mode = 0640; path = DEFAULT_PATH; } } return create_af_unix_socket(path, mode); } void read_audit_record(int ifd) { do { int len; // Read stdin if ((len = audit_fgets(rx_buf, sizeof(rx_buf), ifd)) > 0) { #ifdef DEBUG write(1, rx_buf, len); #else if (client) { // Send it to the client int rc; do { rc = write(conn, rx_buf, len); } while (rc < 0 && errno == EINTR); if (rc < 0 && errno == EPIPE) { close(conn); conn = -1; client = 0; audit_fgets_clear(); } if (rc >= 0 && rc != len) { // what to do with leftovers? } } #endif } else if (audit_fgets_eof()) stop = 1; } while (audit_fgets_more(sizeof(rx_buf))); } void accept_connection(void) { int tmp_conn; do { tmp_conn = accept4(sock, NULL,NULL, SOCK_NONBLOCK|SOCK_CLOEXEC); } while (tmp_conn < 0 && errno == EINTR); if (tmp_conn >= 0) { if (conn < 0) { syslog(LOG_INFO, "Client connected"); client = 1; conn = tmp_conn; } else close(tmp_conn); } } void event_loop(int ifd) { // setup poll pfd[0].fd = ifd; //stdin pfd[0].events = POLLIN; pfd[1].fd = sock; // listen socket pfd[1].events = POLLIN|POLLOUT; // loop on poll until stop - not doing HUP for now while (!stop) { int rc; if (client) { pfd[2].fd = conn; // the client pfd[2].events = POLLHUP; } rc = poll(pfd, 2 + client, -1); if (rc < 0) { if (errno == EINTR) continue; syslog(LOG_WARNING, "Poll error (%s), exiting", strerror(errno)); return; } if (rc > 0) { if (client && (pfd[2].revents & POLLHUP)) { // client hung up, do this first in case // an inbound audit record is available close(conn); conn = -1; client = 0; audit_fgets_clear(); } if (pfd[0].revents & POLLIN) { // Inbound audit event read_audit_record(ifd); } // auditd closed it's socket, exit if (pfd[0].revents & POLLHUP) return; if (pfd[1].revents & (POLLIN|POLLOUT)) { // someone connected, accept it accept_connection(); } } } } int main(int argc, char *argv[]) { struct sigaction sa; int i, ifd; /* Register sighandlers */ sa.sa_flags = 0; sigemptyset(&sa.sa_mask); /* Ignore all signals by default */ sa.sa_handler = SIG_IGN; for (i=1; i= 0) close(conn); if (sock >= 0) close(sock); unlink(path); return 0; } audit-4.0.2/audisp/plugins/af_unix/Makefile.in0000644001034500103450000006736314655201422014770 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am-- # Copyright 2023 Red Hat Inc. # All Rights Reserved. # # 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; see the file COPYING. If not, write to the # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor # Boston, MA 02110-1335, USA. # # Authors: # Steve Grubb # 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@ sbin_PROGRAMS = audisp-af_unix$(EXEEXT) subdir = audisp/plugins/af_unix ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prog_cc_for_build.m4 \ $(top_srcdir)/m4/cap-ng.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/src/libev/libev.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man8dir)" PROGRAMS = $(sbin_PROGRAMS) am_audisp_af_unix_OBJECTS = audisp_af_unix-audisp-af_unix.$(OBJEXT) audisp_af_unix_OBJECTS = $(am_audisp_af_unix_OBJECTS) am__DEPENDENCIES_1 = AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = audisp_af_unix_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(audisp_af_unix_CFLAGS) $(CFLAGS) $(audisp_af_unix_LDFLAGS) \ $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/audisp_af_unix-audisp-af_unix.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(audisp_af_unix_SOURCES) DIST_SOURCES = $(audisp_af_unix_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man8dir = $(mandir)/man8 NROFF = nroff MANS = $(man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILD_EXEEXT = @BUILD_EXEEXT@ BUILD_OBJEXT = @BUILD_OBJEXT@ CAPNG_LDADD = @CAPNG_LDADD@ CAPNG_PKG = @CAPNG_PKG@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_FOR_BUILD = @CC_FOR_BUILD@ CFLAGS = @CFLAGS@ CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ CPP_FOR_BUILD = @CPP_FOR_BUILD@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG = @DEBUG@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GOLANG = @GOLANG@ GOROOT = @GOROOT@ 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@ LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBWRAP_LIBS = @LIBWRAP_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PYTHON = @PYTHON@ PYTHON3_CFLAGS = @PYTHON3_CFLAGS@ PYTHON3_INCLUDES = @PYTHON3_INCLUDES@ PYTHON3_LIBS = @PYTHON3_LIBS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ VERSION = @VERSION@ WFLAGS = @WFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CC_FOR_BUILD = @ac_ct_CC_FOR_BUILD@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gss_libs = @gss_libs@ 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@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ use_python3 = @use_python3@ CONFIG_CLEAN_FILES = *.rej *.orig CONF_FILES = af_unix.conf EXTRA_DIST = $(CONF_FILES) $(man_MANS) AM_CPPFLAGS = -I${top_srcdir} -I${top_srcdir}/lib -I${top_srcdir}/common prog_confdir = $(sysconfdir)/audit plugin_confdir = $(prog_confdir)/plugins.d plugin_conf = af_unix.conf man_MANS = audisp-af_unix.8 audisp_af_unix_DEPENDENCIES = ${top_builddir}/common/libaucommon.la audisp_af_unix_SOURCES = audisp-af_unix.c audisp_af_unix_CFLAGS = -fPIE -DPIE -g -D_GNU_SOURCE -Wundef ${WFLAGS} audisp_af_unix_LDFLAGS = -pie -Wl,-z,relro -Wl,-z,now audisp_af_unix_LDADD = $(CAPNG_LDADD) ${top_builddir}/common/libaucommon.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu audisp/plugins/af_unix/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu audisp/plugins/af_unix/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(sbindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ } \ ; done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(sbindir)" && rm -f $$files clean-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list audisp-af_unix$(EXEEXT): $(audisp_af_unix_OBJECTS) $(audisp_af_unix_DEPENDENCIES) $(EXTRA_audisp_af_unix_DEPENDENCIES) @rm -f audisp-af_unix$(EXEEXT) $(AM_V_CCLD)$(audisp_af_unix_LINK) $(audisp_af_unix_OBJECTS) $(audisp_af_unix_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audisp_af_unix-audisp-af_unix.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< audisp_af_unix-audisp-af_unix.o: audisp-af_unix.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_af_unix_CFLAGS) $(CFLAGS) -MT audisp_af_unix-audisp-af_unix.o -MD -MP -MF $(DEPDIR)/audisp_af_unix-audisp-af_unix.Tpo -c -o audisp_af_unix-audisp-af_unix.o `test -f 'audisp-af_unix.c' || echo '$(srcdir)/'`audisp-af_unix.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audisp_af_unix-audisp-af_unix.Tpo $(DEPDIR)/audisp_af_unix-audisp-af_unix.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='audisp-af_unix.c' object='audisp_af_unix-audisp-af_unix.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_af_unix_CFLAGS) $(CFLAGS) -c -o audisp_af_unix-audisp-af_unix.o `test -f 'audisp-af_unix.c' || echo '$(srcdir)/'`audisp-af_unix.c audisp_af_unix-audisp-af_unix.obj: audisp-af_unix.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_af_unix_CFLAGS) $(CFLAGS) -MT audisp_af_unix-audisp-af_unix.obj -MD -MP -MF $(DEPDIR)/audisp_af_unix-audisp-af_unix.Tpo -c -o audisp_af_unix-audisp-af_unix.obj `if test -f 'audisp-af_unix.c'; then $(CYGPATH_W) 'audisp-af_unix.c'; else $(CYGPATH_W) '$(srcdir)/audisp-af_unix.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audisp_af_unix-audisp-af_unix.Tpo $(DEPDIR)/audisp_af_unix-audisp-af_unix.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='audisp-af_unix.c' object='audisp_af_unix-audisp-af_unix.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_af_unix_CFLAGS) $(CFLAGS) -c -o audisp_af_unix-audisp-af_unix.obj `if test -f 'audisp-af_unix.c'; then $(CYGPATH_W) 'audisp-af_unix.c'; else $(CYGPATH_W) '$(srcdir)/audisp-af_unix.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man8: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man8dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man8dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man8dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.8[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \ done; } uninstall-man8: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man8dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.8[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man8dir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(MANS) installdirs: for dir in "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man8dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-sbinPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/audisp_af_unix-audisp-af_unix.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-sbinPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man8 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/audisp_af_unix-audisp-af_unix.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-man uninstall-sbinPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook uninstall-man: uninstall-man8 .MAKE: install-am install-data-am install-strip uninstall-am .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-sbinPROGRAMS cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-data-hook install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man8 \ install-pdf install-pdf-am install-ps install-ps-am \ install-sbinPROGRAMS install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-hook \ uninstall-man uninstall-man8 uninstall-sbinPROGRAMS .PRECIOUS: Makefile install-data-hook: mkdir -p -m 0750 ${DESTDIR}${plugin_confdir} for i in $(CONF_FILES); do \ $(INSTALL_DATA) -D -m 640 ${srcdir}/"$$i" \ ${DESTDIR}${plugin_confdir}; \ done uninstall-hook: for i in $(CONF_FILES); do \ rm ${DESTDIR}${plugin_confdir}/"$$i"; \ done # 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: audit-4.0.2/audisp/plugins/af_unix/Makefile.am0000644001034500103450000000336114655201403014742 # Makefile.am-- # Copyright 2023 Red Hat Inc. # All Rights Reserved. # # 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; see the file COPYING. If not, write to the # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor # Boston, MA 02110-1335, USA. # # Authors: # Steve Grubb # CONFIG_CLEAN_FILES = *.rej *.orig CONF_FILES = af_unix.conf EXTRA_DIST = $(CONF_FILES) $(man_MANS) AM_CPPFLAGS = -I${top_srcdir} -I${top_srcdir}/lib -I${top_srcdir}/common prog_confdir = $(sysconfdir)/audit plugin_confdir=$(prog_confdir)/plugins.d plugin_conf = af_unix.conf sbin_PROGRAMS = audisp-af_unix man_MANS = audisp-af_unix.8 audisp_af_unix_DEPENDENCIES = ${top_builddir}/common/libaucommon.la audisp_af_unix_SOURCES = audisp-af_unix.c audisp_af_unix_CFLAGS = -fPIE -DPIE -g -D_GNU_SOURCE -Wundef ${WFLAGS} audisp_af_unix_LDFLAGS = -pie -Wl,-z,relro -Wl,-z,now audisp_af_unix_LDADD = $(CAPNG_LDADD) ${top_builddir}/common/libaucommon.la install-data-hook: mkdir -p -m 0750 ${DESTDIR}${plugin_confdir} for i in $(CONF_FILES); do \ $(INSTALL_DATA) -D -m 640 ${srcdir}/"$$i" \ ${DESTDIR}${plugin_confdir}; \ done uninstall-hook: for i in $(CONF_FILES); do \ rm ${DESTDIR}${plugin_confdir}/"$$i"; \ done audit-4.0.2/audisp/plugins/af_unix/audisp-af_unix.80000644001034500103450000000127614655201403015716 .TH AUDISP-AF_UNIX "8" "Apr 2023" "Red Hat" "System Administration Utilities" .SH NAME audisp-af_unix \- plugin to push audit events to an af_unix socket .SH SYNOPSIS .B audisp-af_unix [ \fIOPTIONS\fP ] .SH DESCRIPTION \fBaudisp-af_unix\fP is a plugin for the audit event dispatcher that sends audit events to an af_unix socket where other applications can read events. The .B args line of the .B af_unix.conf file expects two arguments: the access mode and the path to the socket. The default values are 0640 and /var/run/audispd_events respectively. .SH FILES /etc/audit/plugins/af_unix.conf /etc/audit/auditd.conf .SH "SEE ALSO" .BR auditd.conf (8), .BR auditd-plugins (5). .SH AUTHOR Steve Grubb audit-4.0.2/audisp/plugins/ids/0000755001034500103450000000000014655201457012122 5audit-4.0.2/audisp/plugins/ids/audisp-ids.conf0000644001034500103450000000024414655201403014742 # This file controls the configuration of the # audisp-ids plugin. active = no direction = out path = /usr/sbin/audisp-ids type = always args = 1 format = string audit-4.0.2/audisp/plugins/ids/ids_config.h0000644001034500103450000000332314655201403014307 /* ids_config.h -- * * Authors: * Steve Grubb * */ #ifndef IDS_CONFIG_HEADER #define IDS_CONFIG_HEADER #include // Notifications #define REACTION_IGNORE 0x0000001 #define REACTION_LOG 0x0000002 #define REACTION_EMAIL 0x0000004 // Bad process defenses #define REACTION_TERMINATE_PROCESS 0x0000010 // freeze process? // Bad session defenses #define REACTION_TERMINATE_SESSION 0x0000100 // Account defenses #define REACTION_RESTRICT_ROLE 0x0001000 #define REACTION_PASSWORD_RESET 0x0002000 #define REACTION_LOCK_ACCOUNT_TIMED 0x0004000 #define REACTION_LOCK_ACCOUNT 0x0008000 // drop supplemental groups? // Remote system defenses #define REACTION_BLOCK_ADDRESS_TIMED 0x0010000 #define REACTION_BLOCK_ADDRESS 0x0020000 // System defenses // sysctls, selinux booleans // update specific rpm, all rpms // restart service // drop service timed <- check this against list of things that can't be dropped // System terminations // Drop network timed #define REACTION_SYSTEM_REBOOT 0x2000000 #define REACTION_SYSTEM_SINGLE_USER 0x4000000 #define REACTION_SYSTEM_HALT 0x8000000 struct ids_conf { unsigned int option_origin_failed_logins_threshold; unsigned int option_origin_failed_logins_reaction; unsigned int option_session_badness1_threshold; unsigned int option_session_badness1_reaction; unsigned int option_service_login_allowed; unsigned int option_service_login_weight; unsigned int option_root_login_allowed; unsigned int option_root_login_weight; unsigned int option_bad_login_weight; }; int load_config(struct ids_conf *config); void reset_config(struct ids_conf *config); void free_config(struct ids_conf *config); void dump_config(struct ids_conf *config, FILE *f); #endif audit-4.0.2/audisp/plugins/ids/README.md0000644001034500103450000000100414655201403013303 This is an experimental Intrusion Detection System (IDS) plugin. It's goal is to either identify or react to suspicious activity. This is a work in progress and is subject to either be completed or dropped in it's entirety at its author's descretion. So, if you would like to test it and report issues or even contribute code feel free to do so. But please discuss the contribution first to ensure that its acceptable. This project uses the Linux Kernel Style Guideline. Please follow it if you wish to contribute. audit-4.0.2/audisp/plugins/ids/session.c0000644001034500103450000000725714655201403013673 /* session.c -- * * Authors: * Steve Grubb * */ #include "config.h" #include #include #include "ids.h" #include "ids_config.h" #include "origin.h" #include "account.h" #include "session.h" #include "reactions.h" // This holds info about all sessions struct session_avl{ avl_tree_t index; unsigned int count; }; static struct session_avl sessions; static session_data_t *cur = NULL; static int cmp_sessions(void *a, void *b) { return (((session_data_t *)a)->session - ((session_data_t *)b)->session); } void init_sessions(void) { sessions.count = 0; cur = NULL; avl_init(&sessions.index, cmp_sessions); } unsigned int get_num_sessions(void) { return sessions.count; } static int dump_session(void *entry, void *data) { FILE *f = data; session_data_t *s = entry; fprintf(f, "\n"); fprintf(f, " session: %u\n", s->session); fprintf(f, " score: %u\n", s->score); fprintf(f, " killed: %u\n", s->killed); fprintf(f, " origin: %s\n", sockint_to_ipv4(s->origin)); fprintf(f, " acct: %s\n", s->acct); return 0; } void traverse_sessions(FILE *f) { fprintf(f, "Sessions\n"); fprintf(f, "========\n"); fprintf(f, "count: %u\n", sessions.count); avl_traverse(&sessions.index, dump_session, f); } static void free_session(session_data_t *s) { if (debug) my_printf("Freeing session %u, %p", s->session, s); free((void *)s->acct); free((void *)s); } static void destroy_session(void) { avl_t *cur = sessions.index.root; session_data_t *tmp =(session_data_t *)avl_remove(&sessions.index, cur); if ((avl_t *)tmp != cur) my_printf("session: removal of invalid node"); free_session(tmp); cur = NULL; } void new_session(unsigned int s, unsigned int o, const char *acct) { session_data_t *tmp = malloc(sizeof(session_data_t)); if (tmp) { tmp->session = s; tmp->score = 0; tmp->killed = 0; tmp->origin = o; tmp->acct = acct ? acct : strdup(""); add_session(tmp); } } void destroy_sessions(void) { while (sessions.index.root) { sessions.count--; destroy_session(); } } int add_session(session_data_t *s) { session_data_t *tmp; if (debug) my_printf("Adding session %u, %p", s->session, s); cur = NULL; tmp = (session_data_t *)avl_insert(&sessions.index, (avl_t *)(s)); if (tmp) { if (tmp != s) { if (debug) my_printf("session: duplicate session found"); free_session(s); return 1; } sessions.count++; cur = tmp; // Add origin info origin_data_t *o = find_origin(s->origin); if (o == NULL) new_origin(s->origin); // Add account info account_data_t *a = find_account(s->acct); if (a == NULL) new_account(s->acct); return 1; } else if (debug) my_printf("session: failed inserting session %u", s->session); return 0; } session_data_t *find_session(unsigned int s) { session_data_t tmp; tmp.session = s; cur = (session_data_t *)avl_search(&sessions.index, (avl_t *) &tmp); return cur; } session_data_t *current_session(void) { return cur; } int del_session(unsigned int s) { session_data_t tmp1, *tmp2; tmp1.session = s; if (debug) my_printf("Deleting %u", s); cur = NULL; tmp2 = (session_data_t *)avl_remove(&sessions.index, (avl_t *) &tmp1); if (tmp2) { sessions.count--; if (tmp2->session != s) { if (debug) my_printf("session: deleting unknown session"); return 1; } } else { if (debug) my_printf("session: didn't find session"); return 1; } // Now free any data pointed to by tmp2 free_session(tmp2); return 0; } void add_to_score_session(session_data_t *s, unsigned int adj) { cur = s; if (s == NULL) { if (debug) my_printf("session is NULL adding score"); return; } s->score += adj; if (debug) my_printf("session score: %u", s->score); } audit-4.0.2/audisp/plugins/ids/account.h0000644001034500103450000000125014655201403013634 /* account.h -- * * Authors: * Steve Grubb * */ #ifndef ACCOUNT_HEADER #define ACCOUNT_HEADER #include #include "avl.h" typedef struct account_data { avl_t avl; // This has to be first const char *name; unsigned int karma; } account_data_t; void init_accounts(void); void destroy_accounts(void); void new_account(const char *name); unsigned int get_num_accounts(void); void traverse_accounts(FILE *f); int add_account(account_data_t *a); account_data_t *find_account(const char *name); account_data_t *current_account(void); int del_account(const char *name); void add_to_score_account(account_data_t *a, unsigned int adj); #endif audit-4.0.2/audisp/plugins/ids/reactions.c0000644001034500103450000001512114655201403014164 /* reactions.c -- * * Authors: * Steve Grubb * */ #include "config.h" #include #include #include #include #include #include #include #include // nanosleep #include #include #include #include "ids.h" #include "ids_config.h" #include "reactions.h" #include "session.h" #include "timer-services.h" // Returns 0 on success and 1 on failure static int safe_exec(const char *exe, ...) { char **argv; va_list ap; unsigned int i; int pid; struct sigaction sa; if (exe == NULL) { syslog(LOG_ALERT, "Safe_exec passed NULL for program to execute"); return 1; } pid = fork(); if (pid < 0) { syslog(LOG_ALERT, "Audit IDS failed to fork doing safe_exec"); return 1; } if (pid) /* Parent */ return 0; // FIXME: should we waitpid to know if it succeeded? /* Child */ sigfillset (&sa.sa_mask); sigprocmask (SIG_UNBLOCK, &sa.sa_mask, 0); va_start(ap, exe); for (i = 1; va_arg(ap, char *) != NULL; i++); va_end(ap); argv = alloca(i * sizeof(char *)); va_start(ap, exe); argv[0] = (char *) exe; for (i = 1; (argv[i] = (char *) va_arg(ap, char *)) != NULL; i++); va_end(ap); argv[i] = NULL; execve(exe, argv, NULL); syslog(LOG_ALERT, "Audit IDS failed to exec %s", exe); exit(1); } static void minipause(void) { struct timespec ts; ts.tv_sec = 0; ts.tv_nsec = 120 * 1000 * 1000; // 120 milliseconds nanosleep(&ts, NULL); } int kill_process(pid_t pid) { if (pid <= 0) return 1; if (debug) my_printf("reaction kill -KILL %d", pid); return kill(pid, SIGKILL); } int kill_session(int session) { char ses[16]; // Do not kill session -1 or the system will die if (session < 0) return 1; snprintf(ses, sizeof(ses), "%d", session); if (debug) my_printf("reaction killall -d %s", ses); return safe_exec("/usr/bin/killall", "-d", ses, NULL); } static int uid_min = -1; static void read_uid_min(void) { FILE *f; char buf[100]; int uid = -1; if (uid_min > 0) return; f = fopen("/etc/login.defs", "r"); if (f == NULL) return; __fsetlocking(f, FSETLOCKING_BYCALLER); while (fgets(buf, sizeof(buf), f)) { if (memcmp(buf, "UID_MIN", 7) == 0) { if (sscanf(buf, "UID_MIN %d", &uid) == 1) { if (uid != -1) { uid_min = uid; if (debug) my_printf("uid_min set to %d", uid_min); } } break; } } fclose(f); } /* returns 0 if user account and 1 on anything else */ static int verify_acct(const char *acct) { struct passwd *pw; if (acct == NULL) return 1; // Make sure valid acct errno = 0; pw = getpwnam(acct); if (pw == NULL || errno) return 1; // Make sure not a daemon if (strstr(pw->pw_shell, "nologin")) return 1; if (uid_min < 0) { read_uid_min(); if (uid_min < 0) return 1; } if ((int)pw->pw_uid < uid_min) return 1; return 0; } int restricted_role(const char *acct) { int rc; if (verify_acct(acct)) return 1; // Restrict to guest user rc = safe_exec("/usr/sbin/semanage", "login", "-m", "-s", "guest_u", acct); if (rc) return rc; // Need to force a logout of all sessions for the user return safe_exec("/usr/bin/killall", "--user", acct); } int force_password_reset(const char *acct) { if (verify_acct(acct)) return 1; return safe_exec("/usr/bin/chage", "-d", "0", acct); } int lock_account(const char *acct) { if (verify_acct(acct)) return 1; return safe_exec("/usr/bin/passwd", "-l", acct); } int unlock_account(const char *acct) { if (verify_acct(acct)) return 1; return safe_exec("/usr/bin/passwd", "-u", acct); } int lock_account_timed(const char *acct, unsigned long length) { int rc = lock_account(acct); if (rc) return rc; add_timer_job(UNLOCK_ACCOUNT, acct, length); return 0; } int block_ip_address(const char *addr) { if (debug) my_printf("reaction /sbin/iptables -I INPUT -s %s -j DROP", addr); minipause(); return safe_exec("/usr/sbin/iptables", "-I", "INPUT", "-s", addr, "-j","DROP", NULL); } int block_ip_address_timed(const char *addr, unsigned long length) { int rc = block_ip_address(addr); if (rc) return rc; add_timer_job(UNBLOCK_ADDRESS, addr, length); return 0; } #define MINUTES 60 #define HOURS 60*MINUTES #define DAYS 24*HOURS #define WEEKS 7*DAYS #define MONTHS 30*DAYS static void block_address(unsigned int reaction, const char *reason) { // FIXME: This should be configurable unsigned time_out = 2*MINUTES; int res; char buf[80]; origin_data_t *o = current_origin(); const char *addr = sockint_to_ipv4(o->address); if (debug) my_printf("Blocking address %s b/c %s", addr, reason); if (reaction == REACTION_BLOCK_ADDRESS) res = block_ip_address(addr); else res = block_ip_address_timed(addr, time_out); if (res == 0) { o->blocked = 1; if (reaction == REACTION_BLOCK_ADDRESS) { snprintf(buf, sizeof(buf), "daddr=%.16s reason=%s", addr, reason); log_audit_event(AUDIT_RESP_ORIGIN_BLOCK, buf, 1); } else { snprintf(buf, sizeof(buf), "daddr=%.16s reason=%s time_out=%u", addr, reason, time_out/MINUTES); log_audit_event(AUDIT_RESP_ORIGIN_BLOCK_TIMED, buf, 1); } } } int unblock_ip_address(const char *addr) { if (debug) my_printf("reaction /sbin/iptables -D INPUT -s %s -j DROP", addr); minipause(); return safe_exec("/usr/sbin/iptables", "-D", "INPUT", "-s", addr, "-j","DROP", NULL); } int system_reboot(void) { return safe_exec("/sbin/init", "6"); } int system_single_user(void) { return safe_exec("/sbin/init", "1"); } int system_halt(void) { return safe_exec("/sbin/init", "0"); } void do_reaction(unsigned int answer, const char *reason) { //my_printf("Answer: %u", answer); unsigned int num = 0; do { unsigned int tmp = 1 << num; if (answer & tmp) { switch (tmp) { // FIXME: do the reactions case REACTION_IGNORE: break; case REACTION_LOG: case REACTION_EMAIL: case REACTION_TERMINATE_PROCESS: break; case REACTION_TERMINATE_SESSION: { // FIXME: need to add audit events session_data_t *s = current_session(); kill_session(s->session); break; } case REACTION_RESTRICT_ROLE: case REACTION_PASSWORD_RESET: case REACTION_LOCK_ACCOUNT_TIMED: case REACTION_LOCK_ACCOUNT: break; case REACTION_BLOCK_ADDRESS_TIMED: case REACTION_BLOCK_ADDRESS: block_address(tmp, reason); break; case REACTION_SYSTEM_REBOOT: case REACTION_SYSTEM_SINGLE_USER: case REACTION_SYSTEM_HALT: break; default: if (debug) my_printf("Unknown reaction: %X", tmp); break; } } num++; } while (num < 32); } audit-4.0.2/audisp/plugins/ids/ids.conf0000644001034500103450000000051614655201403013461 option_origin_failed_logins_threshold = 6 option_origin_failed_logins_reaction = block_address option_session_badness1_threshold = 8 option_session_badness1_reaction = block_address option_service_login_allowed = 0 option_service_login_weight = 7 option_root_login_allowed = 0 option_root_login_weight = 7 option_bad_login_weight = 1 audit-4.0.2/audisp/plugins/ids/model_behavior.c0000644001034500103450000000625514655201403015164 /* model_behavior.c -- * * Authors: * Steve Grubb * */ #include "config.h" #include #include #include "ids.h" #include "session.h" #include "origin.h" #include "model_behavior.h" #include "reactions.h" /* Local Data */ static void process_plain_syscalls(auparse_state_t *au) { if (auparse_normalize_key(au) == 1) { uint32_t s = -2; const char *key = auparse_interpret_field(au); // If its a key we don't care about, skip it. if (strncmp(key, "ids-", 4)) return; if (auparse_normalize_session(au) == 1) { const char *ses = auparse_get_field_str(au); if (ses && strcmp(ses, DAEMON_SESSION)) s = auparse_get_field_int(au); } // For now, do not process daemon events if ((int32_t)s < 0) return; session_data_t *sess = find_session(s); if (sess) { if (strcmp(key, "ids-recon") == 0) { add_to_score_session(sess, 2); } else if (strcmp(key, "ids-archive") == 0) { add_to_score_session(sess, 5); } else if (strcmp(key, "ids-mkexec") == 0) { add_to_score_session(sess, 4); } else if (strcmp(key, "ids-connections") == 0) { add_to_score_session(sess, 6); } } } } static void process_anomalies(auparse_state_t *au) { if (auparse_normalize_session(au) == 1) { const char *ses = auparse_get_field_str(au); if (ses && strcmp(ses, DAEMON_SESSION)) { unsigned int s = auparse_get_field_int(au); session_data_t *sess = find_session(s); if (sess) { auparse_first_record(au); int type = auparse_get_type(au); if (type == AUDIT_FANOTIFY) add_to_score_session(sess, 12); else add_to_score_session(sess, 2); } } } } /* This function receives a single complete event from the auparse library. */ void process_behavior_model(auparse_state_t *au, struct ids_conf *config) { unsigned int answer = 0; auparse_first_record(au); int type = auparse_get_type(au); /* Now we can branch based on what the first record type we find. */ switch (type) { case AUDIT_SYSCALL: process_plain_syscalls(au); break; //case SECCOMP: case AUDIT_FANOTIFY: case AUDIT_AVC: case AUDIT_ANOM_PROMISCUOUS: case AUDIT_ANOM_ABEND: case AUDIT_ANOM_LINK: // Handle these by looking for session. If // not in a session handle by process process_anomalies(au); break; case AUDIT_USER_MGMT: case AUDIT_ADD_USER: case AUDIT_DEL_USER: case AUDIT_ADD_GROUP: case AUDIT_DEL_GROUP: case AUDIT_GRP_MGMT: break; case AUDIT_USER_AUTH: case AUDIT_USER_ACCT: case AUDIT_GRP_AUTH: // watch for failures in auth break; default: break; } origin_data_t *o = current_origin(); session_data_t *s = current_session(); if (o && s) { if (s->score >= config->option_session_badness1_threshold && s->killed == 0) { //AUDIT_ANOM_SESSION answer |= config->option_session_badness1_reaction; do_reaction(answer, "session_bad"); if (s->killed >= 1) add_to_score_origin(o, 5); else add_to_score_origin(o, 2); } } if (o && o->karma >= config->option_origin_failed_logins_threshold && !o->blocked) { //AUDIT_ANOM_ORIGIN_FAILURES answer |= config->option_origin_failed_logins_reaction; do_reaction(answer, "failed_login"); } } audit-4.0.2/audisp/plugins/ids/Makefile.in0000644001034500103450000014364214655201422014111 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am -- # Copyright 2021 Steve Grubb # All Rights Reserved. # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. If not, write to the # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor # Boston, MA 02110-1335, USA. # # Authors: # Steve Grubb # 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@ sbin_PROGRAMS = audisp-ids$(EXEEXT) subdir = audisp/plugins/ids ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prog_cc_for_build.m4 \ $(top_srcdir)/m4/cap-ng.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/src/libev/libev.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(sbindir)" PROGRAMS = $(sbin_PROGRAMS) am_audisp_ids_OBJECTS = audisp_ids-account.$(OBJEXT) \ audisp_ids-avl.$(OBJEXT) audisp_ids-ids.$(OBJEXT) \ audisp_ids-ids_config.$(OBJEXT) \ audisp_ids-model_bad_event.$(OBJEXT) \ audisp_ids-model_behavior.$(OBJEXT) \ audisp_ids-nvpair.$(OBJEXT) audisp_ids-origin.$(OBJEXT) \ audisp_ids-reactions.$(OBJEXT) audisp_ids-session.$(OBJEXT) \ audisp_ids-timer-services.$(OBJEXT) audisp_ids_OBJECTS = $(am_audisp_ids_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = audisp_ids_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(audisp_ids_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/audisp_ids-account.Po \ ./$(DEPDIR)/audisp_ids-avl.Po ./$(DEPDIR)/audisp_ids-ids.Po \ ./$(DEPDIR)/audisp_ids-ids_config.Po \ ./$(DEPDIR)/audisp_ids-model_bad_event.Po \ ./$(DEPDIR)/audisp_ids-model_behavior.Po \ ./$(DEPDIR)/audisp_ids-nvpair.Po \ ./$(DEPDIR)/audisp_ids-origin.Po \ ./$(DEPDIR)/audisp_ids-reactions.Po \ ./$(DEPDIR)/audisp_ids-session.Po \ ./$(DEPDIR)/audisp_ids-timer-services.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(audisp_ids_SOURCES) DIST_SOURCES = $(audisp_ids_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ README.md TODO DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILD_EXEEXT = @BUILD_EXEEXT@ BUILD_OBJEXT = @BUILD_OBJEXT@ CAPNG_LDADD = @CAPNG_LDADD@ CAPNG_PKG = @CAPNG_PKG@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_FOR_BUILD = @CC_FOR_BUILD@ CFLAGS = @CFLAGS@ CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ CPP_FOR_BUILD = @CPP_FOR_BUILD@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG = @DEBUG@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GOLANG = @GOLANG@ GOROOT = @GOROOT@ 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@ LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBWRAP_LIBS = @LIBWRAP_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PYTHON = @PYTHON@ PYTHON3_CFLAGS = @PYTHON3_CFLAGS@ PYTHON3_INCLUDES = @PYTHON3_INCLUDES@ PYTHON3_LIBS = @PYTHON3_LIBS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ VERSION = @VERSION@ WFLAGS = @WFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CC_FOR_BUILD = @ac_ct_CC_FOR_BUILD@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gss_libs = @gss_libs@ 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@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ use_python3 = @use_python3@ CONFIG_CLEAN_FILES = *.loT *.rej *.orig EXTRA_DIST = audisp-ids.conf ids.conf TODO README.md SUBDIRS = rules AM_CPPFLAGS = -I${top_srcdir} -I${top_srcdir}/lib -I${top_srcdir}/common -I${top_srcdir}/auparse prog_confdir = $(sysconfdir)/audit prog_conf = ids.conf plugin_confdir = $(prog_confdir)/plugins.d plugin_conf = audisp-ids.conf noinst_HEADERS = account.h avl.h ids_config.h gcc-attributes.h ids.h \ model_bad_event.h model_behavior.h nvpair.h origin.h \ reactions.h session.h timer-services.h audisp_ids_DEPENDENCIES = ${top_builddir}/common/libaucommon.la audisp_ids_SOURCES = account.c avl.c ids.c ids_config.c model_bad_event.c \ model_behavior.c nvpair.c origin.c reactions.c session.c \ timer-services.c audisp_ids_CFLAGS = -D_GNU_SOURCE ${WFLAGS} audisp_ids_LDADD = ${top_builddir}/lib/libaudit.la ${top_builddir}/auparse/libauparse.la ${top_builddir}/common/libaucommon.la all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu audisp/plugins/ids/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu audisp/plugins/ids/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(sbindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ } \ ; done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(sbindir)" && rm -f $$files clean-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list audisp-ids$(EXEEXT): $(audisp_ids_OBJECTS) $(audisp_ids_DEPENDENCIES) $(EXTRA_audisp_ids_DEPENDENCIES) @rm -f audisp-ids$(EXEEXT) $(AM_V_CCLD)$(audisp_ids_LINK) $(audisp_ids_OBJECTS) $(audisp_ids_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audisp_ids-account.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audisp_ids-avl.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audisp_ids-ids.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audisp_ids-ids_config.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audisp_ids-model_bad_event.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audisp_ids-model_behavior.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audisp_ids-nvpair.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audisp_ids-origin.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audisp_ids-reactions.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audisp_ids-session.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audisp_ids-timer-services.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< audisp_ids-account.o: account.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_ids_CFLAGS) $(CFLAGS) -MT audisp_ids-account.o -MD -MP -MF $(DEPDIR)/audisp_ids-account.Tpo -c -o audisp_ids-account.o `test -f 'account.c' || echo '$(srcdir)/'`account.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audisp_ids-account.Tpo $(DEPDIR)/audisp_ids-account.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='account.c' object='audisp_ids-account.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_ids_CFLAGS) $(CFLAGS) -c -o audisp_ids-account.o `test -f 'account.c' || echo '$(srcdir)/'`account.c audisp_ids-account.obj: account.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_ids_CFLAGS) $(CFLAGS) -MT audisp_ids-account.obj -MD -MP -MF $(DEPDIR)/audisp_ids-account.Tpo -c -o audisp_ids-account.obj `if test -f 'account.c'; then $(CYGPATH_W) 'account.c'; else $(CYGPATH_W) '$(srcdir)/account.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audisp_ids-account.Tpo $(DEPDIR)/audisp_ids-account.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='account.c' object='audisp_ids-account.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_ids_CFLAGS) $(CFLAGS) -c -o audisp_ids-account.obj `if test -f 'account.c'; then $(CYGPATH_W) 'account.c'; else $(CYGPATH_W) '$(srcdir)/account.c'; fi` audisp_ids-avl.o: avl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_ids_CFLAGS) $(CFLAGS) -MT audisp_ids-avl.o -MD -MP -MF $(DEPDIR)/audisp_ids-avl.Tpo -c -o audisp_ids-avl.o `test -f 'avl.c' || echo '$(srcdir)/'`avl.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audisp_ids-avl.Tpo $(DEPDIR)/audisp_ids-avl.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='avl.c' object='audisp_ids-avl.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_ids_CFLAGS) $(CFLAGS) -c -o audisp_ids-avl.o `test -f 'avl.c' || echo '$(srcdir)/'`avl.c audisp_ids-avl.obj: avl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_ids_CFLAGS) $(CFLAGS) -MT audisp_ids-avl.obj -MD -MP -MF $(DEPDIR)/audisp_ids-avl.Tpo -c -o audisp_ids-avl.obj `if test -f 'avl.c'; then $(CYGPATH_W) 'avl.c'; else $(CYGPATH_W) '$(srcdir)/avl.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audisp_ids-avl.Tpo $(DEPDIR)/audisp_ids-avl.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='avl.c' object='audisp_ids-avl.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_ids_CFLAGS) $(CFLAGS) -c -o audisp_ids-avl.obj `if test -f 'avl.c'; then $(CYGPATH_W) 'avl.c'; else $(CYGPATH_W) '$(srcdir)/avl.c'; fi` audisp_ids-ids.o: ids.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_ids_CFLAGS) $(CFLAGS) -MT audisp_ids-ids.o -MD -MP -MF $(DEPDIR)/audisp_ids-ids.Tpo -c -o audisp_ids-ids.o `test -f 'ids.c' || echo '$(srcdir)/'`ids.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audisp_ids-ids.Tpo $(DEPDIR)/audisp_ids-ids.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ids.c' object='audisp_ids-ids.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_ids_CFLAGS) $(CFLAGS) -c -o audisp_ids-ids.o `test -f 'ids.c' || echo '$(srcdir)/'`ids.c audisp_ids-ids.obj: ids.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_ids_CFLAGS) $(CFLAGS) -MT audisp_ids-ids.obj -MD -MP -MF $(DEPDIR)/audisp_ids-ids.Tpo -c -o audisp_ids-ids.obj `if test -f 'ids.c'; then $(CYGPATH_W) 'ids.c'; else $(CYGPATH_W) '$(srcdir)/ids.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audisp_ids-ids.Tpo $(DEPDIR)/audisp_ids-ids.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ids.c' object='audisp_ids-ids.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_ids_CFLAGS) $(CFLAGS) -c -o audisp_ids-ids.obj `if test -f 'ids.c'; then $(CYGPATH_W) 'ids.c'; else $(CYGPATH_W) '$(srcdir)/ids.c'; fi` audisp_ids-ids_config.o: ids_config.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_ids_CFLAGS) $(CFLAGS) -MT audisp_ids-ids_config.o -MD -MP -MF $(DEPDIR)/audisp_ids-ids_config.Tpo -c -o audisp_ids-ids_config.o `test -f 'ids_config.c' || echo '$(srcdir)/'`ids_config.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audisp_ids-ids_config.Tpo $(DEPDIR)/audisp_ids-ids_config.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ids_config.c' object='audisp_ids-ids_config.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_ids_CFLAGS) $(CFLAGS) -c -o audisp_ids-ids_config.o `test -f 'ids_config.c' || echo '$(srcdir)/'`ids_config.c audisp_ids-ids_config.obj: ids_config.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_ids_CFLAGS) $(CFLAGS) -MT audisp_ids-ids_config.obj -MD -MP -MF $(DEPDIR)/audisp_ids-ids_config.Tpo -c -o audisp_ids-ids_config.obj `if test -f 'ids_config.c'; then $(CYGPATH_W) 'ids_config.c'; else $(CYGPATH_W) '$(srcdir)/ids_config.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audisp_ids-ids_config.Tpo $(DEPDIR)/audisp_ids-ids_config.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ids_config.c' object='audisp_ids-ids_config.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_ids_CFLAGS) $(CFLAGS) -c -o audisp_ids-ids_config.obj `if test -f 'ids_config.c'; then $(CYGPATH_W) 'ids_config.c'; else $(CYGPATH_W) '$(srcdir)/ids_config.c'; fi` audisp_ids-model_bad_event.o: model_bad_event.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_ids_CFLAGS) $(CFLAGS) -MT audisp_ids-model_bad_event.o -MD -MP -MF $(DEPDIR)/audisp_ids-model_bad_event.Tpo -c -o audisp_ids-model_bad_event.o `test -f 'model_bad_event.c' || echo '$(srcdir)/'`model_bad_event.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audisp_ids-model_bad_event.Tpo $(DEPDIR)/audisp_ids-model_bad_event.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='model_bad_event.c' object='audisp_ids-model_bad_event.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_ids_CFLAGS) $(CFLAGS) -c -o audisp_ids-model_bad_event.o `test -f 'model_bad_event.c' || echo '$(srcdir)/'`model_bad_event.c audisp_ids-model_bad_event.obj: model_bad_event.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_ids_CFLAGS) $(CFLAGS) -MT audisp_ids-model_bad_event.obj -MD -MP -MF $(DEPDIR)/audisp_ids-model_bad_event.Tpo -c -o audisp_ids-model_bad_event.obj `if test -f 'model_bad_event.c'; then $(CYGPATH_W) 'model_bad_event.c'; else $(CYGPATH_W) '$(srcdir)/model_bad_event.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audisp_ids-model_bad_event.Tpo $(DEPDIR)/audisp_ids-model_bad_event.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='model_bad_event.c' object='audisp_ids-model_bad_event.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_ids_CFLAGS) $(CFLAGS) -c -o audisp_ids-model_bad_event.obj `if test -f 'model_bad_event.c'; then $(CYGPATH_W) 'model_bad_event.c'; else $(CYGPATH_W) '$(srcdir)/model_bad_event.c'; fi` audisp_ids-model_behavior.o: model_behavior.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_ids_CFLAGS) $(CFLAGS) -MT audisp_ids-model_behavior.o -MD -MP -MF $(DEPDIR)/audisp_ids-model_behavior.Tpo -c -o audisp_ids-model_behavior.o `test -f 'model_behavior.c' || echo '$(srcdir)/'`model_behavior.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audisp_ids-model_behavior.Tpo $(DEPDIR)/audisp_ids-model_behavior.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='model_behavior.c' object='audisp_ids-model_behavior.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_ids_CFLAGS) $(CFLAGS) -c -o audisp_ids-model_behavior.o `test -f 'model_behavior.c' || echo '$(srcdir)/'`model_behavior.c audisp_ids-model_behavior.obj: model_behavior.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_ids_CFLAGS) $(CFLAGS) -MT audisp_ids-model_behavior.obj -MD -MP -MF $(DEPDIR)/audisp_ids-model_behavior.Tpo -c -o audisp_ids-model_behavior.obj `if test -f 'model_behavior.c'; then $(CYGPATH_W) 'model_behavior.c'; else $(CYGPATH_W) '$(srcdir)/model_behavior.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audisp_ids-model_behavior.Tpo $(DEPDIR)/audisp_ids-model_behavior.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='model_behavior.c' object='audisp_ids-model_behavior.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_ids_CFLAGS) $(CFLAGS) -c -o audisp_ids-model_behavior.obj `if test -f 'model_behavior.c'; then $(CYGPATH_W) 'model_behavior.c'; else $(CYGPATH_W) '$(srcdir)/model_behavior.c'; fi` audisp_ids-nvpair.o: nvpair.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_ids_CFLAGS) $(CFLAGS) -MT audisp_ids-nvpair.o -MD -MP -MF $(DEPDIR)/audisp_ids-nvpair.Tpo -c -o audisp_ids-nvpair.o `test -f 'nvpair.c' || echo '$(srcdir)/'`nvpair.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audisp_ids-nvpair.Tpo $(DEPDIR)/audisp_ids-nvpair.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nvpair.c' object='audisp_ids-nvpair.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_ids_CFLAGS) $(CFLAGS) -c -o audisp_ids-nvpair.o `test -f 'nvpair.c' || echo '$(srcdir)/'`nvpair.c audisp_ids-nvpair.obj: nvpair.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_ids_CFLAGS) $(CFLAGS) -MT audisp_ids-nvpair.obj -MD -MP -MF $(DEPDIR)/audisp_ids-nvpair.Tpo -c -o audisp_ids-nvpair.obj `if test -f 'nvpair.c'; then $(CYGPATH_W) 'nvpair.c'; else $(CYGPATH_W) '$(srcdir)/nvpair.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audisp_ids-nvpair.Tpo $(DEPDIR)/audisp_ids-nvpair.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nvpair.c' object='audisp_ids-nvpair.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_ids_CFLAGS) $(CFLAGS) -c -o audisp_ids-nvpair.obj `if test -f 'nvpair.c'; then $(CYGPATH_W) 'nvpair.c'; else $(CYGPATH_W) '$(srcdir)/nvpair.c'; fi` audisp_ids-origin.o: origin.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_ids_CFLAGS) $(CFLAGS) -MT audisp_ids-origin.o -MD -MP -MF $(DEPDIR)/audisp_ids-origin.Tpo -c -o audisp_ids-origin.o `test -f 'origin.c' || echo '$(srcdir)/'`origin.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audisp_ids-origin.Tpo $(DEPDIR)/audisp_ids-origin.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='origin.c' object='audisp_ids-origin.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_ids_CFLAGS) $(CFLAGS) -c -o audisp_ids-origin.o `test -f 'origin.c' || echo '$(srcdir)/'`origin.c audisp_ids-origin.obj: origin.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_ids_CFLAGS) $(CFLAGS) -MT audisp_ids-origin.obj -MD -MP -MF $(DEPDIR)/audisp_ids-origin.Tpo -c -o audisp_ids-origin.obj `if test -f 'origin.c'; then $(CYGPATH_W) 'origin.c'; else $(CYGPATH_W) '$(srcdir)/origin.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audisp_ids-origin.Tpo $(DEPDIR)/audisp_ids-origin.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='origin.c' object='audisp_ids-origin.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_ids_CFLAGS) $(CFLAGS) -c -o audisp_ids-origin.obj `if test -f 'origin.c'; then $(CYGPATH_W) 'origin.c'; else $(CYGPATH_W) '$(srcdir)/origin.c'; fi` audisp_ids-reactions.o: reactions.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_ids_CFLAGS) $(CFLAGS) -MT audisp_ids-reactions.o -MD -MP -MF $(DEPDIR)/audisp_ids-reactions.Tpo -c -o audisp_ids-reactions.o `test -f 'reactions.c' || echo '$(srcdir)/'`reactions.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audisp_ids-reactions.Tpo $(DEPDIR)/audisp_ids-reactions.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='reactions.c' object='audisp_ids-reactions.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_ids_CFLAGS) $(CFLAGS) -c -o audisp_ids-reactions.o `test -f 'reactions.c' || echo '$(srcdir)/'`reactions.c audisp_ids-reactions.obj: reactions.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_ids_CFLAGS) $(CFLAGS) -MT audisp_ids-reactions.obj -MD -MP -MF $(DEPDIR)/audisp_ids-reactions.Tpo -c -o audisp_ids-reactions.obj `if test -f 'reactions.c'; then $(CYGPATH_W) 'reactions.c'; else $(CYGPATH_W) '$(srcdir)/reactions.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audisp_ids-reactions.Tpo $(DEPDIR)/audisp_ids-reactions.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='reactions.c' object='audisp_ids-reactions.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_ids_CFLAGS) $(CFLAGS) -c -o audisp_ids-reactions.obj `if test -f 'reactions.c'; then $(CYGPATH_W) 'reactions.c'; else $(CYGPATH_W) '$(srcdir)/reactions.c'; fi` audisp_ids-session.o: session.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_ids_CFLAGS) $(CFLAGS) -MT audisp_ids-session.o -MD -MP -MF $(DEPDIR)/audisp_ids-session.Tpo -c -o audisp_ids-session.o `test -f 'session.c' || echo '$(srcdir)/'`session.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audisp_ids-session.Tpo $(DEPDIR)/audisp_ids-session.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='session.c' object='audisp_ids-session.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_ids_CFLAGS) $(CFLAGS) -c -o audisp_ids-session.o `test -f 'session.c' || echo '$(srcdir)/'`session.c audisp_ids-session.obj: session.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_ids_CFLAGS) $(CFLAGS) -MT audisp_ids-session.obj -MD -MP -MF $(DEPDIR)/audisp_ids-session.Tpo -c -o audisp_ids-session.obj `if test -f 'session.c'; then $(CYGPATH_W) 'session.c'; else $(CYGPATH_W) '$(srcdir)/session.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audisp_ids-session.Tpo $(DEPDIR)/audisp_ids-session.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='session.c' object='audisp_ids-session.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_ids_CFLAGS) $(CFLAGS) -c -o audisp_ids-session.obj `if test -f 'session.c'; then $(CYGPATH_W) 'session.c'; else $(CYGPATH_W) '$(srcdir)/session.c'; fi` audisp_ids-timer-services.o: timer-services.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_ids_CFLAGS) $(CFLAGS) -MT audisp_ids-timer-services.o -MD -MP -MF $(DEPDIR)/audisp_ids-timer-services.Tpo -c -o audisp_ids-timer-services.o `test -f 'timer-services.c' || echo '$(srcdir)/'`timer-services.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audisp_ids-timer-services.Tpo $(DEPDIR)/audisp_ids-timer-services.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='timer-services.c' object='audisp_ids-timer-services.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_ids_CFLAGS) $(CFLAGS) -c -o audisp_ids-timer-services.o `test -f 'timer-services.c' || echo '$(srcdir)/'`timer-services.c audisp_ids-timer-services.obj: timer-services.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_ids_CFLAGS) $(CFLAGS) -MT audisp_ids-timer-services.obj -MD -MP -MF $(DEPDIR)/audisp_ids-timer-services.Tpo -c -o audisp_ids-timer-services.obj `if test -f 'timer-services.c'; then $(CYGPATH_W) 'timer-services.c'; else $(CYGPATH_W) '$(srcdir)/timer-services.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audisp_ids-timer-services.Tpo $(DEPDIR)/audisp_ids-timer-services.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='timer-services.c' object='audisp_ids-timer-services.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_ids_CFLAGS) $(CFLAGS) -c -o audisp_ids-timer-services.obj `if test -f 'timer-services.c'; then $(CYGPATH_W) 'timer-services.c'; else $(CYGPATH_W) '$(srcdir)/timer-services.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(PROGRAMS) $(HEADERS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(sbindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool clean-sbinPROGRAMS \ mostlyclean-am distclean: distclean-recursive -rm -f ./$(DEPDIR)/audisp_ids-account.Po -rm -f ./$(DEPDIR)/audisp_ids-avl.Po -rm -f ./$(DEPDIR)/audisp_ids-ids.Po -rm -f ./$(DEPDIR)/audisp_ids-ids_config.Po -rm -f ./$(DEPDIR)/audisp_ids-model_bad_event.Po -rm -f ./$(DEPDIR)/audisp_ids-model_behavior.Po -rm -f ./$(DEPDIR)/audisp_ids-nvpair.Po -rm -f ./$(DEPDIR)/audisp_ids-origin.Po -rm -f ./$(DEPDIR)/audisp_ids-reactions.Po -rm -f ./$(DEPDIR)/audisp_ids-session.Po -rm -f ./$(DEPDIR)/audisp_ids-timer-services.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-sbinPROGRAMS install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f ./$(DEPDIR)/audisp_ids-account.Po -rm -f ./$(DEPDIR)/audisp_ids-avl.Po -rm -f ./$(DEPDIR)/audisp_ids-ids.Po -rm -f ./$(DEPDIR)/audisp_ids-ids_config.Po -rm -f ./$(DEPDIR)/audisp_ids-model_bad_event.Po -rm -f ./$(DEPDIR)/audisp_ids-model_behavior.Po -rm -f ./$(DEPDIR)/audisp_ids-nvpair.Po -rm -f ./$(DEPDIR)/audisp_ids-origin.Po -rm -f ./$(DEPDIR)/audisp_ids-reactions.Po -rm -f ./$(DEPDIR)/audisp_ids-session.Po -rm -f ./$(DEPDIR)/audisp_ids-timer-services.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-sbinPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook .MAKE: $(am__recursive_targets) install-am install-data-am \ install-strip uninstall-am .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--depfiles check check-am clean clean-generic clean-libtool \ clean-sbinPROGRAMS cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-data-hook install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-sbinPROGRAMS install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-hook uninstall-sbinPROGRAMS .PRECIOUS: Makefile install-data-hook: mkdir -p -m 0750 ${DESTDIR}${plugin_confdir} $(INSTALL_DATA) -D -m 640 ${srcdir}/$(plugin_conf) ${DESTDIR}${plugin_confdir} $(INSTALL_DATA) -D -m 640 ${srcdir}/$(prog_conf) ${DESTDIR}${prog_confdir} uninstall-hook: rm ${DESTDIR}${plugin_confdir}/$(plugin_conf) # 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: audit-4.0.2/audisp/plugins/ids/avl.h0000644001034500103450000000371314655201403012770 #ifndef AVL_HEADER #define AVL_HEADER #include "gcc-attributes.h" /* Maximum AVL tree height. */ #ifndef AVL_MAX_HEIGHT #define AVL_MAX_HEIGHT 92 #endif /* Data structures */ /* One element of the AVL tree */ typedef struct avl { struct avl *avl_link[2]; /* Subtrees - 0 left, 1 right */ signed char avl_balance; /* Balance factor. */ } avl_t; /* An AVL tree */ typedef struct avl_tree { avl_t *root; int (*compar)(void *a, void *b); } avl_tree_t; /* Iterator state struct */ typedef struct avl_iterator { avl_tree_t *tree; avl_t *current; avl_t *stack[AVL_MAX_HEIGHT]; unsigned height; } avl_iterator; /* Public methods */ /* Insert element a into the AVL tree t * returns the added element a, or a pointer the * element that is equal to a (as returned by t->compar()) * a is linked directly to the tree, so it has to * be properly allocated by the caller. */ avl_t *avl_insert(avl_tree_t *t, avl_t *a) NEVERNULL WARNUNUSED; /* Remove an element a from the AVL tree t * returns a pointer to the removed element * or NULL if an element equal to a is not found * (equal as returned by t->compar()) */ avl_t *avl_remove(avl_tree_t *t, avl_t *a) WARNUNUSED; /* Find the element into the tree that equal to a * (equal as returned by t->compar()) * returns NULL is no element is equal to a */ avl_t *avl_search(const avl_tree_t *t, avl_t *a); /* Initialize the avl_tree_t */ void avl_init(avl_tree_t *t, int (*compar)(void *a, void *b)); /* Walk the tree and call callback at each node */ int avl_traverse(const avl_tree_t *t, int (*callback)(void *entry, void *data), void *data); /* Walk the tree down to the first node and return it */ avl_t *avl_first(avl_iterator *i, avl_tree_t *t); /* Walk the tree to the next logical node and return it */ avl_t *avl_next(avl_iterator *i); /* Given two trees, see if any in needle are contained in haystack */ int avl_intersection(const avl_tree_t *needle, avl_tree_t *haystack); #endif /* avl.h */ audit-4.0.2/audisp/plugins/ids/avl.c0000644001034500103450000003045114655201403012762 #include "config.h" #include // for NULL #include "avl.h" // Note: this file is based on this: // https://github.com/firehol/netdata/blob/master/src/avl.c // c63bdb5 on Oct 23, 2017 // // which has been moved to here (05/23/20): // https://github.com/netdata/netdata/blob/master/libnetdata/avl/avl.c // // However, its been modified to remove pthreads as this application will // only use it from a single thread. /* ------------------------------------------------------------------------- */ /* * avl_insert(), avl_remove() and avl_search() * are adaptations (by Costa Tsaousis) of the AVL algorithm found in libavl * v2.0.3, so that they do not use any memory allocations and their memory * footprint is optimized (by eliminating non-necessary data members). * * libavl - library for manipulation of binary trees. * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004 Free Software * Foundation, Inc. * GNU Lesser General Public License */ /* Search |tree| for an item matching |item|, and return it if found. Otherwise return |NULL|. */ avl_t *avl_search(const avl_tree_t *tree, avl_t *item) { avl_t *p; // assert (tree != NULL && item != NULL); for (p = tree->root; p != NULL; ) { int cmp = tree->compar(item, p); if (cmp < 0) p = p->avl_link[0]; else if (cmp > 0) p = p->avl_link[1]; else /* |cmp == 0| */ return p; } return NULL; } /* Inserts |item| into |tree| and returns a pointer to |item|'s address. If a duplicate item is found in the tree, returns a pointer to the duplicate without inserting |item|. */ avl_t *avl_insert(avl_tree_t *tree, avl_t *item) { avl_t *y, *z; /* Top node to update balance factor, and parent. */ avl_t *p, *q; /* Iterator, and parent. */ avl_t *n; /* Newly inserted node. */ avl_t *w; /* New root of rebalanced subtree. */ unsigned char dir; /* Direction to descend. */ unsigned char da[AVL_MAX_HEIGHT]; /* Cached comparison results. */ int k = 0; /* Number of cached results. */ // assert(tree != NULL && item != NULL); z = (avl_t *) &tree->root; y = tree->root; dir = 0; for (q = z, p = y; p != NULL; q = p, p = p->avl_link[dir]) { int cmp = tree->compar(item, p); if (cmp == 0) return p; if (p->avl_balance != 0) z = q, y = p, k = 0; da[k++] = dir = (cmp > 0); } n = q->avl_link[dir] = item; // tree->avl_count++; n->avl_link[0] = n->avl_link[1] = NULL; n->avl_balance = 0; if (y == NULL) return n; for (p = y, k = 0; p != n; p = p->avl_link[da[k]], k++) if (da[k] == 0) p->avl_balance--; else p->avl_balance++; if (y->avl_balance == -2) { avl_t *x = y->avl_link[0]; if (x->avl_balance == -1) { w = x; y->avl_link[0] = x->avl_link[1]; x->avl_link[1] = y; x->avl_balance = y->avl_balance = 0; } else { // assert (x->avl_balance == +1); w = x->avl_link[1]; x->avl_link[1] = w->avl_link[0]; w->avl_link[0] = x; y->avl_link[0] = w->avl_link[1]; w->avl_link[1] = y; if (w->avl_balance == -1) x->avl_balance = 0, y->avl_balance = +1; else if (w->avl_balance == 0) x->avl_balance = y->avl_balance = 0; else /* |w->avl_balance == +1| */ x->avl_balance = -1, y->avl_balance = 0; w->avl_balance = 0; } } else if (y->avl_balance == +2) { avl_t *x = y->avl_link[1]; if (x->avl_balance == +1) { w = x; y->avl_link[1] = x->avl_link[0]; x->avl_link[0] = y; x->avl_balance = y->avl_balance = 0; } else { // assert (x->avl_balance == -1); w = x->avl_link[0]; x->avl_link[0] = w->avl_link[1]; w->avl_link[1] = x; y->avl_link[1] = w->avl_link[0]; w->avl_link[0] = y; if (w->avl_balance == +1) x->avl_balance = 0, y->avl_balance = -1; else if (w->avl_balance == 0) x->avl_balance = y->avl_balance = 0; else /* |w->avl_balance == -1| */ x->avl_balance = +1, y->avl_balance = 0; w->avl_balance = 0; } } else return n; z->avl_link[y != z->avl_link[0]] = w; // tree->avl_generation++; return n; } /* Deletes from |tree| and returns an item matching |item|. Returns a null pointer if no matching item found. */ avl_t *avl_remove(avl_tree_t *tree, avl_t *item) { /* Stack of nodes. */ avl_t *pa[AVL_MAX_HEIGHT]; /* Nodes. */ unsigned char da[AVL_MAX_HEIGHT]; /* |avl_link[]| indexes. */ int k; /* Stack pointer. */ avl_t *p; /* Traverses tree to find node to delete. */ int cmp; /* Result of comparison between |item| and |p|. */ // assert (tree != NULL && item != NULL); k = 0; p = (avl_t *) &tree->root; for(cmp = -1; cmp != 0; cmp = tree->compar(item, p)) { unsigned char dir = (unsigned char)(cmp > 0); pa[k] = p; da[k++] = dir; p = p->avl_link[dir]; if(p == NULL) return NULL; } item = p; if (p->avl_link[1] == NULL) pa[k - 1]->avl_link[da[k - 1]] = p->avl_link[0]; else { avl_t *r = p->avl_link[1]; if (r->avl_link[0] == NULL) { r->avl_link[0] = p->avl_link[0]; r->avl_balance = p->avl_balance; pa[k - 1]->avl_link[da[k - 1]] = r; da[k] = 1; pa[k++] = r; } else { avl_t *s; int j = k++; for (;;) { da[k] = 0; pa[k++] = r; s = r->avl_link[0]; if (s->avl_link[0] == NULL) break; r = s; } s->avl_link[0] = p->avl_link[0]; r->avl_link[0] = s->avl_link[1]; s->avl_link[1] = p->avl_link[1]; s->avl_balance = p->avl_balance; pa[j - 1]->avl_link[da[j - 1]] = s; da[j] = 1; pa[j] = s; } } // assert (k > 0); while (--k > 0) { avl_t *y = pa[k]; if (da[k] == 0) { y->avl_balance++; if (y->avl_balance == +1) break; else if (y->avl_balance == +2) { avl_t *x = y->avl_link[1]; if (x->avl_balance == -1) { avl_t *w; // assert (x->avl_balance == -1); w = x->avl_link[0]; x->avl_link[0] = w->avl_link[1]; w->avl_link[1] = x; y->avl_link[1] = w->avl_link[0]; w->avl_link[0] = y; if (w->avl_balance == +1) x->avl_balance = 0, y->avl_balance = -1; else if (w->avl_balance == 0) x->avl_balance = y->avl_balance = 0; else /* |w->avl_balance == -1| */ x->avl_balance = +1, y->avl_balance = 0; w->avl_balance = 0; pa[k - 1]->avl_link[da[k - 1]] = w; } else { y->avl_link[1] = x->avl_link[0]; x->avl_link[0] = y; pa[k - 1]->avl_link[da[k - 1]] = x; if (x->avl_balance == 0) { x->avl_balance = -1; y->avl_balance = +1; break; } else x->avl_balance = y->avl_balance = 0; } } } else { y->avl_balance--; if (y->avl_balance == -1) break; else if (y->avl_balance == -2) { avl_t *x = y->avl_link[0]; if (x->avl_balance == +1) { avl_t *w; // assert (x->avl_balance == +1); w = x->avl_link[1]; x->avl_link[1] = w->avl_link[0]; w->avl_link[0] = x; y->avl_link[0] = w->avl_link[1]; w->avl_link[1] = y; if (w->avl_balance == -1) x->avl_balance = 0, y->avl_balance = +1; else if (w->avl_balance == 0) x->avl_balance = y->avl_balance = 0; else /* |w->avl_balance == +1| */ x->avl_balance = -1, y->avl_balance = 0; w->avl_balance = 0; pa[k - 1]->avl_link[da[k - 1]] = w; } else { y->avl_link[0] = x->avl_link[1]; x->avl_link[1] = y; pa[k - 1]->avl_link[da[k - 1]] = x; if (x->avl_balance == 0) { x->avl_balance = +1; y->avl_balance = -1; break; } else x->avl_balance = y->avl_balance = 0; } } } } // tree->avl_count--; // tree->avl_generation++; return item; } /* ------------------------------------------------------------------------- */ // below are functions by (C) Costa Tsaousis // --------------------------- // traversing int avl_walker(avl_t *node, int (*callback)(void *entry, void *data), void *data) { int total = 0, ret = 0; if(node->avl_link[0]) { ret = avl_walker(node->avl_link[0], callback, data); if(ret < 0) return ret; total += ret; } ret = callback(node, data); if(ret < 0) return ret; total += ret; if(node->avl_link[1]) { ret = avl_walker(node->avl_link[1], callback, data); if (ret < 0) return ret; total += ret; } return total; } int avl_traverse(const avl_tree_t *t, int (*callback)(void *entry, void *data), void *data) { if(t->root) return avl_walker(t->root, callback, data); else return 0; } void avl_init(avl_tree_t *t, int (*compar)(void *a, void *b)) { t->root = NULL; t->compar = compar; } /* ------------------------------------------------------------------------- */ // below are functions by (C) Steve Grubb // --------------------------- avl_t *avl_first(avl_iterator *i, avl_tree_t *t) { if (t->root == NULL || i == NULL) return NULL; i->tree = t; i->height = 0; // follow the leftmost node to its bottom avl_t *node = t->root; while (node->avl_link[0]) { i->stack[i->height] = node; i->height++; node = node->avl_link[0]; } i->current = node; return node; } avl_t *avl_next(avl_iterator *i) { if (i == NULL || i->tree == NULL) return NULL; avl_t *node = i->current; if (node == NULL) return avl_first(i, i->tree); else if (node->avl_link[1]) { i->stack[i->height] = node; i->height++; node = node->avl_link[1]; while (node->avl_link[0]) { i->stack[i->height] = node; i->height++; node = node->avl_link[0]; } } else { avl_t *tmp; do { if (i->height == 0) { i->current = NULL; return NULL; } tmp = node; i->height--; node = i->stack[i->height]; } while (tmp == node->avl_link[1]); } i->current = node; return node; } static int avl_walker2(avl_t *node, avl_tree_t *haystack) { int ret; // If the lefthand has a link, take it so that we walk to the // leftmost bottom if(node->avl_link[0]) { ret = avl_walker2(node->avl_link[0], haystack); if (ret) return ret; } // Next, check the current node avl_t *res = avl_search(haystack, node); if (res) return 1; // If the righthand has a link, take it so that we check all the // rightmost nodes, too. if(node->avl_link[1]) { ret = avl_walker2(node->avl_link[1], haystack); if (ret) return ret; } // nothing found return 0; } int avl_intersection(const avl_tree_t *needle, avl_tree_t *haystack) { // traverse the needle and search the haystack // this implies that needle should be smaller than haystack if (needle && haystack && needle->root && haystack->root) return avl_walker2(needle->root, haystack); // something is not initialized, so we cannot search return 0; } audit-4.0.2/audisp/plugins/ids/Makefile.am0000644001034500103450000000402514655201403014066 # Makefile.am -- # Copyright 2021 Steve Grubb # All Rights Reserved. # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. If not, write to the # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor # Boston, MA 02110-1335, USA. # # Authors: # Steve Grubb # CONFIG_CLEAN_FILES = *.loT *.rej *.orig EXTRA_DIST = audisp-ids.conf ids.conf TODO README.md SUBDIRS = rules AM_CPPFLAGS = -I${top_srcdir} -I${top_srcdir}/lib -I${top_srcdir}/common -I${top_srcdir}/auparse prog_confdir = $(sysconfdir)/audit prog_conf = ids.conf plugin_confdir=$(prog_confdir)/plugins.d plugin_conf = audisp-ids.conf sbin_PROGRAMS = audisp-ids noinst_HEADERS = account.h avl.h ids_config.h gcc-attributes.h ids.h \ model_bad_event.h model_behavior.h nvpair.h origin.h \ reactions.h session.h timer-services.h audisp_ids_DEPENDENCIES = ${top_builddir}/common/libaucommon.la audisp_ids_SOURCES = account.c avl.c ids.c ids_config.c model_bad_event.c \ model_behavior.c nvpair.c origin.c reactions.c session.c \ timer-services.c audisp_ids_CFLAGS = -D_GNU_SOURCE ${WFLAGS} audisp_ids_LDADD = ${top_builddir}/lib/libaudit.la ${top_builddir}/auparse/libauparse.la ${top_builddir}/common/libaucommon.la install-data-hook: mkdir -p -m 0750 ${DESTDIR}${plugin_confdir} $(INSTALL_DATA) -D -m 640 ${srcdir}/$(plugin_conf) ${DESTDIR}${plugin_confdir} $(INSTALL_DATA) -D -m 640 ${srcdir}/$(prog_conf) ${DESTDIR}${prog_confdir} uninstall-hook: rm ${DESTDIR}${plugin_confdir}/$(plugin_conf) audit-4.0.2/audisp/plugins/ids/timer-services.c0000644001034500103450000000474014655201403015143 /* timer-services.c -- * Copyright 2021 Steve Grubb. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb * */ #include "config.h" #include #include #include // for snprintf #include "timer-services.h" #include "nvpair.h" #include "reactions.h" #include "ids.h" #include "origin.h" static nvlist jobs; static time_t now; // Something to think about, jobs should probably be persistent so that // we can resume them after starting back up. void init_timer_services(void) { nvpair_list_create(&jobs); now = time(NULL); } void do_timer_services(unsigned int interval) { now += interval; rerun_jobs: while (nvpair_list_find_job(&jobs, now)) { nvnode *j = nvpair_list_get_cur(&jobs); switch (j->job) { case UNLOCK_ACCOUNT: unlock_account(j->arg); // Should we reset the stats? break; case UNBLOCK_ADDRESS: { // Send iptables rule int res = unblock_ip_address(j->arg); // Log that its back in business char buf[24]; snprintf(buf, sizeof(buf), "daddr=%.16s", j->arg); log_audit_event( AUDIT_RESP_ORIGIN_UNBLOCK_TIMED, buf, !res); // Reset origin state unblock_origin(j->arg); } break; default: break; } nvpair_list_delete_cur(&jobs); } // Every 10 minutes resync to the clock if (now%600 > interval) { time_t cur = now; now = time(NULL); if (now > cur) { if (debug) my_printf("Time jumped - rerunning jobs"); goto rerun_jobs; } } } void add_timer_job(jobs_t job, const char *arg, unsigned long length) { nvnode node; node.job = job; node.arg = strdup(arg); node.expiration = time(NULL) + length; nvpair_list_append(&jobs, &node); } void shutdown_timer_services(void) { nvpair_list_clear(&jobs); } audit-4.0.2/audisp/plugins/ids/nvpair.c0000644001034500103450000000471314655201403013501 /* * nvpair.c - Minimal linked list library for arg-jobue pairs * Copyright (c) 2019 Steve Grubb. * All Rights Reserved. * * This software may be freely redistributed and/or modified 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, Inc., 51 Franklin Street, Fifth Floor * Boston, MA 02110-1335, USA. * * Authors: * Steve Grubb */ #include "config.h" #include #include "nvpair.h" void nvpair_list_create(nvlist *l) { l->head = NULL; l->cur = NULL; l->prev = NULL; l->cnt = 0; } /*nvnode *nvlist_next(nvlist *l) { if (l->cur == NULL) { l->prev = NULL; return NULL; } l->prev = l->cur; l->cur = l->cur->next; return l->cur; }*/ void nvpair_list_append(nvlist *l, nvnode *node) { nvnode* newnode = malloc(sizeof(nvnode)); newnode->arg = node->arg; newnode->job = node->job; newnode->expiration = node->expiration; newnode->next = NULL; // if we are at top, fix this up if (l->head == NULL) { l->head = newnode; l->prev = NULL; } else { // Add pointer to newnode and make sure we are at the end while (l->cur->next) { l->prev = l->cur; l->cur = l->cur->next; } l->cur->next = newnode; } // make newnode current l->cur = newnode; l->cnt++; } int nvpair_list_find_job(nvlist *l, time_t t) { nvnode* node = l->head; l->prev = NULL; while (node) { if (node->expiration < t) { l->cur = node; return 1; } else { l->prev = node; node = node->next; } } return 0; } void nvpair_list_delete_cur(nvlist *l) { if (l->cur == NULL) return; if (l->cur == l->head) { l->head = l->cur->next; l->prev = NULL; } else if (l->prev) l->prev->next = l->cur->next; free(l->cur->arg); free(l->cur); l->cnt--; } void nvpair_list_clear(nvlist* l) { nvnode* nextnode; nvnode* current; current = l->head; while (current) { nextnode=current->next; free(current->arg); free(current); current=nextnode; } l->head = NULL; l->prev = NULL; l->cur = NULL; l->cnt = 0; } audit-4.0.2/audisp/plugins/ids/reactions.h0000644001034500103450000000130114655201403014164 /* reactions.h -- * * Authors: * Steve Grubb * */ #ifndef REACTIONS_HEADER #define REACTIONS_HEADER int kill_process(pid_t pid); int kill_session(int session); int restricted_role(const char *acct); int force_password_reset(const char *acct); int lock_account(const char *acct); int unlock_account(const char *acct); int lock_account_timed(const char *acct, unsigned long length); int block_ip_address(const char *addr); int block_ip_address_timed(const char *addr, unsigned long length); int unblock_ip_address(const char *addr); int system_reboot(void); int system_single_user(void); int system_halt(void); void do_reaction(unsigned int answer, const char *reason); #endif audit-4.0.2/audisp/plugins/ids/model_bad_event.h0000644001034500103450000000030214655201403015304 #ifndef MODEL_BAD_EVENT_HEADER #define MODEL_BAD_EVENT_HEADER #include "auparse.h" #include "ids_config.h" void process_bad_event_model(auparse_state_t *au, struct ids_conf *config); #endif audit-4.0.2/audisp/plugins/ids/TODO0000644001034500103450000000047114655201403012523 1) Start getting whitelisting in place 2) verify timer services working correctly Test on live server 3) Support IPv6 4) Support nftables 5) Patch auditctl for new ids rules 6) Should we save state on shutdown and restore on start up? 7) Develop ids rules for more coverage of ATT&CK 8) More sophisticated models audit-4.0.2/audisp/plugins/ids/origin.c0000644001034500103450000001161614655201403013471 /* origin.c -- * * Authors: * Steve Grubb * */ #include "config.h" #include #include "ids.h" #include "origin.h" #include "reactions.h" // This holds info about all sessions struct origin_avl{ avl_tree_t index; unsigned int count; }; static struct origin_avl origins; static origin_data_t *cur = NULL; static int cmp_origins(void *a, void *b) { return (((origin_data_t *)a)->address - ((origin_data_t *)b)->address); } void init_origins(void) { origins.count = 0; cur = NULL; avl_init(&origins.index, cmp_origins); } unsigned int get_num_origins(void) { return origins.count; } static int dump_origin(void *entry, void *data) { FILE *f = data; origin_data_t *o = entry; fprintf(f, "\n"); fprintf(f, " address: %s\n", sockint_to_ipv4(o->address)); fprintf(f, " karma: %u\n", o->karma); fprintf(f, " blocked: %u\n", o->blocked); return 0; } void traverse_origins(FILE *f) { fprintf(f, "Origins\n"); fprintf(f, "=======\n"); fprintf(f, "count: %u\n", origins.count); avl_traverse(&origins.index, dump_origin, f); } static void free_origin(origin_data_t *o) { if (debug) my_printf("Origin freeing %p", o); free(o); } void new_origin(unsigned int a) { origin_data_t *tmp = (origin_data_t *)malloc(sizeof(origin_data_t)); if (tmp) { tmp->address = a; tmp->karma = 0; tmp->blocked = 0; add_origin(tmp); } } static void destroy_origin(void) { avl_t *cur = origins.index.root; origin_data_t *o = (origin_data_t *)avl_remove(&origins.index, cur); if ((avl_t *)o != cur) my_printf("origin: removal of invalid node"); // Now free any data pointed to by cur free_origin(o); cur = NULL; } void destroy_origins(void) { while (origins.index.root) { origins.count--; destroy_origin(); } } int add_origin(origin_data_t *o) { origin_data_t *tmp; if (debug) my_printf("Adding origin %u", o->address); cur = NULL; tmp = (origin_data_t *)avl_insert(&origins.index, (avl_t *)(o)); if (tmp) { if (tmp != o) { if (debug) my_printf("origin: duplicate address found"); free(o); return 1; } origins.count++; cur = tmp; } else if (debug) my_printf("origin: failed inserting address %u", o->address); return 0; } origin_data_t *find_origin(unsigned int addr) { origin_data_t tmp; tmp.address = addr; cur = (origin_data_t *)avl_search(&origins.index, (avl_t *) &tmp); return cur; } origin_data_t *current_origin(void) { return cur; } int del_origin(unsigned int addr) { origin_data_t tmp1, *tmp2; tmp1.address = addr; if (debug) my_printf("Deleting %u", addr); cur = NULL; tmp2 = (origin_data_t *)avl_remove(&origins.index, (avl_t *) &tmp1); if (tmp2) { origins.count--; if (tmp2->address != addr) { if (debug) my_printf("origin: deleting unknown address"); return 1; } } else { if (debug) my_printf("origin: didn't find address"); return 1; } // Now free any data pointed to by tmp2 free_origin(tmp2); return 0; } char *sockint_to_ipv4(unsigned int addr) { unsigned char *uaddr = (unsigned char *)&(addr); static char buf[16]; snprintf(buf, sizeof(buf), "%u.%u.%u.%u", uaddr[0], uaddr[1], uaddr[2], uaddr[3]); return buf; } unsigned int ipv4_to_sockint(const char *buf) { unsigned int addr; unsigned int ip[4] = {0, 0, 0, 0}; if (sscanf(buf, "%u.%u.%u.%u", &ip[3], &ip[2], &ip[1], &ip[0]) != 4) return 0; addr = ip[0] << 24 | ip[1] << 16 | ip[2] << 8 | ip[3]; return addr; } void bad_login_origin(origin_data_t *o, struct ids_conf *config) { // We will just add a 1 for a bad login. add_to_score_origin(o, config->option_bad_login_weight); } void bad_service_login_origin(origin_data_t *o, struct ids_conf *config, const char *acct) { // We will just add a 5 for a bad service login. char buf[62]; const char *addr = sockint_to_ipv4(o->address); // account names can be up to 32 characters. IPv4 can be 16 snprintf(buf, sizeof(buf), "acct=%.32s daddr=%.16s", acct ? acct : "?", addr); log_audit_event(AUDIT_ANOM_LOGIN_SERVICE, buf, 1); add_to_score_origin(o, config->option_service_login_weight); } void watched_login_origin(origin_data_t *o, struct ids_conf *config, const char *acct) { // We will just add a 5 for a watched login. char buf[62]; const char *addr = sockint_to_ipv4(o->address); snprintf(buf, sizeof(buf), "acct=%.32s daddr=%.16s", acct ? acct : "?", addr); log_audit_event(AUDIT_ANOM_LOGIN_ACCT, buf, 1); add_to_score_origin(o, config->option_root_login_weight); } void add_to_score_origin(origin_data_t *o, unsigned int adj) { cur = o; if (o == NULL) { if (debug) my_printf("origin NULL adding score"); return; } o->karma += adj; if (debug) my_printf("origin karma: %u", o->karma); } // Returns 1 on success and 0 on failure int unblock_origin(const char *addr) { unsigned int uaddr = ipv4_to_sockint(addr); origin_data_t *o = find_origin(uaddr); if (o) { o->blocked = 0; return 1; } return 0; } audit-4.0.2/audisp/plugins/ids/session.h0000644001034500103450000000155114655201403013667 /* session.h -- * * Authors: * Steve Grubb * */ #ifndef SESSION_HEADER #define SESSION_HEADER #include #include "avl.h" #include "origin.h" #include "ids_config.h" typedef struct session_data { avl_t avl; // This has to be first unsigned int session; unsigned int score; unsigned int killed; unsigned int origin; // This hack works for IPv4 const char *acct; // Not used at the moment } session_data_t; void init_sessions(void); void new_session(unsigned int s, unsigned int o, const char *acct); void destroy_sessions(void); unsigned int get_num_sessions(void); void traverse_sessions(FILE *f); int add_session(session_data_t *s); session_data_t *find_session(unsigned int s); session_data_t *current_session(void); int del_session(unsigned int s); void add_to_score_session(session_data_t *s, unsigned int adj); #endif audit-4.0.2/audisp/plugins/ids/gcc-attributes.h0000644001034500103450000000052214655201403015121 /* gcc-attributes.h -- * * Authors: * Steve Grubb * */ #ifndef GCC_ATTRIBUTES_H #define GCC_ATTRIBUTES_H #define NEVERNULL __attribute__ ((returns_nonnull)) #define WARNUNUSED __attribute__ ((warn_unused_result)) #define MALLOCLIKE __attribute__ ((malloc)) #define NORETURN __attribute__ ((noreturn)) #endif audit-4.0.2/audisp/plugins/ids/model_behavior.h0000644001034500103450000000027714655201403015167 #ifndef MODEL_BEHAVIOR_HEADER #define MODEL_BEHAVIOR_HEADER #include "auparse.h" #include "ids_config.h" void process_behavior_model(auparse_state_t *au, struct ids_conf *config); #endif audit-4.0.2/audisp/plugins/ids/rules/0000755001034500103450000000000014655201457013254 5audit-4.0.2/audisp/plugins/ids/rules/25-make-exec.rules0000644001034500103450000000211114655201403016315 # This rule triggers when someone makes an executable in specific directories -a exit,always -F arch=b64 -S chmod,fchmod -F dir=/home -F a1&0111 -F filetype=file -F auid>=1000 -F auid!=-1 -F key=ids-mkexec -a exit,always -F arch=b64 -S fchmodat -F dir=/home -F a2&0111 -F filetype=file -F auid>=1000 -F auid!=-1 -F key=ids-mkexec -a exit,always -F arch=b64 -S chmod,fchmod -F dir=/tmp -F a1&0111 -F filetype=file -F auid>=1000 -F auid!=-1 -F key=ids-mkexec -a exit,always -F arch=b64 -S fchmodat -F dir=/tmp -F a2&0111 -F filetype=file -F auid>=1000 -F auid!=-1 -F key=ids-mkexec -a exit,always -F arch=b64 -S chmod,fchmod -F dir=/var/tmp -F a1&0111 -F filetype=file -F auid>=1000 -F auid!=-1 -F key=ids-mkexec -a exit,always -F arch=b64 -S fchmodat -F dir=/var/tmp -F a2&0111 -F filetype=file -F auid>=1000 -F auid!=-1 -F key=ids-mkexec -a exit,always -F arch=b64 -S chmod,fchmod -F dir=/dev/shm -F a1&0111 -F filetype=file -F auid>=1000 -F auid!=-1 -F key=ids-mkexec -a exit,always -F arch=b64 -S fchmodat -F dir=/dev/shm -F a2&0111 -F filetype=file -F auid>=1000 -F auid!=-1 -F key=ids-mkexec audit-4.0.2/audisp/plugins/ids/rules/25-connections.rules0000644001034500103450000000375314655201403017015 # This rule gets the connections of known data moving programs #-a always,exit -F arch=b64 -S connect,recvfrom -F auid>=1000 -F auid!=-1 -F exe=/usr/bin/awk -F key=ids-connections #-a always,exit -F arch=b64 -S connect,recvfrom -F auid>=1000 -F auid!=-1 -F exe=/usr/bin/bash -F key=ids-connections -a always,exit -F auid>=1000 -F auid!=-1 -F perm=x -F path=/usr/bin/curl -F key=ids-connections -a always,exit -F auid>=1000 -F auid!=-1 -F perm=x -F path=/usr/bin/elinks -F key=ids-connections -a always,exit -F auid>=1000 -F auid!=-1 -F perm=x -F path=/usr/bin/ftp -F key=ids-connections -a always,exit -F auid>=1000 -F auid!=-1 -F perm=x -F path=/usr/bin/git -F key=ids-connections -a always,exit -F auid>=1000 -F auid!=-1 -F perm=x -F path=/usr/bin/links -F key=ids-connections -a always,exit -F auid>=1000 -F auid!=-1 -F perm=x -F path=/usr/bin/lynx -F key=ids-connections -a always,exit -F auid>=1000 -F auid!=-1 -F perm=x -F path=/usr/bin/rsync -F key=ids-connections -a always,exit -F auid>=1000 -F auid!=-1 -F perm=x -F path=/usr/bin/scp -F key=ids-connections -a always,exit -F auid>=1000 -F auid!=-1 -F perm=x -F path=/usr/bin/sftp -F key=ids-connections -a always,exit -F auid>=1000 -F auid!=-1 -F perm=x -F path=/usr/bin/ssh -F key=ids-connections -a always,exit -F auid>=1000 -F auid!=-1 -F perm=x -F path=/usr/bin/w3m -F key=ids-connections -a always,exit -F auid>=1000 -F auid!=-1 -F perm=x -F path=/usr/bin/wget -F key=ids-connections -a always,exit -F auid>=1000 -F auid!=-1 -F perm=x -F path=/usr/bin/telnet -F key=ids-connections -a always,exit -F auid>=1000 -F auid!=-1 -F perm=x -F path=/usr/bin/nc -F key=ids-connections -a always,exit -F auid>=1000 -F auid!=-1 -F perm=x -F path=/usr/bin/ncat -F key=ids-connections -a always,exit -F auid>=1000 -F auid!=-1 -F perm=x -F path=/usr/bin/nmap -F key=ids-connections -a always,exit -F auid>=1000 -F auid!=-1 -F perm=x -F path=/usr/bin/nping -F key=ids-connections -a always,exit -F auid>=1000 -F auid!=-1 -F perm=x -F path=/usr/bin/ping -F key=ids-connections audit-4.0.2/audisp/plugins/ids/rules/25-unpacking.rules0000644001034500103450000000166114655201403016446 # This rule triggers whenever someone runs a utility that unpacks or in some # instances, packs an archive -a always,exit -F perm=x -F path=/usr/bin/unzip -F auid>=1000 -F auid!=-1 -F key=ids-archive -a always,exit -F perm=x -F path=/usr/bin/tar -F auid>=1000 -F auid!=-1 -F key=ids-archive -a always,exit -F perm=x -F path=/usr/bin/bunzip -F auid>=1000 -F auid!=-1 -F key=ids-archive -a always,exit -F perm=x -F path=/usr/bin/zipgrep -F auid>=1000 -F auid!=-1 -F key=ids-archive -a always,exit -F perm=x -F path=/usr/bin/gzip -F auid>=1000 -F auid!=-1 -F key=ids-archive -a always,exit -F perm=x -F path=/usr/bin/gunzip -F auid>=1000 -F auid!=-1 -F key=ids-archive -a always,exit -F perm=x -F path=/usr/bin/zcat -F auid>=1000 -F auid!=-1 -F key=ids-archive -a always,exit -F perm=x -F path=/usr/bin/zgrep -F auid>=1000 -F auid!=-1 -F key=ids-archive -a always,exit -F perm=x -F path=/usr/bin/zless -F auid>=1000 -F auid!=-1 -F key=ids-archive audit-4.0.2/audisp/plugins/ids/rules/Makefile.in0000644001034500103450000004027114655201422015235 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am -- # Copyright 2021 Steve Grubb # All Rights Reserved. # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. If not, write to the # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor # Boston, MA 02110-1335, USA. # # Authors: # Steve Grubb # 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@ subdir = audisp/plugins/ids/rules ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prog_cc_for_build.m4 \ $(top_srcdir)/m4/cap-ng.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/src/libev/libev.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(dist_rules_DATA) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(rulesdir)" DATA = $(dist_rules_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILD_EXEEXT = @BUILD_EXEEXT@ BUILD_OBJEXT = @BUILD_OBJEXT@ CAPNG_LDADD = @CAPNG_LDADD@ CAPNG_PKG = @CAPNG_PKG@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_FOR_BUILD = @CC_FOR_BUILD@ CFLAGS = @CFLAGS@ CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ CPP_FOR_BUILD = @CPP_FOR_BUILD@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG = @DEBUG@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GOLANG = @GOLANG@ GOROOT = @GOROOT@ 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@ LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBWRAP_LIBS = @LIBWRAP_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PYTHON = @PYTHON@ PYTHON3_CFLAGS = @PYTHON3_CFLAGS@ PYTHON3_INCLUDES = @PYTHON3_INCLUDES@ PYTHON3_LIBS = @PYTHON3_LIBS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ VERSION = @VERSION@ WFLAGS = @WFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CC_FOR_BUILD = @ac_ct_CC_FOR_BUILD@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gss_libs = @gss_libs@ 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@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ use_python3 = @use_python3@ CONFIG_CLEAN_FILES = *.rej *.orig EXTRA_DIST = 25-connections.rules 25-make-exec.rules 25-recon.rules 25-unpacking.rules rulesdir = $(datadir)/audit-rules/ids-rules dist_rules_DATA = $(EXTRA_DIST) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu audisp/plugins/ids/rules/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu audisp/plugins/ids/rules/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dist_rulesDATA: $(dist_rules_DATA) @$(NORMAL_INSTALL) @list='$(dist_rules_DATA)'; test -n "$(rulesdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(rulesdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(rulesdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(rulesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(rulesdir)" || exit $$?; \ done uninstall-dist_rulesDATA: @$(NORMAL_UNINSTALL) @list='$(dist_rules_DATA)'; test -n "$(rulesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(rulesdir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(rulesdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dist_rulesDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-dist_rulesDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-dist_rulesDATA install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-dist_rulesDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: audit-4.0.2/audisp/plugins/ids/rules/25-recon.rules0000644001034500103450000000430614655201403015574 # This set of rules can trigger on events that might be considered recon -a always,exit -F auid>=1000 -F auid!=-1 -F perm=x -F path=/usr/bin/uname -F key=ids-recon -a always,exit -F auid>=1000 -F auid!=-1 -F perm=x -F path=/usr/bin/rpm -F key=ids-recon -a always,exit -F auid>=1000 -F auid!=-1 -F perm=x -F path=/usr/bin/yum -F key=ids-recon -a always,exit -F auid>=1000 -F auid!=-1 -F perm=x -F path=/usr/bin/dnf -F key=ids-recon -a always,exit -F auid>=1000 -F auid!=-1 -F perm=x -F path=/usr/bin/w -F key=ids-recon -a always,exit -F auid>=1000 -F auid!=-1 -F perm=x -F path=/usr/bin/who -F key=ids-recon -a always,exit -F auid>=1000 -F auid!=-1 -F perm=x -F path=/usr/bin/whoami -F key=ids-recon #-a always,exit -F auid>=1000 -F auid!=-1 -F perm=x -F path=/usr/bin/id -F key=ids-recon -a always,exit -F auid>=1000 -F auid!=-1 -F perm=x -F path=/usr/bin/netstat -F key=ids-recon -a always,exit -F auid>=1000 -F auid!=-1 -F perm=x -F path=/usr/bin/ss -F key=ids-recon -a always,exit -F auid>=1000 -F auid!=-1 -F perm=x -F path=/usr/bin/route -F key=ids-recon -a always,exit -F auid>=1000 -F auid!=-1 -F perm=x -F path=/usr/bin/ifconfig -F key=ids-recon -a always,exit -F auid>=1000 -F auid!=-1 -F perm=x -F path=/usr/bin/ip -F key=ids-recon -a always,exit -F auid>=1000 -F auid!=-1 -F perm=x -F path=/usr/bin/mount -F key=ids-recon -a always,exit -F auid>=1000 -F auid!=-1 -F perm=x -F path=/usr/bin/lsof -F key=ids-recon -a always,exit -F auid>=1000 -F auid!=-1 -F perm=x -F path=/usr/bin/df -F key=ids-recon -a always,exit -F auid>=1000 -F auid!=-1 -F perm=x -F path=/usr/bin/dig -F key=ids-recon -a always,exit -F auid>=1000 -F auid!=-1 -F perm=x -F path=/usr/bin/host -F key=ids-recon -a always,exit -F auid>=1000 -F auid!=-1 -F perm=x -F path=/usr/bin/last -F key=ids-recon -a always,exit -F auid>=1000 -F auid!=-1 -F perm=x -F path=/usr/bin/lastlog -F key=ids-recon -a always,exit -F auid>=1000 -F auid!=-1 -F perm=x -F path=/usr/bin/getent -F key=ids-recon -a always,exit -F auid>=1000 -F auid!=-1 -F perm=x -F path=/usr/bin/history -F key=ids-recon -a always,exit -F auid>=1000 -F auid!=-1 -F perm=x -F path=/usr/bin/watch -F key=ids-recon -a always,exit -F auid>=1000 -F auid!=-1 -F perm=x -F path=/usr/sbin/sestatus -F key=ids-recon audit-4.0.2/audisp/plugins/ids/rules/Makefile.am0000644001034500103450000000205314655201403015217 # Makefile.am -- # Copyright 2021 Steve Grubb # All Rights Reserved. # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. If not, write to the # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor # Boston, MA 02110-1335, USA. # # Authors: # Steve Grubb # CONFIG_CLEAN_FILES = *.rej *.orig EXTRA_DIST = 25-connections.rules 25-make-exec.rules 25-recon.rules 25-unpacking.rules rulesdir = $(datadir)/audit-rules/ids-rules dist_rules_DATA = $(EXTRA_DIST) audit-4.0.2/audisp/plugins/ids/ids_config.c0000644001034500103450000002714214655201403014307 /* model_bad_event.c -- * * Authors: * Steve Grubb * */ #include "config.h" #include #include #include #include #include #include /* O_NOFOLLOW needs gnu defined */ #include /* INT_MAX */ #include #include #include "ids_config.h" #define CONFIG_FILE "/etc/audit/ids.conf" extern char *audit_strsplit(char *s); /* Local prototypes */ struct nv_pair { const char *name; const char *value; }; struct kw_pair { const char *name; int (*parser)(struct nv_pair *, int, struct ids_conf *); }; struct kw_value { const char *name; int value; }; struct nv_list { const char *name; int option; }; static char *get_line(FILE *f, char *buf, unsigned size, int *lineno, const char *file) __attr_access ((__write_only__, 2, 3)); static int nv_split(char *buf, struct nv_pair *nv); static const struct kw_pair *kw_lookup(const char *val); static int option_origin_failed_logins_threshold_parser(struct nv_pair *nv, int line, struct ids_conf *config); static int option_origin_failed_logins_reaction_parser(struct nv_pair *nv, int line, struct ids_conf *config); static int option_session_badness1_threshold_parser(struct nv_pair *nv, int line, struct ids_conf *config); static int option_session_badness1_reaction_parser(struct nv_pair *nv, int line, struct ids_conf *config); static int option_service_login_allowed_parser(struct nv_pair *nv, int line, struct ids_conf *config); static int option_service_login_weight_parser(struct nv_pair *nv, int line, struct ids_conf *config); static int option_root_login_allowed_parser(struct nv_pair *nv, int line, struct ids_conf *config); static int option_root_login_weight_parser(struct nv_pair *nv, int line, struct ids_conf *config); static int option_bad_login_weight_parser(struct nv_pair *nv, int line, struct ids_conf *config); static const struct kw_value reactions[] = { { "ignore", REACTION_IGNORE }, { "log", REACTION_LOG }, { "email", REACTION_EMAIL }, { "term_process", REACTION_TERMINATE_PROCESS }, { "term_session", REACTION_TERMINATE_SESSION }, { "restrict_role", REACTION_RESTRICT_ROLE }, { "password_reset", REACTION_PASSWORD_RESET }, { "lock_account_timed", REACTION_LOCK_ACCOUNT_TIMED }, { "lock_account", REACTION_LOCK_ACCOUNT }, { "block_address_timed", REACTION_BLOCK_ADDRESS_TIMED }, { "block_address", REACTION_BLOCK_ADDRESS }, { "system_reboot", REACTION_SYSTEM_REBOOT }, { "system_single_user", REACTION_SYSTEM_SINGLE_USER }, { "system_halt", REACTION_SYSTEM_HALT }, }; #define REACTION_NAMES (sizeof(reactions)/sizeof(reactions[0])) static const struct kw_pair keywords[] = { {"option_origin_failed_logins_threshold", option_origin_failed_logins_threshold_parser }, {"option_origin_failed_logins_reaction", option_origin_failed_logins_reaction_parser }, {"option_session_badness1_threshold", option_session_badness1_threshold_parser }, {"option_session_badness1_reaction", option_session_badness1_reaction_parser }, {"option_service_login_allowed", option_service_login_allowed_parser }, {"option_service_login_weight", option_service_login_weight_parser }, {"option_root_login_allowed", option_root_login_allowed_parser }, {"option_root_login_weight", option_root_login_weight_parser }, {"option_bad_login_weight", option_bad_login_weight_parser }, }; void reset_config(struct ids_conf *config) { config->option_origin_failed_logins_threshold = 8; config->option_origin_failed_logins_reaction = REACTION_BLOCK_ADDRESS; config->option_session_badness1_threshold = 8; config->option_session_badness1_reaction = REACTION_TERMINATE_SESSION; config->option_service_login_allowed = 0; config->option_service_login_weight = 5; config->option_root_login_allowed = 0; config->option_root_login_weight = 5; config->option_bad_login_weight = 1; } void free_config(struct ids_conf *config __attribute__((unused))) { } void dump_config(struct ids_conf *config, FILE *f) { fprintf(f, "\nInternal Configuration\n"); fprintf(f, "======================\n"); fprintf(f, "option_origin_failed_logins_threshold: %u\n", config->option_origin_failed_logins_threshold); fprintf(f, "option_session_badness1_threshold: %u\n", config->option_session_badness1_threshold); fprintf(f, "option_service_login_allowed: %u\n", config->option_service_login_allowed); fprintf(f, "option_service_login_weight: %u\n", config->option_service_login_weight); fprintf(f, "option_root_login_allowed: %u\n", config->option_root_login_allowed); fprintf(f, "option_root_login_weight: %u\n", config->option_root_login_weight); fprintf(f, "option_bad_login_weight: %u\n", config->option_bad_login_weight); } int load_config(struct ids_conf *config) { int fd, rc, mode, lineno = 1; struct stat st; FILE *f; char buf[160]; reset_config(config); /* open the file */ mode = O_RDONLY; rc = open(CONFIG_FILE, mode); if (rc < 0) { if (errno != ENOENT) { syslog(LOG_ERR, "Error opening config file (%s)", strerror(errno)); return 1; } syslog(LOG_WARNING, "Config file %s doesn't exist, skipping", CONFIG_FILE); return 0; } fd = rc; if (fstat(fd, &st) < 0) { syslog(LOG_ERR, "Error fstat'ing config file (%s)", strerror(errno)); close(fd); return 1; } if (st.st_uid != 0) { syslog(LOG_ERR, "Error - %s isn't owned by root", CONFIG_FILE); close(fd); return 1; } if ((st.st_mode & S_IWOTH) == S_IWOTH) { syslog(LOG_ERR, "Error - %s is world writable", CONFIG_FILE); close(fd); return 1; } if (!S_ISREG(st.st_mode)) { syslog(LOG_ERR, "Error - %s is not a regular file", CONFIG_FILE); close(fd); return 1; } /* it's ok, read line by line */ f = fdopen(fd, "rm"); if (f == NULL) { syslog(LOG_ERR, "Error - fdopen failed (%s)", strerror(errno)); close(fd); return 1; } while (get_line(f, buf, sizeof(buf), &lineno, CONFIG_FILE)) { // convert line into name-value pair const struct kw_pair *kw; struct nv_pair nv; rc = nv_split(buf, &nv); switch (rc) { case 0: // fine break; case 1: // not the right number of tokens. syslog(LOG_ERR, "Wrong number of arguments for line %d in %s", lineno, CONFIG_FILE); break; case 2: // no '=' sign syslog(LOG_ERR, "Missing equal sign for line %d in %s", lineno, CONFIG_FILE); break; default: // something else went wrong... syslog(LOG_ERR, "Unknown error for line %d in %s", lineno, CONFIG_FILE); break; } if (nv.name == NULL) { lineno++; continue; } if (nv.value == NULL) { fclose(f); syslog(LOG_ERR, "Not processing any more lines in %s", CONFIG_FILE); return 1; } /* identify keyword or error */ kw = kw_lookup(nv.name); if (kw->name == NULL) { syslog(LOG_ERR, "Unknown keyword \"%s\" in line %d of %s", nv.name, lineno, CONFIG_FILE); fclose(f); return 1; } /* dispatch to keyword's local parser */ rc = kw->parser(&nv, lineno, config); if (rc != 0) { fclose(f); return 1; // local parser puts message out } lineno++; } fclose(f); // if (lineno > 1) // return sanity_check(config); return 0; } static char *get_line(FILE *f, char *buf, unsigned size, int *lineno, const char *file) { int too_long = 0; while (fgets_unlocked(buf, size, f)) { /* remove newline */ char *ptr = strchr(buf, 0x0a); if (ptr) { if (!too_long) { *ptr = 0; return buf; } // Reset and start with the next line too_long = 0; *lineno = *lineno + 1; } else { // If a line is too long skip it. // Only output 1 warning if (!too_long) syslog(LOG_ERR, "Skipping line %d in %s: too long", *lineno, file); too_long = 1; } } return NULL; } static int nv_split(char *buf, struct nv_pair *nv) { /* Get the name part */ char *ptr; nv->name = NULL; nv->value = NULL; ptr = audit_strsplit(buf); if (ptr == NULL) return 0; /* If there's nothing, go to next line */ if (ptr[0] == '#') return 0; /* If there's a comment, go to next line */ nv->name = ptr; /* Check for a '=' */ ptr = audit_strsplit(NULL); if (ptr == NULL) return 1; if (strcmp(ptr, "=") != 0) return 2; /* get the value */ ptr = audit_strsplit(NULL); if (ptr == NULL) return 1; nv->value = ptr; /* See if there's more */ ptr = audit_strsplit(NULL); if (ptr) return 1; /* Everything is OK */ return 0; } static const struct kw_pair *kw_lookup(const char *val) { int i = 0; while (keywords[i].name != NULL) { if (strcasecmp(keywords[i].name, val) == 0) break; i++; } return &keywords[i]; } static int unsigned_int_parser(struct nv_pair *nv, int line, unsigned int *val) { const char *ptr = nv->value; unsigned long i; /* check that all chars are numbers */ for (i=0; ptr[i]; i++) { if (!isdigit((unsigned char)ptr[i])) { syslog(LOG_ERR, "Value %s should only be numbers - line %d", nv->value, line); return 1; } } /* convert to unsigned int */ errno = 0; i = strtoul(nv->value, NULL, 10); if (errno) { syslog(LOG_ERR, "Error converting string to a number (%s) - line %d", strerror(errno), line); return 1; } /* Check its range */ if (i > INT_MAX) { syslog(LOG_ERR, "Error - converted number (%s) is too large - line %d", nv->value, line); return 1; } *val = (unsigned int)i; return 0; } static int reaction_parser(struct nv_pair *nv, int line, unsigned int *val) { unsigned int i, found = 0; char *ptr, *tmp = strdup(nv->value), *saved; if (tmp == NULL) return 1; *val = 0; ptr = strtok_r(tmp, ",", &saved); while (ptr) { for (i = 0; i < REACTION_NAMES; i++) { if (strcasecmp(reactions[i].name, ptr) == 0) { *val |= (unsigned int)reactions[i].value; found = 1; } } ptr = strtok_r(NULL, ",", &saved); } free(tmp); if (found) return 0; syslog(LOG_ERR, "Option %s not found - line %d", nv->value, line); return 1; } static int option_origin_failed_logins_threshold_parser(struct nv_pair *nv, int line, struct ids_conf *config) { return unsigned_int_parser(nv, line, &config->option_origin_failed_logins_threshold); } static int option_origin_failed_logins_reaction_parser(struct nv_pair *nv, int line, struct ids_conf *config) { return reaction_parser(nv, line, &config->option_origin_failed_logins_reaction); } static int option_session_badness1_threshold_parser(struct nv_pair *nv, int line, struct ids_conf *config) { return unsigned_int_parser(nv, line, &config->option_session_badness1_threshold); } static int option_session_badness1_reaction_parser(struct nv_pair *nv, int line, struct ids_conf *config) { return reaction_parser(nv, line, &config->option_session_badness1_reaction); } static int option_service_login_allowed_parser(struct nv_pair *nv, int line, struct ids_conf *config) { return unsigned_int_parser(nv, line, &config->option_service_login_allowed); } static int option_service_login_weight_parser(struct nv_pair *nv, int line, struct ids_conf *config) { return unsigned_int_parser(nv, line, &config->option_service_login_weight); } static int option_root_login_allowed_parser(struct nv_pair *nv, int line, struct ids_conf *config) { return unsigned_int_parser(nv, line, &config->option_root_login_allowed); } static int option_root_login_weight_parser(struct nv_pair *nv, int line, struct ids_conf *config) { return unsigned_int_parser(nv, line, &config->option_root_login_weight); } static int option_bad_login_weight_parser(struct nv_pair *nv, int line, struct ids_conf *config) { return unsigned_int_parser(nv, line, &config->option_bad_login_weight); } audit-4.0.2/audisp/plugins/ids/ids.h0000644001034500103450000000056614655201403012770 /* ids.h -- * * Authors: * Steve Grubb * */ #ifndef IDS_HEADER #define IDS_HEADER #include "libaudit.h" #define DAEMON_SESSION "4294967295" #define UNSET 4294967295 extern int debug; extern void my_printf(const char *fmt, ...) __attribute__ (( format(printf, 1, 2) )); extern int log_audit_event(int type, const char *text, int res); #endif audit-4.0.2/audisp/plugins/ids/nvpair.h0000644001034500103450000000400614655201403013501 /* * nvpair.h - Header file for ausearch-nvpair.c * Copyright (c) 2019 Steve Grubb. * All Rights Reserved. * * This software may be freely redistributed and/or modified 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, Inc., 51 Franklin Street, Fifth Floor * Boston, MA 02110-1335, USA. * * Authors: * Steve Grubb */ #ifndef AUNVPAIR_HEADER #define AUNVPAIR_HEADER #include #include #include "timer-services.h" /* This is the node of the linked list. message & item are the only elements * at this time. Any data elements that are per item goes here. */ typedef struct _nvnode{ jobs_t job; // The job to run char *arg; // The argument string time_t expiration; // The time when the job can be run struct _nvnode *next; // Next nvpair node pointer } nvnode; /* This is the linked list head. Only data elements that are 1 per * event goes here. */ typedef struct { nvnode *head; // List head nvnode *cur; // Pointer to current node nvnode *prev; // Pointer to previous node unsigned int cnt; // How many items in this list } nvlist; void nvpair_list_create(nvlist *l); static inline void nvlist_first(nvlist *l) { l->cur = l->head; } //nvnode *nvlist_next(nvlist *l); static inline nvnode *nvpair_list_get_cur(nvlist *l) { return l->cur; } void nvpair_list_append(nvlist *l, nvnode *node); void nvpair_list_delete_cur(nvlist *l); void nvpair_list_clear(nvlist* l); /* Given a time, find a job to run. */ int nvpair_list_find_job(nvlist *l, time_t t); #endif audit-4.0.2/audisp/plugins/ids/timer-services.h0000644001034500103450000000224414655201403015145 /* timer-services.h -- * Copyright 2021 Steve Grubb. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb * */ #ifndef TIMER_SERVICES_HEADER #define TIMER_SERVICES_HEADER typedef enum {UNLOCK_ACCOUNT, UNBLOCK_ADDRESS} jobs_t; void init_timer_services(void); void do_timer_services(unsigned int interval); void add_timer_job(jobs_t job, const char *arg, unsigned long length); void shutdown_timer_services(void); #endif audit-4.0.2/audisp/plugins/ids/origin.h0000644001034500103450000000213314655201403013470 /* origin.h -- * * Authors: * Steve Grubb * */ #ifndef ORIGIN_HEADER #define ORIGIN_HEADER #include #include "avl.h" #include "ids_config.h" typedef struct origin_data { avl_t avl; // This has to be first unsigned int address; // This hack works for IPv4 unsigned int karma; unsigned int blocked; } origin_data_t; void init_origins(void); void new_origin(unsigned int a); void destroy_origins(void); unsigned int get_num_origins(void); void traverse_origins(FILE *f); int add_origin(origin_data_t *o); origin_data_t *find_origin(unsigned int addr); origin_data_t *current_origin(void); int del_origin(unsigned int addr); void bad_login_origin(origin_data_t *o, struct ids_conf *config); void bad_service_login_origin(origin_data_t *o, struct ids_conf *config, const char *acct); void watched_login_origin(origin_data_t *o, struct ids_conf *config, const char *acct); void add_to_score_origin(origin_data_t *o, unsigned int adj); int unblock_origin(const char *addr); char *sockint_to_ipv4(unsigned int addr); unsigned int ipv4_to_sockint(const char *buf); #endif audit-4.0.2/audisp/plugins/ids/account.c0000644001034500103450000000632714655201403013641 /* account.c -- * * Authors: * Steve Grubb * */ #include "config.h" #include #include #include "ids.h" #include "account.h" #include "reactions.h" // This holds info about all sessions struct account_avl{ avl_tree_t index; unsigned int count; }; static struct account_avl accounts; static account_data_t *cur = NULL; static int cmp_accounts(void *a, void *b) { return strcmp(((account_data_t *)a)->name, ((account_data_t *)b)->name); } void init_accounts(void) { accounts.count = 0; cur = NULL; avl_init(&accounts.index, cmp_accounts); } unsigned int get_num_accounts(void) { return accounts.count; } static int dump_account(void *entry, void *data) { FILE *f = data; account_data_t *a = entry; fprintf(f, "\n"); fprintf(f, " name: %s\n", a->name); fprintf(f, " karma: %u\n", a->karma); return 0; } void traverse_accounts(FILE *f) { fprintf(f, "Accounts\n"); fprintf(f, "========\n"); fprintf(f, "count: %u\n", accounts.count); avl_traverse(&accounts.index, dump_account, f); } static void free_account(account_data_t *a) { if (debug) my_printf("Account freeing %p", a); free((void *)a->name); free(a); } static void destroy_account(void) { avl_t *cur = accounts.index.root; account_data_t *a = (account_data_t *)avl_remove(&accounts.index, cur); if ((avl_t *)a != cur) my_printf("account: removal of invalid node"); // Now free any data pointed to by cur free_account(a); cur = NULL; } void new_account(const char *name) { account_data_t *tmp = (account_data_t *)malloc(sizeof(account_data_t)); if (tmp) { tmp->name = name ? strdup(name) : strdup(""); tmp->karma = 0; add_account(tmp); } } void destroy_accounts(void) { while (accounts.index.root) { accounts.count--; destroy_account(); } } int add_account(account_data_t *a) { account_data_t *tmp; if (debug) my_printf("Adding account %s", a->name); cur = NULL; tmp = (account_data_t *)avl_insert(&accounts.index, (avl_t *)(a)); if (tmp) { if (tmp != a) { if (debug) my_printf("account: duplicate name found"); free_account(a); return 1; } accounts.count++; cur = tmp; } else if (debug) my_printf("account: failed inserting name %s", a->name); return 0; } account_data_t *find_account(const char *name) { account_data_t tmp; if (name == NULL) return NULL; tmp.name = name; cur = (account_data_t *)avl_search(&accounts.index, (avl_t *) &tmp); return cur; } account_data_t *current_account(void) { return cur; } int del_account(const char *name) { account_data_t tmp1, *tmp2; tmp1.name = name; if (debug) my_printf("Deleting %s", name); cur = NULL; tmp2 = (account_data_t *)avl_remove(&accounts.index, (avl_t *) &tmp1); if (tmp2) { accounts.count--; if (strcmp(tmp2->name, name) != 0) { if (debug) my_printf("account: deleting unknown name"); return 1; } } else { if (debug) my_printf("account: didn't find name"); return 1; } // Now free any data pointed to by tmp2 free_account(tmp2); return 0; } void add_to_score_account(account_data_t *a, unsigned int adj) { cur = a; if (a == NULL) { if (debug) my_printf("Account NULL adding score"); return; } a->karma += adj; // Now invoke any reaction if (a->karma >= 5) { } } audit-4.0.2/audisp/plugins/ids/model_bad_event.c0000644001034500103450000001023114655201403015301 /* model_bad_event.c -- * * Authors: * Steve Grubb * */ #include "config.h" #include // inet_pton #include #include #include #include "ids.h" #include "session.h" #include "origin.h" #include "model_bad_event.h" #include "reactions.h" /* Local Data */ static void terminate_sessions(void) { if (get_num_sessions() == 0) return; if (debug) my_printf("terminating all sessions"); // Might want to do more than this like update persistent scores destroy_sessions(); } // Look at the acct, is it a daemon acct and forbidden // Is the acct root and forbidden // is it a bad login // is it a new session static void start_session(auparse_state_t *au, struct ids_conf *config) { unsigned int a; const char *addr = auparse_find_field(au, "addr"); if (addr && *addr != '?') inet_pton(AF_INET, addr, &a); else a = -1; int service_acct = 0; const char *acct = NULL; const char *atype = auparse_normalize_subject_kind(au); if (atype && strncmp(atype, "service", 7) == 0) service_acct = 1; if (auparse_normalize_subject_primary(au) == 1) acct = strdup(auparse_interpret_field(au)); // Have we seen this endpoint before? origin_data_t *o = find_origin(a); if (o == NULL) { new_origin(a); o = find_origin(a); } // Is this login a service account? if (service_acct && !config->option_service_login_allowed) { my_printf("bad_service_login_origin: %s", acct); bad_service_login_origin(o, config, acct); } // Is this a root login else if (!config->option_root_login_allowed && acct && strcmp(acct, "root") == 0) { my_printf("watched_login_origin: %s", acct); watched_login_origin(o, config, acct); } // Check if it's a failed login if (auparse_normalize_get_results(au) == 1) { // Handle a bad login const char *res = auparse_interpret_field(au); if (res && strcmp(res, "failed") == 0) { // Since the login failed, we don't need to // start a new session bad_login_origin(o, config); free((void *)acct); return; } } // Look for new login sessions if (auparse_normalize_session(au) == 1) { unsigned int s = auparse_get_field_int(au); if (s != UNSET) { // new_session takes custody of acct new_session(s, a, acct); acct = NULL; // otherwise we have a strange daemon login } else if (debug) my_printf("start_session: can't find session in serial %s", auparse_get_type_name(au)); } free((void *)acct); } static void end_session(auparse_state_t *au) { if (auparse_normalize_session(au) == 1) { const char *ses = auparse_get_field_str(au); if (ses && strcmp(ses, DAEMON_SESSION)) { unsigned int s = auparse_get_field_int(au); del_session(s); } } } /* This function receives a single complete event from the auparse library. */ void process_bad_event_model(auparse_state_t *au, struct ids_conf *config) { unsigned int answer = 0; auparse_first_record(au); int type = auparse_get_type(au); /* Now we can branch based on what the first record type we find. */ switch (type) { case AUDIT_SYSTEM_BOOT: case AUDIT_SYSTEM_SHUTDOWN: // Reset everything terminate_sessions(); break; // FIXME: update this list as events are added case AUDIT_ANOM_LOGIN_SERVICE: case AUDIT_ANOM_LOGIN_ACCT: // Do not process our own events break; case AUDIT_ANOM_LOGIN_FAILURES: { // Do not process our own events const char *exe = auparse_normalize_how(au); if (exe && strcmp(exe, "/usr/sbin/audisp-ids") == 0) break; } // fallthrough if pam related case AUDIT_ANOM_LOGIN_TIME: case AUDIT_ANOM_LOGIN_SESSIONS: case AUDIT_ANOM_LOGIN_LOCATION: // watch for pam discovered problems break; case AUDIT_USER_LOGIN: start_session(au, config); break; // case AUDIT_USER_END: user_end can be for su case AUDIT_USER_LOGOUT: end_session(au); break; default: break; } // We only mess with origins because it could be a bad login origin_data_t *o = current_origin(); if (o) { if (o->karma >= config->option_origin_failed_logins_threshold && !o->blocked) { //AUDIT_ANOM_ORIGIN_FAILURES answer |= config->option_origin_failed_logins_reaction; do_reaction(answer, "login_failures"); } } } audit-4.0.2/audisp/plugins/ids/ids.c0000644001034500103450000001674014655201403012764 /* ids.c -- * Copyright 202-23 Steve Grubb. * All Rights Reserved. * * 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; see the file COPYING. If not, write to the * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor * Boston, MA 02110-1335, USA. * * Authors: * Steve Grubb * */ #include "config.h" #include #include #include #include #include #include #include #include #include // umask #include #include #include "auparse.h" #include "common.h" #include "ids.h" #include "ids_config.h" #include "origin.h" #include "account.h" #include "session.h" #include "model_bad_event.h" #include "model_behavior.h" #include "timer-services.h" /* Global Data */ int debug = 1; // mode 3 == file, mode 2 == syslog, 1 == stderr, 0 == nothing int mode = 0; /* Local Data */ static FILE *l = NULL; // Log file static volatile int stop = 0; static volatile int hup = 0; static volatile int dump_state = 0; static auparse_state_t *au = NULL; #define NO_ACTIONS (!hup && !stop && !dump_state) #define STATE_FILE "/var/run/ids-state" #define TIMER_INTERVAL 30 // Run every 30 seconds static struct ids_conf config; /* Local declarations */ static void handle_event(auparse_state_t *au, auparse_cb_event_t cb_event_type, void *user_data); void my_printf(const char *fmt, ...) { va_list ap; va_start(ap, fmt); if (mode == 2) vsyslog(LOG_WARNING, fmt, ap); else if (mode == 1) { vfprintf(stderr, fmt, ap); fputc('\n', stderr); } else if (mode == 3) { if (l == NULL) { l = fopen("/var/run/audisp-ids.log", "wt"); if (l == NULL) { va_end(ap); return; } setlinebuf(l); } vfprintf(l, fmt, ap); fputc('\n', l); } va_end(ap); } static int audit_fd = -1; static void init_audit(void) { audit_fd = audit_open(); if (audit_fd < 0) { syslog(LOG_ERR, "Cannot open audit connection"); exit(1); } } static void destroy_audit(void) { audit_close(audit_fd); } int log_audit_event(int type, const char *text, int res) { return audit_log_user_message(audit_fd, type, text, NULL, NULL, NULL, res); } /* * SIGTERM handler */ static void term_handler(int sig __attribute__((unused))) { stop = 1; } static void child_handler(int sig __attribute__((unused))) { int status; while (waitpid(-1, &status, WNOHANG)>0) ; /* empty */ } /* * SIGHUP handler: re-read config */ static void hup_handler(int sig __attribute__((unused))) { hup = 1; } static void reload_config(void) { hup = 0; free_config(&config); load_config(&config); } static void sigusr1_handler(int sig __attribute__((unused))) { dump_state = 1; } static void output_state(void) { FILE *f = fopen(STATE_FILE, "wt"); dump_state = 0; if (f) { char *metrics = auparse_metrics(au); if (metrics) { fprintf(f, "auparse\n=======\n"); fprintf(f, "%s\n\n", metrics); free(metrics); } traverse_origins(f); fprintf(f, "\n"); traverse_accounts(f); fprintf(f, "\n"); traverse_sessions(f); dump_config(&config, f); fclose(f); } } int main(void) { char tmp[MAX_AUDIT_MESSAGE_LENGTH+1]; struct sigaction sa; struct itimerspec itval; int tfd; fd_set read_mask; /* Register sighandlers */ sa.sa_flags = 0; sigemptyset(&sa.sa_mask); /* Set handler for the ones we care about */ sa.sa_handler = term_handler; sigaction(SIGTERM, &sa, NULL); sa.sa_handler = child_handler; sigaction(SIGCHLD, &sa, NULL); sa.sa_handler = hup_handler; sigaction(SIGHUP, &sa, NULL); sa.sa_handler = sigusr1_handler; sigaction(SIGUSR1, &sa, NULL); (void) umask(0177); if (load_config(&config)) return 1; init_audit(); // Initialize the model init_origins(); init_accounts(); init_sessions(); /* Initialize the auparse library */ au = auparse_init(AUSOURCE_FEED, 0); if (au == NULL) { my_printf("ids is exiting due to auparse init errors"); return -1; } auparse_set_eoe_timeout(2); auparse_add_callback(au, handle_event, NULL, NULL); init_timer_services(); tfd = timerfd_create (CLOCK_MONOTONIC, TFD_NONBLOCK|TFD_CLOEXEC); if (tfd < 0) { my_printf("ids is exiting due to timerfd_create failing"); return -1; } itval.it_interval.tv_sec = TIMER_INTERVAL; itval.it_interval.tv_nsec = 0; itval.it_value.tv_sec = itval.it_interval.tv_sec; itval.it_value.tv_nsec = 0; timerfd_settime(tfd, 0, &itval, NULL); do { int retval; /* Handle dump_state */ if (dump_state) output_state(); /* Load configuration */ if (hup) reload_config(); /* Probably not needed, but maybe reload took some time? */ if (stop) break; do { FD_ZERO(&read_mask); FD_SET(0, &read_mask); FD_SET(tfd, &read_mask); if (auparse_feed_has_data(au)) { // We'll do a 1 second timeout to try to // age events as quick as possible struct timeval tv; tv.tv_sec = 1; tv.tv_usec = 0; //my_printf("auparse_feed_has_data"); retval= select(tfd+1, &read_mask, NULL, NULL, &tv); } else retval= select(tfd+1, &read_mask, NULL, NULL, NULL); /* If we timed out & have events, shake them loose */ if (retval == 0 && auparse_feed_has_data(au)) { //my_printf("auparse_feed_age_events"); auparse_feed_age_events(au); } } while (retval == -1 && errno == EINTR && NO_ACTIONS); /* Now the event loop */ if (NO_ACTIONS && retval > 0) { if (FD_ISSET(0, &read_mask)) { do { int len; if ((len = audit_fgets(tmp, MAX_AUDIT_MESSAGE_LENGTH, 0)) > 0) { /* char *buf = strndup(tmp, 40); my_printf("auparse_feed %s", buf); free(buf); */ auparse_feed(au, tmp, len); } } while (audit_fgets_more( MAX_AUDIT_MESSAGE_LENGTH)); } if (FD_ISSET(tfd, &read_mask)) { unsigned long long missed; //my_printf("do_timer_services"); do_timer_services(TIMER_INTERVAL); missed=read(tfd, &missed, sizeof (missed)); } } if (audit_fgets_eof()) break; } while (stop == 0); shutdown_timer_services(); close(tfd); /* Flush any accumulated events from queue */ auparse_flush_feed(au); auparse_destroy(au); destroy_sessions(); destroy_accounts(); destroy_origins(); destroy_audit(); free_config(&config); if (stop) my_printf("ids is exiting on stop request"); else my_printf("ids is exiting on stdin EOF"); if (l) fclose(l); return 0; } /* This function receives a single complete event from the auparse library. */ static void handle_event(auparse_state_t *au, auparse_cb_event_t cb_event_type, void *user_data __attribute__((unused))) { if (cb_event_type != AUPARSE_CB_EVENT_READY) return; //my_printf("handle_event %s", auparse_get_type_name(au)); /* Do this once for all models */ if (auparse_normalize(au, NORM_OPT_NO_ATTRS)) my_printf("Error normalizing %s", auparse_get_type_name(au)); /* Check for events that are known bad */ process_bad_event_model(au, &config); /* Check if user doing something strange */ process_behavior_model(au, &config); } audit-4.0.2/audisp/plugins/remote/0000755001034500103450000000000014655201457012636 5audit-4.0.2/audisp/plugins/remote/audisp-remote.conf.50000644001034500103450000002657514655201403016354 .TH AUDISP-REMOTE.CONF "5" "Jul 2022" "Red Hat" "System Administration Utilities" .SH NAME audisp-remote.conf \- the audisp-remote configuration file .SH DESCRIPTION \fBaudisp-remote.conf\fP is the file that controls the configuration of the audit remote logging subsystem. The options that are available are as follows: .TP .I remote_server This is a one word character string that is the remote server hostname or address that this plugin will send log information to. This can be the numeric address or a resolvable hostname. .TP .I port This option is an unsigned integer that indicates what port to connect to on the remote machine. .TP .I local_port This option is an unsigned integer that indicates what local port to connect from on the local machine. If unspecified (the default) or set to the word .I any then any available unprivileged port is used. This is a security mechanism to prevent untrusted user space apps from injecting events into the audit daemon. You should set it to an unused port < 1024 to ensure that only privileged users can bind to that port. Then also set the tcp_client_ports in the aggregating auditd.conf file to match the ports that clients are sending from. .TP .I transport This parameter tells the remote logging app how to send events to the remote system. The valid options are .IR TCP ", and " KRB5 ". If set to .IR TCP , the remote logging app will just make a normal clear text connection to the remote system. If its set to .IR KRB5 ", then Kerberos 5 will be used for authentication and encryption. The default value is TCP. .TP .I mode This parameter tells the remote logging app what strategy to use getting records to the remote system. Valid values are .IR immediate ", and " forward " . If set to .IR immediate , the remote logging app will attempt to send events immediately after getting them. .I forward means that it will store the events to disk and then attempt to send the records. If the connection cannot be made, it will queue records until it can connect to the remote system. The depth of the queue is controlled by the .I queue_depth option. .TP .I queue_file Path of a file used for the event queue if .I mode is set to \fIforward\fP. The default is \fB/var/spool/audit/remote.log\fP. .TP .I queue_depth This option is an unsigned integer that determines how many records can be buffered to disk or in memory before considering it to be a failure sending. This parameter affects the .I forward mode of the .I mode option and internal queueing for temporary network outages. The default depth is 2048. .TP .I format This parameter tells the remote logging app what data format will be used for the messages sent over the network. The default is .I managed which adds some overhead to ensure each message is properly handled on the remote end, and to receive status messages from the remote server. If .I ascii is given instead, each message is a simple ASCII text line with no overhead at all. The .I ascii format is a very simplistic protocol. If there are any network problems, it will cause audisp-remote to exit. Auditd may or may not restart it on next event. If something more robust is needed, use the .I managed format. If .I mode is set to \fIforward\fP, .I format must be \fImanaged\fP. .TP .I network_retry_time The time, in seconds, between retries when a network error is detected. Note that this pause applies starting after the second attempt, so as to avoid unneeded delays if a reconnect is sufficient to fix the problem. The default is 1 second. .TP .I max_tries_per_record The maximum number of times an attempt is made to deliver each message. The minimum value is one, as even a completely successful delivery requires at least one try. If too many attempts are made, the network_failure_action action is performed. The default is 3. .TP .I max_time_per_record The maximum amount of time, in seconds, spent attempting to deliver each message. Note that both this and .I max_tries_per_record should be set, as each try may take a long time to time out. The default value is 5 seconds. If too much time is used on a message, the network_failure_action action is performed. .TP .I heartbeat_timeout This parameter determines how often in seconds the client should send a heartbeat event to the remote server. This is used to let both the client and server know that each end is alive and has not terminated in a way that it did not shutdown the connection uncleanly. This value must be coordinated with the server's .I tcp_client_max_idle setting. The default value is 0 which disables sending a heartbeat. .TP .I network_failure_action This parameter tells the system what action to take whenever there is an error detected when sending audit events to the remote system. Valid values are .IR ignore ", " syslog ", " exec ", " warn_once ", " suspend ", " single ", " halt ", and " stop . If set to .IR ignore , the remote logging app does nothing. If an event was sent, its dequeued. .I Syslog means that it will issue a warning to syslog. If an event was sent, its dequeued. This is the default. .I exec /path-to-script will execute the script. You cannot pass parameters to the script. If an event was sent, its dequeued. .I warn_once_continue is like syslog except that only one message is put in syslog until an event is successfully transferred. .I warn_once is like warn_once_continue except that the event is not dequeued. .I Suspend will cause the remote logging app to stop sending records to the remote system. The logging app will still be alive. If an event was sent, it is not dequeued. The .I single option will cause the remote logging app to put the computer system in single user mode. If an event was sent, it is not dequeued. The .I stop option will cause the remote logging app to exit, but leave other plugins running. If an event was sent, it is not dequeued. The .I halt option will cause the remote logging app to shutdown the computer system. If an event was sent, it is not dequeued. The default is to stop. .TP .I disk_low_action Likewise, this parameter tells the system what action to take if the remote end signals a disk low error. The default is ignore. .TP .I disk_full_action Likewise, this parameter tells the system what action to take if the remote end signals a disk full error. The default is warn_once. .TP .I disk_error_action Likewise, this parameter tells the system what action to take if the remote end signals a disk error. The default is warn_once. .TP .I remote_ending_action Likewise, this parameter tells the system what action to take if the network connection is lost. This action has one additional option, .I reconnect which tells the remote plugin to attempt to reconnect to the server upon receipt of the next audit record. If an event was being sent when something triggered this action, it is not dequeued. If it is unsuccessful in reconnecting, the audit record could be lost. The default is to reconnect. .TP .I generic_error_action Likewise, this parameter tells the system what action to take if the remote end signals an error we don't recognize. The default is to log it to syslog. .TP .I generic_warning_action Likewise, this parameter tells the system what action to take if the remote end signals a warning we don't recognize. The default is to log it to syslog. .TP .I queue_error_action Likewise, this parameter tells the system what action to take if there is a problem working with a local record queue. The default is stop. .TP .I overflow_action This parameter tells the system what action to take if the internal event queue overflows. Valid values are .IR ignore ", " syslog ", " suspend ", " single ", and " halt " . If set to .IR ignore , the remote logging app does nothing. .I Syslog means that it will issue a warning to syslog. This is the default. .I Suspend will cause the remote logging app to stop sending records to the remote system. The logging app will still be alive. The .I single option will cause the remote logging app to put the computer system in single user mode. The .I halt option will cause the remote logging app to shutdown the computer system. .TP .I startup_failure_action This parameter tells the system what action to take whenever there is an error connecting to the remote system during startup. Typically, this is benign as the plugin's default behavior is to attempt reconnecting until it succeeds. But there may be times when you want to do something different. Valid values are .IR ignore ", " syslog ", " exec ", " warn_once ", and " warn_once_continue " . If set to .IR ignore , the remote logging app does nothing. .I Syslog means that it will issue a warning to syslog. .I exec /path-to-script will execute the script. You cannot pass parameters to the script. .I warn_once is like syslog except that only one message is put in syslog until an event is successfully transferred. .I warn_once_continue is like warn_once except it ignores the problem. This is the default. .TP .I enable_krb5 This option is deprecated. Use the .IR transport option to enable Kerberos support. If this option follows the transport configuration option, it will override the transport setting. This would be the normal expected behavior for backwards compatibility. If set to .IR yes ", Kerberos 5 will be used for authentication and encryption. Default is .IR no ". Note that encryption can only be used with managed connections, not plain ASCII. .TP .I krb5_principal If specified, This is the expected principal for the server. The client and server will use the specified principal to negotiate the encryption. The format for the .I krb5_principal is like somename/hostname, see the auditd.conf man page for details. If not specified, the krb5_client_name and remote_server values are used. .TP .I krb5_client_name This specifies the name portion of the client's own principal. If unspecified, the default is "auditd". The remainder of the principal will consist of the host's fully qualified domain name and the default Kerberos realm, like this: .I auditd/host14.example.com@EXAMPLE.COM (assuming you gave "auditd" as the krb_client_name). Note that the client and server must have the same principal name and realm. .TP .I krb5_key_file Location of the key for this client's principal. Note that the key file must be owned by root and mode 0400. The default is .I /etc/audisp/audisp-remote.key .SH "NOTES" Specifying a local port may make it difficult to restart the audit subsystem due to the previous connection being in a TIME_WAIT state, if you're reconnecting to and from the same hosts and ports as before. The network failure logic works as follows: The first attempt to deliver normally "just works". If it doesn't, a second attempt is immediately made, perhaps after reconnecting to the server. If the second attempt also fails, .I audispd-remote pauses for the configured time and tries again. It continues to pause and retry until either too many attempts have been made or the allowed time expires. Note that these times govern the maximum amount of time the remote server is allowed in order to reboot, if you want to maintain logging across a reboot. It is recommended to set a large q_depth in auditd.conf if using this plugin. Also set an even bigger q_depth in audisp-remote.conf. Also set the heartbeat_timeout to something non-zero but coordinate it with the server so that it's half the size of the server's tcp_client_max_idle setting. This is required to get retries in a reasonable time if the network has a problem. .SH "SEE ALSO" .BR audisp-remote (8), .BR auditd.conf (5). .SH AUTHOR Steve Grubb audit-4.0.2/audisp/plugins/remote/notes.txt0000644001034500103450000000310514655201403014435 The queue data structure can keep data only in memory, only on disk (writing it to disk and reading from disk), or in both (writing everything to disk, but reading from disk only data stored in a previous run). audisp-remote will use the last option for performance. The queue file format starts with a fixed header, followed by an array of slots for strings. Due to the fixed size of each slot the file format is rather inefficient, but it is also very simple. The file is preallocated and the string slots will be aligned to a 4KB boundary, so it should be necessary to only write one block to disk when audisp-remote receives a (short) audit record. With the default queue size of 200 items the file will be about 2.4 megabytes large, which is probably not really worth worrying about. If necessary, the space utilization could be improved by storing strings consecutively instead of using pre-arranged slots. The queue file format is intended to be resilient against unexpected termination of the process, and should be resilient against unexpected system crash as long as the OS does not reorder writes (the string data is written before the header that indicates that it is present) - but ultimately resiliency against such failures is limited by other links in the audit record transmission chain - if the record is lost within auditd, having a resilient queue file format does not help; audit records generated within the kernel are necessarily lost if the system crashes before they are read by auditd because the kernel will not be able to regenerate/retransmit them after the next boot. audit-4.0.2/audisp/plugins/remote/audisp-remote.c0000644001034500103450000012154214655201403015474 /* audisp-remote.c -- * Copyright 2008-2012,2016,2018,2019-20 Red Hat Inc. * All Rights Reserved. * * 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 * * Authors: * Steve Grubb * */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef USE_GSSAPI #include #include #include #endif #ifdef HAVE_LIBCAP_NG #include #endif #include "libaudit.h" #include "private.h" #include "remote-config.h" #include "common.h" #include "queue.h" #define CONFIG_FILE "/etc/audit/audisp-remote.conf" #define BUF_SIZE 32 /* Error types */ #define ET_SUCCESS 0 #define ET_PERMANENT -1 #define ET_TEMPORARY -2 /* Global Data */ static volatile int stop = 0; static volatile int hup = 0; static volatile int suspend = 0; static volatile int dump = 0; static volatile int transport_ok = 0; static volatile int sock=-1; // We start with remote_ended true so it retries on startup static volatile int remote_ended = 1, quiet = 0; static int ifd; remote_conf_t config; static int warned = 0; /* Constants */ static const char *SINGLE = "1"; static const char *HALT = "0"; static const char *INIT_PGM = "/sbin/init"; static const char *SPOOL_FILE = "/var/spool/audit/remote.log"; /* Local function declarations */ static int check_message(void); static int relay_event(const char *s, size_t len) __attr_access ((__read_only__, 1, 2)); static int relay_sock(const char *s, size_t len) __attr_access ((__read_only__, 1, 2)); static int relay_sock_managed(const char *s, size_t len) __attr_access ((__read_only__, 1, 2)); static int relay_sock_ascii(const char *s, size_t len) __attr_access ((__read_only__, 1, 2)); static int send_msg_tcp (unsigned char *header, const char *msg, uint32_t mlen) __attr_access ((__read_only__, 2, 3)); static int init_transport(void); static int stop_transport(void); static int ar_read (int, void *, int) __attr_access ((__write_only__, 2, 3)); static int ar_write (int, const void *, int) __attr_access ((__read_only__, 2, 3)); #ifdef USE_GSSAPI /* We only ever talk to one server, so we don't need per-connection credentials. These are the ones we talk to the server with. */ gss_ctx_id_t my_context; #define KEYTAB_NAME "/etc/audit/audisp-remote.key" #define CCACHE_NAME "MEMORY:audisp-remote" #define REQ_FLAGS GSS_C_MUTUAL_FLAG | GSS_C_REPLAY_FLAG | GSS_C_INTEG_FLAG | GSS_C_CONF_FLAG #define USE_GSS (config.transport == T_KRB5) #endif /* Compile-time expression verification */ #define verify(E) do { \ char verify__[(E) ? 1 : -1]; \ (void)verify__; \ } while (0) /* * SIGTERM handler */ static void term_handler( int sig ) { stop = 1; } /* * SIGHUP handler: re-read config */ static void hup_handler( int sig ) { hup = 1; } static void reload_config(void) { stop_transport(); // FIXME: We should only stop transport if necessary hup = 0; } /* * SIGSUR1 handler: dump stats */ static void user1_handler( int sig ) { dump = 1; } static void dump_stats(struct queue *queue) { syslog(LOG_INFO, "suspend=%s, remote_ended=%s, transport_ok=%s, queued_items=%zu, queue_depth=%u", suspend ? "yes" : "no", remote_ended ? "yes" : "no", transport_ok ? "yes" : "no", q_queue_length(queue), config.queue_depth); dump = 0; } /* * SIGSUR2 handler: resume logging */ static void user2_handler( int sig ) { suspend = 0; } /* * SIGCHLD handler: reap exiting processes */ static void child_handler(int sig) { while (waitpid(-1, NULL, WNOHANG) > 0) ; /* empty */ } /* * Handlers for various events coming back from the remote server. * Return -1 if the remote dispatcher should exit. */ /* Loss of sync - got an invalid response. */ static int sync_error_handler (const char *why) { /* "why" has human-readable details on why we've lost (or will be losing) sync. Sync errors are transient - if a retry doesn't fix it, we eventually call network_failure_handler which has all the user-tweakable actions. */ syslog (LOG_ERR, "lost/losing sync, %s", why); return 0; } static int is_pipe(int fd) { struct stat st; if (fstat(fd, &st) == 0) { if (S_ISFIFO(st.st_mode)) return 1; } return 0; } static void change_runlevel(const char *level) { char *argv[3]; int pid; pid = fork(); if (pid < 0) { syslog(LOG_ALERT, "audisp-remote failed to fork switching runlevels"); return; } if (pid) /* Parent */ return; /* Child */ argv[0] = (char *)INIT_PGM; argv[1] = (char *)level; argv[2] = NULL; execve(INIT_PGM, argv, NULL); syslog(LOG_ALERT, "audisp-remote failed to exec %s", INIT_PGM); exit(1); } static void safe_exec(const char *exe, const char *message) { char *argv[3]; int pid; if (exe == NULL) { syslog(LOG_ALERT, "Safe_exec passed NULL for program to execute"); return; } pid = fork(); if (pid < 0) { syslog(LOG_ALERT, "audisp-remote failed to fork doing safe_exec"); return; } if (pid) /* Parent */ return; /* Child */ argv[0] = (char *)exe; argv[1] = (char *)message; argv[2] = NULL; execve(exe, argv, NULL); syslog(LOG_ALERT, "audisp-remote failed to exec %s", exe); exit(1); } static int do_action (const char *desc, const char *message, int log_level, failure_action_t action, const char *exe) { switch (action) { case FA_IGNORE: return 0; case FA_SYSLOG: syslog (log_level, "%s, %s", desc, message); return 0; case FA_EXEC: safe_exec (exe, message); return 0; case FA_WARN_ONCE_CONT: if (warned & 1) return -1; warned |= 1; syslog (log_level, "%s, %s", desc, message); return 0; case FA_WARN_ONCE: if (warned & 2) return -1; warned |= 2; syslog (log_level, "%s, %s", desc, message); return -1; case FA_SUSPEND: syslog (log_level, "suspending remote logging due to %s", desc); suspend = 1; return -1; case FA_RECONNECT: syslog (log_level, "remote logging disconnected due to %s, will attempt reconnection", desc); return -1; case FA_SINGLE: syslog (log_level, "remote logging is switching system to single user mode due to %s", desc); change_runlevel(SINGLE); return -1; case FA_HALT: syslog (log_level, "remote logging halting system due to %s", desc); change_runlevel(HALT); return -1; case FA_STOP: syslog (log_level, "remote logging stopping due to %s, %s", desc, message); stop = 1; return -1; } syslog (log_level, "unhandled action %d for %s", action, desc); return -1; } static int network_failure_handler (const char *message) { return do_action ("network failure", message, LOG_WARNING, config.network_failure_action, config.network_failure_exe); } static int remote_disk_low_handler (const char *message) { return do_action ("remote server is low on disk space", message, LOG_WARNING, config.disk_low_action, config.disk_low_exe); } static int remote_disk_full_handler (const char *message) { return do_action ("remote server's disk is full", message, LOG_ERR, config.disk_full_action, config.disk_full_exe); } static int remote_disk_error_handler (const char *message) { return do_action ("remote server has a disk error", message, LOG_ERR, config.disk_error_action, config.disk_error_exe); } static int remote_server_ending_handler (const char *message) { stop_transport(); remote_ended = 1; return do_action ("remote server is going down", message, LOG_WARNING, config.remote_ending_action, config.remote_ending_exe); } static int generic_remote_error_handler (const char *message) { return do_action ("unrecognized remote error", message, LOG_ERR, config.generic_error_action, config.generic_error_exe); } static int generic_remote_warning_handler (const char *message) { return do_action ("unrecognized remote warning", message, LOG_WARNING, config.generic_warning_action, config.generic_warning_exe); } /* Report and handle a queue error, using errno. */ static void queue_error(void) { char *errno_str; errno_str = strerror(errno); do_action("queue error", errno_str, LOG_ERR, config.queue_error_action, config.queue_error_exe); } static int startup_failure_handler(const char *message) { return do_action("startup network failure", message, LOG_WARNING, config.startup_failure_action, config.startup_failure_exe); } static void send_heartbeat (void) { relay_event (NULL, 0); } static void do_overflow_action(void) { switch (config.overflow_action) { case OA_IGNORE: break; case OA_SYSLOG: syslog(LOG_ERR, "queue is full - dropping event"); break; case OA_SUSPEND: syslog(LOG_ALERT, "Audisp-remote is suspending event processing due to overflowing its queue."); suspend = 1; break; case OA_SINGLE: syslog(LOG_ALERT, "Audisp-remote is now changing the system to single user mode due to overflowing its queue"); change_runlevel(SINGLE); break; case OA_HALT: syslog(LOG_ALERT, "Audisp-remote is now halting the system due to overflowing its queue"); change_runlevel(HALT); break; default: syslog(LOG_ALERT, "Unknown overflow action requested"); break; } } /* Initialize and return a queue depending on user's configuration. On error return NULL and set errno. */ static struct queue *init_queue(void) { const char *path; int q_flags; if (config.queue_file != NULL) path = config.queue_file; else path = SPOOL_FILE; q_flags = Q_IN_MEMORY; if (config.mode == M_STORE_AND_FORWARD) /* FIXME: let user control Q_SYNC? */ q_flags |= Q_IN_FILE | Q_CREAT | Q_RESIZE; verify(QUEUE_ENTRY_SIZE >= MAX_AUDIT_MESSAGE_LENGTH); return q_open(q_flags, path, config.queue_depth, QUEUE_ENTRY_SIZE); } /* Send a record from QUEUE to the remote system */ static void send_one(struct queue *queue) { char event[MAX_AUDIT_MESSAGE_LENGTH]; int len; if (suspend || !transport_ok) return; len = q_peek(queue, event, sizeof(event)); if (len == 0) return; if (len < 0) { queue_error(); return; } /* We send len -1 to remove trailing \n */ if (relay_event(event, len-1) < 0) return; /* reset on all successful transmissions */ warned = 0; if (q_drop_head(queue) != 0) queue_error(); } int main(int argc, char *argv[]) { struct sigaction sa; struct queue *queue; size_t q_len; int connected_once = 0; /* Register sighandlers */ sa.sa_flags = 0; sigemptyset(&sa.sa_mask); /* Set handler for the ones we care about */ sa.sa_handler = term_handler; sigaction(SIGTERM, &sa, NULL); sa.sa_handler = hup_handler; sigaction(SIGHUP, &sa, NULL); sa.sa_handler = user1_handler; sigaction(SIGUSR1, &sa, NULL); sa.sa_handler = user2_handler; sigaction(SIGUSR2, &sa, NULL); sa.sa_handler = child_handler; sigaction(SIGCHLD, &sa, NULL); if (load_config(&config, CONFIG_FILE)) return 6; (void) umask( umask( 077 ) | 027 ); // ifd = open("test.log", O_RDONLY); ifd = 0; fcntl(ifd, F_SETFL, O_NONBLOCK); // Start up the queue queue = init_queue(); if (queue == NULL) { syslog(LOG_ERR, "Error initializing audit record queue: %m"); return 1; } #ifdef HAVE_LIBCAP_NG // Drop capabilities capng_clear(CAPNG_SELECT_BOTH); if (config.local_port && config.local_port < 1024) capng_update(CAPNG_ADD, CAPNG_EFFECTIVE|CAPNG_PERMITTED, CAP_NET_BIND_SERVICE); if (capng_apply(CAPNG_SELECT_BOTH)) syslog(LOG_WARNING, "audisp-remote plugin was unable to drop capabilities, continuing with elevated priviles"); #endif syslog(LOG_NOTICE, "Audisp-remote started with queue_size: %zu", q_queue_length(queue)); while (stop == 0) { //FIXME break out when socket is closed fd_set rfd, wfd; struct timeval tv; char event[MAX_AUDIT_MESSAGE_LENGTH]; int n, fds = ifd + 1; /* Load configuration */ if (hup) reload_config(); if (dump) dump_stats(queue); /* Setup select flags */ FD_ZERO(&rfd); FD_SET(ifd, &rfd); // input fd FD_ZERO(&wfd); if (sock >= 0) { // Setup socket to read acks from server FD_SET(sock, &rfd); // remote socket if (sock > ifd) fds = sock + 1; // If we have anything in the queue, // find out if we can send it if (q_queue_length(queue) && !suspend && transport_ok) FD_SET(sock, &wfd); } if (config.format==F_MANAGED && config.heartbeat_timeout>0) { tv.tv_sec = config.heartbeat_timeout; tv.tv_usec = 0; n = select(fds, &rfd, &wfd, NULL, &tv); } else n = select(fds, &rfd, &wfd, NULL, NULL); if (n < 0) continue; // If here, we had some kind of problem if ((config.heartbeat_timeout > 0) && n == 0 && !remote_ended) { /* We attempt a heartbeat if select fails, which * may give us more heartbeats than we need. This * is safer than too few heartbeats. */ if (config.format == F_MANAGED) { quiet = 1; send_heartbeat(); quiet = 0; continue; } } // See if we got a shutdown message from the server if (sock >= 0 && FD_ISSET(sock, &rfd)) check_message(); // If we broke out due to one of these, cycle to start if (hup != 0 || stop != 0) continue; // See if input fd is also set if (FD_ISSET(ifd, &rfd)) { do { if (audit_fgets(event,sizeof(event),ifd) > 0) { if (!transport_ok && remote_ended && (config.remote_ending_action == FA_RECONNECT || !connected_once)) { quiet = 1; if (init_transport() == ET_SUCCESS) { remote_ended = 0; connected_once = 1; } else if (!connected_once) { startup_failure_handler( "First attempt at connecting to server unsuccessful"); } quiet = 0; } /* Strip out EOE records */ if (*event == 't') { if (strncmp(event, "type=EOE", 8) == 0) continue; } else { char *ptr = strchr(event, ' '); if (ptr) { ptr++; if (strncmp(ptr, "type=EOE", 8) == 0) continue; } else continue; //malformed } if (q_append(queue, event) != 0) { if (errno == ENOSPC) do_overflow_action(); else queue_error(); } } else if (audit_fgets_eof()) stop = 1; } while (audit_fgets_more(sizeof(event))); } // See if output fd is also set if (sock >= 0 && FD_ISSET(sock, &wfd)) { // If so, try to drain backlog while (q_queue_length(queue) && !suspend && !stop && transport_ok) send_one(queue); } } // If stdin is a pipe, then flush the queue if (is_pipe(0)) { while (q_queue_length(queue) && !suspend && transport_ok) send_one(queue); } if (sock >= 0) { shutdown(sock, SHUT_RDWR); close(sock); } free_config(&config); q_len = q_queue_length(queue); q_close(queue); if (stop) syslog(LOG_NOTICE, "audisp-remote is exiting on stop request, queue_size: %zu", q_len); return q_len ? 1 : 0; } #ifdef USE_GSSAPI /* Communications under GSS is done by token exchanges. Each "token" may contain a message, perhaps signed, perhaps encrypted. The messages within are what we're interested in, but the network sees the tokens. The protocol we use for transferring tokens is to send the length first, four bytes MSB first, then the token data. We return nonzero on error. */ static int recv_token(int s, gss_buffer_t tok) { int ret; unsigned char lenbuf[4]; unsigned int len; ret = ar_read(s, (char *) lenbuf, 4); if (ret < 0) { syslog(LOG_ERR, "GSS-API error reading token length"); return -1; } else if (!ret) { return 0; } else if (ret != 4) { syslog(LOG_ERR, "GSS-API error reading token length"); return -1; } len = ( ((uint32_t)(lenbuf[0] & 0xFF) << 24) | ((uint32_t)(lenbuf[1] & 0xFF) << 16) | ((uint32_t)(lenbuf[2] & 0xFF) << 8) | (uint32_t)(lenbuf[3] & 0xFF)); if (len > MAX_AUDIT_MESSAGE_LENGTH) { syslog(LOG_ERR, "GSS-API error: event length exceeds MAX_AUDIT_LENGTH"); return -1; } tok->length = len; tok->value = (char *) malloc(tok->length ? tok->length : 1); if (tok->length && tok->value == NULL) { syslog(LOG_ERR, "Out of memory allocating token data %zd %zx", tok->length, tok->length); return -1; } ret = ar_read(s, (char *) tok->value, tok->length); if (ret < 0) { syslog(LOG_ERR, "GSS-API error reading token data"); free(tok->value); return -1; } else if (ret != (int) tok->length) { syslog(LOG_ERR, "GSS-API error reading token data"); free(tok->value); return -1; } return 0; } /* Same here. */ static int send_token(int s, gss_buffer_t tok) { int ret; unsigned char lenbuf[4]; unsigned int len; if (tok->length > 0xffffffffUL) return -1; len = tok->length; lenbuf[0] = (len >> 24) & 0xff; lenbuf[1] = (len >> 16) & 0xff; lenbuf[2] = (len >> 8) & 0xff; lenbuf[3] = len & 0xff; ret = ar_write(s, (char *) lenbuf, 4); if (ret < 0) { syslog(LOG_ERR, "GSS-API error sending token length"); return -1; } else if (ret != 4) { syslog(LOG_ERR, "GSS-API error sending token length"); return -1; } ret = ar_write(s, tok->value, tok->length); if (ret < 0) { syslog(LOG_ERR, "GSS-API error sending token data"); return -1; } else if (ret != (int) tok->length) { syslog(LOG_ERR, "GSS-API error sending token data"); return -1; } return 0; } static void gss_failure_2 (const char *msg, int status, int type) { OM_uint32 message_context = 0; OM_uint32 min_status = 0; gss_buffer_desc status_string; do { gss_display_status (&min_status, status, type, GSS_C_NO_OID, &message_context, &status_string); syslog (LOG_ERR, "GSS error: %s: %s", msg, (char *)status_string.value); gss_release_buffer(&min_status, &status_string); } while (message_context != 0); } static void gss_failure (const char *msg, int major_status, int minor_status) { gss_failure_2 (msg, major_status, GSS_C_GSS_CODE); if (minor_status) gss_failure_2 (msg, minor_status, GSS_C_MECH_CODE); } #define KLOG(x,f) { \ const char *kstr = krb5_get_error_message(kcontext, x); \ syslog (LOG_ERR, "krb5 error: %s in %s\n", kstr, f); \ krb5_free_error_message(kcontext, kstr); } static krb5_context kcontext = NULL; static char *realm_name = NULL; static krb5_principal audit_princ; static krb5_ccache ccache = NULL; static krb5_get_init_creds_opt options; static krb5_keytab keytab = NULL; /* Each time we connect to the server, we negotiate a set of credentials and a security context. To do this, we need our own credentials first. For other Kerberos applications, the user will have called kinit (or otherwise authenticated) first, but we don't have that luxury. So, we implement part of kinit here. When our tickets expire, the usual close/open/retry logic has us calling here again, where we re-init and get new tickets. */ static int negotiate_credentials (void) { gss_buffer_desc empty_token_buf = { 0, (void *) "" }; gss_buffer_t empty_token = &empty_token_buf; gss_buffer_desc send_tok, recv_tok, *token_ptr; gss_ctx_id_t *gss_context = &my_context; gss_buffer_desc name_buf; gss_name_t service_name_e; OM_uint32 major_status, minor_status, init_sec_min_stat; OM_uint32 ret_flags; /* Getting an initial ticket is outside the scope of GSS, so we use Kerberos calls here. */ int krberr; krb5_creds my_creds; const char *krb5_client_name; char *slashptr; char host_name[255]; struct stat st; const char *key_file; token_ptr = GSS_C_NO_BUFFER; *gss_context = GSS_C_NO_CONTEXT; recv_tok.value = NULL; krberr = krb5_init_context (&kcontext); if (krberr) { KLOG (krberr, "krb5_init_context"); return -1; } if (config.krb5_key_file) key_file = config.krb5_key_file; else key_file = KEYTAB_NAME; unsetenv ("KRB5_KTNAME"); setenv ("KRB5_KTNAME", key_file, 1); if (stat (key_file, &st) == 0) { if ((st.st_mode & 07777) != 0400) { if (!quiet) syslog (LOG_ERR, "%s is not mode 0400 (it's %#o) - compromised key?", key_file, st.st_mode & 07777); goto error1; } if (st.st_uid != 0) { if (!quiet) syslog (LOG_ERR, "%s is not owned by root (it's %d) - compromised key?", key_file, st.st_uid); goto error1; } } /* This looks up the default real (*our* realm) from /etc/krb5.conf (or wherever) */ krberr = krb5_get_default_realm (kcontext, &realm_name); if (krberr) { KLOG (krberr, "krb5_get_default_realm"); goto error1; } krb5_client_name = config.krb5_client_name ? config.krb5_client_name : "auditd"; if (gethostname(host_name, sizeof(host_name)) != 0) { if (!quiet) syslog (LOG_ERR, "gethostname: host name longer than %lu characters?", sizeof (host_name)); goto error2; } syslog (LOG_ERR, "kerberos principal: %s/%s@%s\n", krb5_client_name, host_name, realm_name); /* Encode our own "name" as auditd/remote@EXAMPLE.COM. */ krberr = krb5_build_principal (kcontext, &audit_princ, strlen(realm_name), realm_name, krb5_client_name, host_name, NULL); if (krberr) { KLOG (krberr, "krb5_build_principal"); goto error2; } /* Locate our machine's key table, where our private key is * held. */ krberr = krb5_kt_resolve (kcontext, key_file, &keytab); if (krberr) { KLOG (krberr, "krb5_kt_resolve"); goto error3; } /* Identify a cache to hold the key in. The GSS wrappers look up our credentials here. */ krberr = krb5_cc_resolve (kcontext, CCACHE_NAME, &ccache); if (krberr) { KLOG (krberr, "krb5_cc_resolve"); goto error4; } setenv("KRB5CCNAME", CCACHE_NAME, 1); memset(&my_creds, 0, sizeof(my_creds)); memset(&options, 0, sizeof(options)); krb5_get_init_creds_opt_set_address_list(&options, NULL); krb5_get_init_creds_opt_set_forwardable(&options, 0); krb5_get_init_creds_opt_set_proxiable(&options, 0); krb5_get_init_creds_opt_set_tkt_life(&options, 24*60*60); /* Load our credentials from the key table. */ krberr = krb5_get_init_creds_keytab(kcontext, &my_creds, audit_princ, keytab, 0, NULL, &options); if (krberr) { KLOG (krberr, "krb5_get_init_creds_keytab"); goto error5; } /* Create the cache... */ krberr = krb5_cc_initialize(kcontext, ccache, audit_princ); if (krberr) { KLOG (krberr, "krb5_cc_initialize"); goto error5; } /* ...and store our credentials in it. */ krberr = krb5_cc_store_cred(kcontext, ccache, &my_creds); if (krberr) { KLOG (krberr, "krb5_cc_store_cred"); goto error5; } /* The GSS code now has a set of credentials for this program. I.e. we know who "we" are. Now we talk to the server to get its credentials and set up a security context for encryption. */ if (config.krb5_principal == NULL) { const char *name = config.krb5_client_name ? config.krb5_client_name : "auditd"; config.krb5_principal = (char *) malloc (strlen (name) + 1 + strlen (config.remote_server) + 1); sprintf((char *)config.krb5_principal, "%s@%s", name, config.remote_server); } slashptr = strchr (config.krb5_principal, '/'); if (slashptr) *slashptr = '@'; name_buf.value = (char *)config.krb5_principal; name_buf.length = strlen(name_buf.value) + 1; major_status = gss_import_name(&minor_status, &name_buf, (gss_OID) gss_nt_service_name, &service_name_e); if (major_status != GSS_S_COMPLETE) { gss_failure("importing name", major_status, minor_status); goto error5; } /* Someone has to go first. In this case, it's us. */ if (send_token(sock, empty_token) < 0) { (void) gss_release_name(&minor_status, &service_name_e); goto error5; } /* The server starts this loop with the token we just sent (the empty one). We start this loop with "no token". */ token_ptr = GSS_C_NO_BUFFER; *gss_context = GSS_C_NO_CONTEXT; do { /* Give GSS a chance to digest what we have so far. */ major_status = gss_init_sec_context(&init_sec_min_stat, GSS_C_NO_CREDENTIAL, gss_context, service_name_e, NULL, REQ_FLAGS, 0, NULL, /* no channel bindings */ token_ptr, NULL, /* ignore mech type */ &send_tok, &ret_flags, NULL); /* ignore time_rec */ if (token_ptr != GSS_C_NO_BUFFER) free(recv_tok.value); /* Send the server any tokens requested of us. */ if (send_tok.length != 0) { if (send_token(sock, &send_tok) < 0) { (void) gss_release_buffer(&minor_status, &send_tok); (void) gss_release_name(&minor_status, &service_name_e); goto error5; } } (void) gss_release_buffer(&minor_status, &send_tok); if (major_status != GSS_S_COMPLETE && major_status != GSS_S_CONTINUE_NEEDED) { gss_failure("initializing context", major_status, init_sec_min_stat); (void) gss_release_name(&minor_status, &service_name_e); if (*gss_context != GSS_C_NO_CONTEXT) gss_delete_sec_context(&minor_status, gss_context, GSS_C_NO_BUFFER); goto error5; } /* Now get any tokens the sever sends back. We use these back at the top of the loop. */ if (major_status == GSS_S_CONTINUE_NEEDED) { if (recv_token(sock, &recv_tok) < 0) { (void) gss_release_name(&minor_status, &service_name_e); goto error5; } token_ptr = &recv_tok; } } while (major_status == GSS_S_CONTINUE_NEEDED); (void) gss_release_name(&minor_status, &service_name_e); #if 0 major_status = gss_inquire_context (&minor_status, &my_context, NULL, &service_name_e, NULL, NULL, NULL, NULL, NULL); if (major_status != GSS_S_COMPLETE) { gss_failure("inquiring target name", major_status, minor_status); return -1; } major_status = gss_display_name(&minor_status, service_name_e, &recv_tok, NULL); gss_release_name(&minor_status, &service_name_e); if (major_status != GSS_S_COMPLETE) { gss_failure("displaying name", major_status, minor_status); return -1; } syslog(LOG_INFO, "GSS-API Connected to: %s", (char *)recv_tok.value); #endif return 0; error5: krb5_cc_close(kcontext, ccache); ccache = NULL; error4: krb5_kt_close(kcontext, keytab); keytab = NULL; error3: krb5_free_principal(kcontext, audit_princ); error2: krb5_free_default_realm(kcontext, realm_name); realm_name = NULL; error1: krb5_free_context(kcontext); kcontext = NULL; return -1; } #endif // USE_GSSAPI static int stop_sock(void) { if (sock >= 0) { #ifdef USE_GSSAPI if (USE_GSS) { OM_uint32 minor_status; gss_delete_sec_context(&minor_status, &my_context, GSS_C_NO_BUFFER); my_context = GSS_C_NO_CONTEXT; krb5_cc_close(kcontext, ccache); ccache = NULL; krb5_kt_close(kcontext, keytab); keytab = NULL; krb5_free_principal(kcontext, audit_princ); krb5_free_default_realm(kcontext, realm_name); realm_name = NULL; krb5_free_context(kcontext); kcontext = NULL; } #endif shutdown(sock, SHUT_RDWR); close(sock); } sock = -1; transport_ok = 0; return 0; } static int stop_transport(void) { int rc; switch (config.transport) { case T_TCP: case T_KRB5: rc = stop_sock(); break; default: rc = -1; break; } return rc; } static int init_sock(void) { int rc; struct addrinfo *ai, *runp; struct addrinfo hints; char remote[BUF_SIZE]; int one=1; if (sock >= 0) { syslog(LOG_NOTICE, "socket already setup"); transport_ok = 1; return ET_SUCCESS; } // Resolve the remote host memset(&hints, '\0', sizeof(hints)); hints.ai_flags = AI_ADDRCONFIG|AI_NUMERICSERV; hints.ai_socktype = SOCK_STREAM; snprintf(remote, BUF_SIZE, "%u", config.port); rc = getaddrinfo(config.remote_server, remote, &hints, &ai); if (rc) { if (!quiet) syslog(LOG_ERR, "Error looking up remote host: %s - exiting", gai_strerror(rc)); if (rc == EAI_NONAME || rc == EAI_NODATA) return ET_PERMANENT; else return ET_TEMPORARY; } // Cycle through the list until we connect runp = ai; while (runp) { if (sock >= 0) close(sock); sock = socket(runp->ai_family, runp->ai_socktype, runp->ai_protocol); if (sock < 0) { if (!quiet) syslog(LOG_ERR, "Error creating socket: %s", strerror(errno)); goto next_try; } setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char *)&one, sizeof (int)); // If we are binding, resolve something relative to // the address of the aggregating server if (config.local_port != 0) { struct addrinfo *ai2; struct addrinfo hints2; char local[BUF_SIZE]; // Ask for setting that can be used for bind memset(&hints2, '\0', sizeof(hints2)); hints2.ai_flags = AI_PASSIVE | AI_ADDRCONFIG; hints2.ai_socktype = SOCK_STREAM; hints2.ai_family = runp->ai_family; hints2.ai_protocol = runp->ai_protocol; snprintf(local, BUF_SIZE, "%u", config.local_port); rc = getaddrinfo(NULL, local, &hints2, &ai2); if (rc) { if (!quiet) syslog(LOG_ERR, "Error looking up local host: %s - retrying", gai_strerror(rc)); stop_sock(); goto next_try; } // We are not going to cycle through the list. // If done right only one should be on list. if (bind(sock, ai2->ai_addr, ai2->ai_addrlen)) { if (!quiet) syslog(LOG_ERR, "Cannot bind local socket to port %u", config.local_port); stop_sock(); freeaddrinfo(ai2); goto next_try; } freeaddrinfo(ai2); } if (connect(sock, runp->ai_addr, runp->ai_addrlen)) { if (!quiet) syslog(LOG_ERR, "Error connecting to %s: %s", config.remote_server, strerror(errno)); stop_sock(); } else break; // Success, quit trying next_try: runp = runp->ai_next; } // If the list was exhausted and no connection, we failed. if (runp == NULL) { rc = ET_PERMANENT; goto out; } rc = ET_SUCCESS; setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, (char *)&one, sizeof (int)); /* The idea here is to minimize the time between the message and the ACK, assuming that individual messages are infrequent enough that we can ignore the inefficiency of sending the header and message in separate packets. */ if (config.format == F_MANAGED) setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, (char *)&one, sizeof (int)); #ifdef USE_GSSAPI if (USE_GSS) { if (negotiate_credentials()) { rc = ET_PERMANENT; goto out; } } #endif transport_ok = 1; syslog(LOG_NOTICE, "Connected to %s", config.remote_server); out: freeaddrinfo(ai); return rc; } static int init_transport(void) { int rc; switch (config.transport) { case T_TCP: case T_KRB5: rc = init_sock(); // We set this so that it will retry the connection if (rc == ET_TEMPORARY) remote_ended = 1; break; default: rc = ET_PERMANENT; break; } return rc; } static int ar_write (int sk, const void *buf, int len) { int rc = 0, r; while (len > 0) { do { r = write(sk, buf, len); } while (r < 0 && errno == EINTR); if (r < 0) { if (errno == EPIPE) stop_sock(); return r; } if (r == 0) break; rc += r; buf = (void *)((char *)buf + r); len -= r; } return rc; } // Returns positive number on success, -1 on failure static int ar_read (int sk, void *buf, int len) { int rc = 0, r, timeout = config.max_time_per_record * 1000; struct pollfd pfd; errno = 0; pfd.fd = sk; pfd.events = POLLIN | POLLPRI | POLLHUP | POLLERR | POLLNVAL; while (len > 0) { do { // Reads can hang if cable is disconnected int prc = poll(&pfd, (nfds_t) 1, timeout); if (prc <= 0) return -1; r = read(sk, buf, len); } while (r < 0 && errno == EINTR); if (r < 0) { // This means real network problem happened if (errno == EPIPE) stop_sock(); return r; } if (r == 0) { // If errno == 0, remote end closed socket normally if (errno == 0) { stop_sock(); remote_ended = 1; } break; } rc += r; buf = (void *)((char *)buf + r); len -= r; } return rc; } static int relay_sock_ascii(const char *s, size_t len) { int rc; if (len == 0) return 0; if (!transport_ok) { if (init_transport ()) return -1; } rc = ar_write(sock, s, len); if (rc <= 0) { stop = 1; stop_transport(); syslog(LOG_ERR,"Connection to %s closed unexpectedly - exiting", config.remote_server); return -1; } return 0; } #ifdef USE_GSSAPI /* Sending an encrypted message is pretty simple - wrap the message in a token, and send the token. The server unwraps it to get the original message. */ static int send_msg_gss (unsigned char *header, const char *msg, uint32_t mlen) { OM_uint32 major_status, minor_status; gss_buffer_desc utok, etok; int rc; utok.length = AUDIT_RMW_HEADER_SIZE + mlen; utok.value = malloc (utok.length); memcpy (utok.value, header, AUDIT_RMW_HEADER_SIZE); if (msg != NULL && mlen > 0) memcpy (utok.value+AUDIT_RMW_HEADER_SIZE, msg, mlen); major_status = gss_wrap (&minor_status, my_context, 1, GSS_C_QOP_DEFAULT, &utok, NULL, &etok); if (major_status != GSS_S_COMPLETE) { gss_failure("encrypting message", major_status, minor_status); free (utok.value); return -1; } rc = send_token (sock, &etok); free (utok.value); (void) gss_release_buffer(&minor_status, &etok); return rc ? -1 : 0; } /* Likewise here. */ static int recv_msg_gss (unsigned char *header, char *msg, uint32_t *mlen) { OM_uint32 major_status, minor_status; gss_buffer_desc utok, etok; int hver, mver, rc; uint32_t type, rlen, seq; rc = recv_token (sock, &etok); if (rc) return -1; major_status = gss_unwrap (&minor_status, my_context, &etok, &utok, NULL, NULL); if (major_status != GSS_S_COMPLETE) { gss_failure("decrypting message", major_status, minor_status); free (utok.value); free (etok.value); return -1; } if (utok.length < AUDIT_RMW_HEADER_SIZE) { sync_error_handler ("message too short"); free (utok.value); free (etok.value); return -1; } memcpy (header, utok.value, AUDIT_RMW_HEADER_SIZE); if (! AUDIT_RMW_IS_MAGIC (header, AUDIT_RMW_HEADER_SIZE)) { sync_error_handler ("bad magic number"); free (utok.value); free (etok.value); return -1; } AUDIT_RMW_UNPACK_HEADER (header, hver, mver, type, rlen, seq); if (rlen > MAX_AUDIT_MESSAGE_LENGTH) { sync_error_handler ("message too long"); free (utok.value); free (etok.value); return -1; } memcpy (msg, utok.value+AUDIT_RMW_HEADER_SIZE, rlen); *mlen = rlen; free (utok.value); free (etok.value); return 0; } #endif // USE_GSSAPI static int send_msg_tcp (unsigned char *header, const char *msg, uint32_t mlen) { int rc; rc = ar_write(sock, header, AUDIT_RMW_HEADER_SIZE); if (rc <= 0) { syslog(LOG_ERR, "send to %s failed", config.remote_server); return 1; } if (msg != NULL && mlen > 0) { rc = ar_write(sock, msg, mlen); if (rc <= 0) { syslog(LOG_ERR, "send to %s failed", config.remote_server); return 1; } } return 0; } // Returns 0 on success and -1 on failure static int recv_msg_tcp (unsigned char *header, char *msg, uint32_t *mlen) { int hver, mver, rc; uint32_t type, rlen, seq; errno = 0; rc = ar_read (sock, header, AUDIT_RMW_HEADER_SIZE); if (rc < 16) { if (rc == -1 && errno == 0) syslog(LOG_ERR, "ack from %s timed out", config.remote_server); else syslog(LOG_ERR, "read from %s failed", config.remote_server); return -1; } if (! AUDIT_RMW_IS_MAGIC (header, AUDIT_RMW_HEADER_SIZE)) { /* FIXME: the right thing to do here is close the socket * and start a new one. */ sync_error_handler ("bad magic number"); return -1; } AUDIT_RMW_UNPACK_HEADER (header, hver, mver, type, rlen, seq); if (rlen > MAX_AUDIT_MESSAGE_LENGTH) { sync_error_handler ("message too long"); return -1; } if (rlen > 0 && ar_read (sock, msg, rlen) < rlen) { sync_error_handler ("ran out of data reading reply"); return -1; } return 0; } static int check_message_managed(void) { unsigned char header[AUDIT_RMW_HEADER_SIZE]; int hver, mver; uint32_t type, rlen, seq; char msg[MAX_AUDIT_MESSAGE_LENGTH+1]; #ifdef USE_GSSAPI if (USE_GSS) { if (recv_msg_gss (header, msg, &rlen)) { stop_transport(); return -1; } } else #endif if (recv_msg_tcp(header, msg, &rlen)) { stop_transport(); return -1; } AUDIT_RMW_UNPACK_HEADER(header, hver, mver, type, rlen, seq); msg[rlen] = 0; if (type == AUDIT_RMW_TYPE_ENDING) return remote_server_ending_handler(msg); if (type == AUDIT_RMW_TYPE_DISKLOW) return remote_disk_low_handler(msg); if (type == AUDIT_RMW_TYPE_DISKFULL) { // Can't log for a while might want a delay stop_transport(); return remote_disk_full_handler(msg); } if (type == AUDIT_RMW_TYPE_DISKERROR) { // Can't log for a while might want a delay stop_transport(); return remote_disk_error_handler(msg); } return 0; } /* If this gets called, it most likely means that the remote end died. * We need to try a read to get the EPIPE so that we can close out the * connection. */ static int check_message_ascii(void) { int rc; char buf[64]; rc = ar_read(sock, buf, sizeof(buf)); if (rc < 0 || remote_ended) stop = 1; return 0; } /* This is to check for async notification like server is shutting down */ static int check_message(void) { int rc; switch (config.format) { case F_MANAGED: rc = check_message_managed(); break; case F_ASCII: rc = check_message_ascii(); break; default: rc = -1; break; } return rc; } static int relay_sock_managed(const char *s, size_t len) { static int sequence_id = 1; unsigned char header[AUDIT_RMW_HEADER_SIZE]; int hver, mver; uint32_t type, rlen, seq; char msg[MAX_AUDIT_MESSAGE_LENGTH+1]; unsigned int n_tries_this_message = 0; time_t now, then = 0; sequence_id ++; try_again: time (&now); if (then == 0) then = now; /* We want the first retry to be quick, in case the network failed for some fail-once reason. In this case, it goes "failure - reconnect - send". Only if this quick retry fails do we start pausing between retries to prevent swamping the local computer and the network. */ if (n_tries_this_message > 1) sleep (config.network_retry_time); if (n_tries_this_message > config.max_tries_per_record) { network_failure_handler ("max retries exhausted"); return -1; } if ((now - then) > config.max_time_per_record) { network_failure_handler ("max retry time exhausted"); return -1; } n_tries_this_message ++; if (!transport_ok) { if (init_transport ()) goto try_again; } type = (s != NULL) ? AUDIT_RMW_TYPE_MESSAGE : AUDIT_RMW_TYPE_HEARTBEAT; AUDIT_RMW_PACK_HEADER (header, 0, type, len, sequence_id); #ifdef USE_GSSAPI if (USE_GSS) { if (send_msg_gss (header, s, len)) { stop_transport (); goto try_again; } } else #endif if (send_msg_tcp (header, s, len)) { stop_transport (); goto try_again; } #ifdef USE_GSSAPI if (USE_GSS) { if (recv_msg_gss (header, msg, &rlen)) { stop_transport (); goto try_again; } } else #endif if (recv_msg_tcp (header, msg, &rlen)) { stop_transport (); goto try_again; } AUDIT_RMW_UNPACK_HEADER (header, hver, mver, type, rlen, seq); msg[rlen] = 0; /* Handle this first. It doesn't matter if seq compares or not * since the other end is going down...deal with it. */ if (type == AUDIT_RMW_TYPE_ENDING) return remote_server_ending_handler (msg); if (seq != sequence_id) { /* FIXME: should we read another header and see if it matches? If so, we need to deal with timeouts. */ if (sync_error_handler ("mismatched response")) return -1; stop_transport(); goto try_again; } /* Specific errors we know how to deal with. */ if (type == AUDIT_RMW_TYPE_DISKLOW) return remote_disk_low_handler (msg); if (type == AUDIT_RMW_TYPE_DISKFULL) { // Can't log for a while might want a delay stop_transport(); return remote_disk_full_handler (msg); } if (type == AUDIT_RMW_TYPE_DISKERROR) { // Can't log for a while might want a delay stop_transport(); return remote_disk_error_handler (msg); } /* Generic errors. */ if (type & AUDIT_RMW_TYPE_FATALMASK) return generic_remote_error_handler (msg); if (type & AUDIT_RMW_TYPE_WARNMASK) return generic_remote_warning_handler (msg); return 0; } static int relay_sock(const char *s, size_t len) { int rc; switch (config.format) { case F_MANAGED: rc = relay_sock_managed (s, len); break; case F_ASCII: rc = relay_sock_ascii (s, len); break; default: rc = -1; break; } return rc; } /* Send audit event to remote system */ static int relay_event(const char *s, size_t len) { int rc; switch (config.transport) { case T_TCP: case T_KRB5: rc = relay_sock(s, len); break; default: rc = -1; break; } return rc; } audit-4.0.2/audisp/plugins/remote/queue.h0000644001034500103450000000541314655201403014045 /* queue.h -- a queue abstraction * Copyright 2009, 2011 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb * Miloslav Trmač */ #ifndef QUEUE_HEADER #define QUEUE_HEADER #include #include "common.h" // attribute decls struct queue; enum { // Queue storage. Both options can be set at the same time. Q_IN_MEMORY = 1 << 0, // Keep a copy of the queue in memory Q_IN_FILE = 1 << 1, // Store the queue in a file // Other flags for use with Q_IN_FILE Q_CREAT = 1 << 2, // Create the queue if it does not exist Q_EXCL = 1 << 3, // With Q_CREAT, don't open an existing queue Q_SYNC = 1 << 4, // fdatasync() after each operation Q_RESIZE = 1 << 5, // resize the queue if needed }; /* MAX_AUDIT_MESSAGE_LENGTH, aligned to 4 KB so that an average q_append() only writes to two disk disk blocks (1 aligned data block, 1 header block). */ #define QUEUE_ENTRY_SIZE (3*4096) /* Close Q. */ void q_close(struct queue *q); /* Open a queue using Q_FLAGS and return it. If Q_IN_FILE: use PATH for the * file, NUM_ENTRIES must be the same for all users of the file unless Q_RESIZE * is set. ENTRY_SIZE is the maximum length of a stored string, including the * trailing NUL. If Q_IN_FILE, it must be the same for all users of the file. * On error, return NULL and set errno. */ struct queue *q_open(int q_flags, const char *path, size_t num_entries, size_t entry_size) __attribute_malloc__ __attr_dealloc (q_close, 1) __wur; /* Add DATA to tail of Q. Return 0 on success, -1 on error and set errno. */ int q_append(struct queue *q, const char *data); /* Peek at head of Q, storing it into BUF of SIZE. Return 1 if an entry * exists, 0 if queue is empty. On error, return -1 and set errno. */ int q_peek(struct queue *q, char *buf, size_t size) __attr_access ((__write_only__, 2, 3)); /* Drop head of Q and return 0. On error, return -1 and set errno. */ int q_drop_head(struct queue *q); /* Return the number of entries in Q. */ size_t q_queue_length(const struct queue *q); #endif audit-4.0.2/audisp/plugins/remote/audisp-remote.80000644001034500103450000000255114655201403015417 .TH AUDISP-REMOTE "8" "August 2018" "Red Hat" "System Administration Utilities" .SH NAME audisp-remote \- plugin for remote logging .SH SYNOPSIS .B audisp-remote .SH DESCRIPTION \fBaudisp-remote\fP is a plugin for the audit event dispatcher that performs remote logging to an aggregate logging server. .SH TIPS If you are aggregating multiple machines, you should edit auditd.conf to set the name_format to something meaningful and the log_format to enriched. This way you can tell where the event came from and have the user name and groups resolved locally before it is sent off of the machine. .SH SIGNALS .TP SIGUSR1 Causes the audisp-remote program to write the value of some of its internal flags to syslog. The .IR suspend flag tells whether or not logging has been suspended. The .IR remote_ended flag tells if the connection was broken by the server saying it can't log events. The .IR transport_ok flag tells whether or not the connection to the remote server is healthy. The .IR queue_size tells how many records are enqueued to be sent to the remote server. .TP SIGUSR2 Causes the audisp-remote program to resume logging if it were suspended due to an error. .SH FILES /etc/audit/audisp-remote.conf /etc/audit/plugins.d/au-remote.conf /etc/audit/auditd.conf .SH "SEE ALSO" .BR auditd.conf (8), .BR auditd-plugins (5), .BR audisp-remote.conf (5). .SH AUTHOR Steve Grubb audit-4.0.2/audisp/plugins/remote/audisp-remote.conf0000644001034500103450000000135714655201403016200 # # This file controls the configuration of the audit remote # logging subsystem, audisp-remote. # remote_server = port = 60 ##local_port = transport = tcp queue_file = /var/spool/audit/remote.log mode = immediate queue_depth = 10240 format = managed network_retry_time = 1 max_tries_per_record = 3 max_time_per_record = 5 heartbeat_timeout = 0 network_failure_action = stop disk_low_action = ignore disk_full_action = warn_once disk_error_action = warn_once remote_ending_action = reconnect generic_error_action = syslog generic_warning_action = syslog queue_error_action = stop overflow_action = syslog startup_failure_action = warn_once_continue ##krb5_principal = ##krb5_client_name = auditd ##krb5_key_file = /etc/audisp/audisp-remote.key audit-4.0.2/audisp/plugins/remote/queue.c0000644001034500103450000003250714655201403014044 /* queue.c - a string queue implementation * Copyright 2009, 2011 Red Hat Inc., Durham, North Carolina. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb * Miloslav Trmač */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include "queue.h" struct queue { int flags; /* Q_* */ int fd; /* -1 if !Q_IN_FILE */ /* NULL if !Q_IN_MEMORY. [i] contains a memory copy of the queue entry "i", if known - it may be NULL even if entry exists. */ unsigned char **memory; size_t num_entries; size_t entry_size; size_t queue_head; size_t queue_length; unsigned char buffer[]; /* Used only locally within q_peek() */ }; /* Local Declarations */ static int full_pread(int fd, void *buf, size_t size, off_t offset) __attr_access ((__write_only__, 2, 3)); static int full_pwrite(int fd, const void *buf, size_t size, off_t offset) __attr_access ((__read_only__, 2, 3)); /* Compile-time expression verification */ #define verify(E) do { \ char verify__[(E) ? 1 : -1]; \ (void)verify__; \ } while (0) /* Like pread(), except that it handles partial reads, and returns 0 on success. */ static int full_pread(int fd, void *buf, size_t size, off_t offset) { while (size != 0) { ssize_t run, res; if (size > QUEUE_ENTRY_SIZE) run = QUEUE_ENTRY_SIZE; else run = size; res = pread(fd, buf, run, offset); if (res < 0) return -1; if (res == 0) { errno = ENXIO; /* Any better value? */ return -1; } buf = (unsigned char *)buf + res; size -= res; offset += res; } return 0; } /* Like pwrite(), except that it handles partial writes, and returns 0 on success. */ static int full_pwrite(int fd, const void *buf, size_t size, off_t offset) { while (size != 0) { ssize_t run, res; if (size > QUEUE_ENTRY_SIZE) run = QUEUE_ENTRY_SIZE; else run = size; res = pwrite(fd, buf, run, offset); if (res < 0) return -1; if (res == 0) { errno = ENXIO; /* Any better value? */ return -1; } buf = (const unsigned char *)buf + res; size -= res; offset += res; } return 0; } /* File format and utilities */ /* The mutable part of struct file_header */ struct fh_state { uint32_t queue_head; /* 0-based index of the first non-empty entry */ uint32_t queue_length; /* [0, num_entries] */ }; /* All integer values are in network byte order (big endian) */ struct file_header { uint8_t magic[14]; /* See fh_magic below */ uint8_t version; /* File format version, see FH_VERSION* below */ uint8_t reserved; /* Must be 0 */ /* Total file size is (num_entries + 1) * entry_size. This must fit into SIZE_MAX because the "len" parameter of posix_fallocate has a size_t type. */ uint32_t num_entries; /* Total number of entries allocated */ uint32_t entry_size; struct fh_state s; }; /* Contains a '\0' byte to unambiguously mark the file as a binary file. */ static const uint8_t fh_magic[14] = "\0audisp-remote"; #define FH_VERSION_0 0x00 /* Return file position for ENTRY in Q */ static size_t entry_offset (const struct queue *q, size_t entry) { return (entry + 1) * q->entry_size; } /* Synchronize Q if required and return 0. On error, return -1 and set errno. */ static int q_sync(struct queue *q) { if ((q->flags & Q_SYNC) == 0) return 0; return fdatasync(q->fd); } /* Sync file's fh_state with Q, q_sync (Q), and return 0. On error, return -1 and set errno. */ static int sync_fh_state (struct queue *q) { struct fh_state s; if (q->fd == -1) return 0; s.queue_head = htonl(q->queue_head); s.queue_length = htonl(q->queue_length); if (full_pwrite(q->fd, &s, sizeof(s), offsetof(struct file_header, s)) != 0) return -1; return q_sync(q); } /* Queue implementation */ /* Open PATH for Q, update Q from it, and return 0. On error, return -1 and set errno; Q->fd may be set even on error. */ static int q_open_file(struct queue *q, const char *path) { int open_flags, fd_flags; struct stat st; struct file_header fh; open_flags = O_RDWR; if ((q->flags & Q_CREAT) != 0) open_flags |= O_CREAT; if ((q->flags & Q_EXCL) != 0) open_flags |= O_EXCL; q->fd = open(path, open_flags, S_IRUSR | S_IWUSR); if (q->fd == -1) return -1; fd_flags = fcntl(q->fd, F_GETFD); if (fd_flags < 0) return -1; if (fcntl(q->fd, F_SETFD, fd_flags | FD_CLOEXEC) == -1) return -1; /* File locking in POSIX is pretty much broken... let's hope nobody attempts to open a single file twice within the same process. open() above has initialized the file offset to 0, so the lockf() below affects the whole file. */ if (lockf(q->fd, F_TLOCK, 0) != 0) { if (errno == EACCES || errno == EAGAIN) errno = EBUSY; /* This makes more sense... */ return -1; } if (fstat(q->fd, &st) != 0) return -1; if (st.st_size == 0) { verify(sizeof(fh.magic) == sizeof(fh_magic)); memcpy(fh.magic, fh_magic, sizeof(fh.magic)); fh.version = FH_VERSION_0; fh.reserved = 0; fh.num_entries = htonl(q->num_entries); fh.entry_size = htonl(q->entry_size); fh.s.queue_head = htonl(0); fh.s.queue_length = htonl(0); if (full_pwrite(q->fd, &fh, sizeof(fh), 0) != 0) return -1; if (q_sync(q) != 0) return -1; #ifdef HAVE_POSIX_FALLOCATE if (posix_fallocate(q->fd, 0, (q->num_entries + 1) * q->entry_size) != 0) return -1; #endif } else { uint32_t file_entries; if (full_pread(q->fd, &fh, sizeof(fh), 0) != 0) return -1; if (memcmp(fh.magic, fh_magic, sizeof(fh.magic)) != 0 || fh.version != FH_VERSION_0 || fh.reserved != 0 || fh.entry_size != htonl(q->entry_size)) { errno = EINVAL; return -1; } file_entries = ntohl(fh.num_entries); if (file_entries > SIZE_MAX / q->entry_size - 1 || ((uintmax_t)st.st_size != (file_entries + 1) * q->entry_size)) { errno = EINVAL; return -1; } } /* Note that this may change q->num_entries! */ q->num_entries = ntohl(fh.num_entries); q->queue_head = ntohl(fh.s.queue_head); q->queue_length = ntohl(fh.s.queue_length); if (q->queue_head >= q->num_entries || q->queue_length > q->num_entries) { errno = EINVAL; return -1; } return 0; } /* Like q_open(), but does not handle Q_RESIZE, and NUM_ENTRIES is only used when creating a new file. */ static struct queue *q_open_no_resize(int q_flags, const char *path, size_t num_entries, size_t entry_size) { struct queue *q; int saved_errno; if ((q_flags & (Q_IN_MEMORY | Q_IN_FILE)) == 0) { errno = EINVAL; return NULL; } if (num_entries == 0 || num_entries > UINT32_MAX || entry_size < 1 /* for trailing NUL */ || entry_size < sizeof(struct file_header) /* for Q_IN_FILE */ /* to allocate "struct queue" including its buffer*/ || entry_size > UINT32_MAX - sizeof(struct queue)) { errno = EINVAL; return NULL; } if (entry_size > SIZE_MAX || num_entries > SIZE_MAX / entry_size - 1 /* for Q_IN_FILE */ || num_entries > SIZE_MAX / sizeof(*q->memory)) { errno = EINVAL; return NULL; } q = malloc(sizeof(*q) + entry_size); if (q == NULL) return NULL; q->flags = q_flags; q->fd = -1; q->memory = NULL; q->num_entries = num_entries; q->entry_size = entry_size; q->queue_head = 0; q->queue_length = 0; if ((q_flags & Q_IN_MEMORY) != 0) { size_t sz = num_entries * sizeof(*q->memory); q->memory = malloc(sz); if (q->memory == NULL) goto err; memset(q->memory, 0, sz); } if ((q_flags & Q_IN_FILE) != 0 && q_open_file(q, path) != 0) goto err; return q; err: saved_errno = errno; if (q->fd != -1) close(q->fd); free(q->memory); free(q); errno = saved_errno; return NULL; } void q_close(struct queue *q) { if (q->fd != -1) close(q->fd); /* Also releases the file lock */ if (q->memory != NULL) { size_t i; for (i = 0; i < q->num_entries; i++) free(q->memory[i]); free(q->memory); } free(q); } /* Internal use only: add DATA to Q, but don't update fh_state. */ static int q_append_no_sync_fh_state(struct queue *q, const char *data) { size_t data_size, entry_index; unsigned char *copy; if (q->queue_length == q->num_entries) { errno = ENOSPC; return -1; } data_size = strlen(data) + 1; if (data_size > q->entry_size) { errno = EINVAL; return -1; } entry_index = (q->queue_head + q->queue_length) % q->num_entries; if (q->memory != NULL) { if (q->memory[entry_index] != NULL) { errno = EIO; /* This is _really_ unexpected. */ return -1; } copy = malloc(data_size); if (copy == NULL) return -1; memcpy(copy, data, data_size); } else copy = NULL; if (q->fd != -1) { size_t offset; offset = entry_offset(q, entry_index); if (full_pwrite(q->fd, data, data_size, offset) != 0) { int saved_errno; saved_errno = errno; if (copy != NULL) free(copy); errno = saved_errno; return -1; } } if (copy != NULL) q->memory[entry_index] = copy; q->queue_length++; return 0; } int q_append(struct queue *q, const char *data) { int r; r = q_append_no_sync_fh_state(q, data); if (r != 0) return r; return sync_fh_state(q); /* Calls q_sync() */ } int q_peek(struct queue *q, char *buf, size_t size) { const unsigned char *data; size_t data_size; if (q->queue_length == 0) return 0; if (q->memory != NULL && q->memory[q->queue_head] != NULL) { data = q->memory[q->queue_head]; data_size = strlen((char *)data) + 1; } else if (q->fd != -1) { const unsigned char *end; if (full_pread(q->fd, q->buffer, q->entry_size, entry_offset(q, q->queue_head)) != 0) return -1; data = q->buffer; end = memchr(q->buffer, '\0', q->entry_size); if (end == NULL) { /* FIXME: silently drop this entry? */ errno = EBADMSG; return -1; } data_size = (end - data) + 1; if (q->memory != NULL) { unsigned char *copy; copy = malloc(data_size); if (copy != NULL) { /* Silently ignore failures. */ memcpy(copy, data, data_size); q->memory[q->queue_head] = copy; } } } else { errno = EIO; /* This is _really_ unexpected. */ return -1; } if (size < data_size) { errno = ERANGE; return -1; } memcpy(buf, data, data_size); return data_size; } /* Internal use only: drop head of Q, but don't write this into the file */ static int q_drop_head_memory_only(struct queue *q) { if (q->queue_length == 0) { errno = EINVAL; return -1; } if (q->memory != NULL) { free(q->memory[q->queue_head]); q->memory[q->queue_head] = NULL; } q->queue_head++; if (q->queue_head == q->num_entries) q->queue_head = 0; q->queue_length--; return 0; } int q_drop_head(struct queue *q) { int r; r = q_drop_head_memory_only(q); if (r != 0) return r; return sync_fh_state(q); /* Calls q_sync() */ } size_t q_queue_length(const struct queue *q) { return q->queue_length; } struct queue *q_open(int q_flags, const char *path, size_t num_entries, size_t entry_size) { struct queue *q, *q2; char *tmp_path, *buf; size_t path_len; int saved_errno, fd; q = q_open_no_resize(q_flags, path, num_entries, entry_size); if (q == NULL || q->num_entries == num_entries) return q; if ((q->flags & Q_RESIZE) == 0) { saved_errno = EINVAL; goto err_errno_q; } if (q->queue_length > num_entries) { saved_errno = ENOSPC; goto err_errno_q; } buf = malloc(entry_size); if (buf == NULL) { saved_errno = errno; goto err_errno_q; } path_len = strlen(path); tmp_path = malloc(path_len + 7); if (tmp_path == NULL) { saved_errno = errno; goto err_errno_buf; } memcpy(tmp_path, path, path_len); memcpy(tmp_path + path_len, "XXXXXX", 7); /* We really want tmpnam() here (safe due to the Q_EXCL below), but gcc warns on any use of tmpnam(). */ fd = mkstemp(tmp_path); if (fd == -1) { saved_errno = errno; goto err_errno_tmp_path; } if (close(fd) != 0 || unlink(tmp_path) != 0) { saved_errno = errno; goto err_errno_tmp_file; } q2 = q_open_no_resize(q_flags | Q_CREAT | Q_EXCL, tmp_path, num_entries, entry_size); if (q2 == NULL) { saved_errno = errno; goto err_errno_tmp_file; } if (q2->num_entries != num_entries) { errno = EIO; /* This is _really_ unexpected. */ goto err_q2; } for (;;) { int r; r = q_peek(q, buf, entry_size); if (r == 0) break; if (r < 0) goto err_q2; if (q_append_no_sync_fh_state(q2, buf) != 0) goto err_q2; if (q_drop_head_memory_only(q) != 0) goto err_q2; } if (sync_fh_state(q2) != 0) goto err_q2; if (rename(tmp_path, path) != 0) goto err_q2; q_close(q); free(buf); free(tmp_path); return q2; err_q2: saved_errno = errno; q_close(q2); err_errno_tmp_file: unlink(tmp_path); err_errno_tmp_path: free(tmp_path); err_errno_buf: free(buf); err_errno_q: q_close(q); errno = saved_errno; return NULL; } audit-4.0.2/audisp/plugins/remote/remote-config.h0000644001034500103450000000514414655201403015460 /* remote-config.h -- * Copyright 2008,2009,2011,2016,2018 Red Hat Inc., Durham, North Carolina. * All Rights Reserved. * * 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 * * Authors: * Steve Grubb * */ #ifndef REMOTE_CONFIG_H #define REMOTE_CONFIG_H typedef enum { M_IMMEDIATE, M_STORE_AND_FORWARD } rmode_t; typedef enum { T_TCP, T_TLS, T_KRB5, T_LABELED } transport_t; typedef enum { F_ASCII, F_MANAGED } format_t; typedef enum { FA_IGNORE, FA_SYSLOG, FA_WARN_ONCE_CONT, FA_WARN_ONCE, FA_EXEC, FA_RECONNECT, FA_SUSPEND, FA_SINGLE, FA_HALT, FA_STOP } failure_action_t; typedef enum { OA_IGNORE, OA_SYSLOG, OA_SUSPEND, OA_SINGLE, OA_HALT } overflow_action_t; typedef struct remote_conf { const char *remote_server; unsigned int port; unsigned int local_port; transport_t transport; rmode_t mode; const char *queue_file; unsigned int queue_depth; format_t format; unsigned int network_retry_time; unsigned int max_tries_per_record; unsigned int max_time_per_record; unsigned int heartbeat_timeout; const char *krb5_principal; const char *krb5_client_name; const char *krb5_key_file; failure_action_t network_failure_action; const char *network_failure_exe; failure_action_t disk_low_action; const char *disk_low_exe; failure_action_t disk_full_action; const char *disk_full_exe; failure_action_t disk_error_action; const char *disk_error_exe; failure_action_t remote_ending_action; const char *remote_ending_exe; failure_action_t generic_error_action; const char *generic_error_exe; failure_action_t generic_warning_action; const char *generic_warning_exe; failure_action_t queue_error_action; const char *queue_error_exe; overflow_action_t overflow_action; const char *startup_failure_exe; failure_action_t startup_failure_action; } remote_conf_t; void clear_config(remote_conf_t *config); int load_config(remote_conf_t *config, const char *file); void free_config(remote_conf_t *config); #endif audit-4.0.2/audisp/plugins/remote/Makefile.in0000644001034500103450000013713714655201422014627 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am -- # Copyright 2008-2009,2011,2015,2018 Red Hat Inc., Durham, North Carolina. # All Rights Reserved. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. If not, write to the # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor # Boston, MA 02110-1335, USA. # # Authors: # Steve Grubb # 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@ sbin_PROGRAMS = audisp-remote$(EXEEXT) check_PROGRAMS = test-queue$(EXEEXT) subdir = audisp/plugins/remote ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prog_cc_for_build.m4 \ $(top_srcdir)/m4/cap-ng.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/src/libev/libev.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man5dir)" \ "$(DESTDIR)$(man8dir)" PROGRAMS = $(sbin_PROGRAMS) am_audisp_remote_OBJECTS = audisp_remote-audisp-remote.$(OBJEXT) \ audisp_remote-remote-config.$(OBJEXT) \ audisp_remote-queue.$(OBJEXT) audisp_remote_OBJECTS = $(am_audisp_remote_OBJECTS) am__DEPENDENCIES_1 = AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = audisp_remote_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(audisp_remote_CFLAGS) \ $(CFLAGS) $(audisp_remote_LDFLAGS) $(LDFLAGS) -o $@ am_test_queue_OBJECTS = queue.$(OBJEXT) test-queue.$(OBJEXT) test_queue_OBJECTS = $(am_test_queue_OBJECTS) test_queue_LDADD = $(LDADD) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/audisp_remote-audisp-remote.Po \ ./$(DEPDIR)/audisp_remote-queue.Po \ ./$(DEPDIR)/audisp_remote-remote-config.Po \ ./$(DEPDIR)/queue.Po ./$(DEPDIR)/test-queue.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(audisp_remote_SOURCES) $(test_queue_SOURCES) DIST_SOURCES = $(audisp_remote_SOURCES) $(test_queue_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man5dir = $(mandir)/man5 man8dir = $(mandir)/man8 NROFF = nroff MANS = $(man_MANS) HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ $(top_srcdir)/test-driver DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILD_EXEEXT = @BUILD_EXEEXT@ BUILD_OBJEXT = @BUILD_OBJEXT@ CAPNG_LDADD = @CAPNG_LDADD@ CAPNG_PKG = @CAPNG_PKG@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_FOR_BUILD = @CC_FOR_BUILD@ CFLAGS = @CFLAGS@ CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ CPP_FOR_BUILD = @CPP_FOR_BUILD@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG = @DEBUG@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GOLANG = @GOLANG@ GOROOT = @GOROOT@ 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@ LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBWRAP_LIBS = @LIBWRAP_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PYTHON = @PYTHON@ PYTHON3_CFLAGS = @PYTHON3_CFLAGS@ PYTHON3_INCLUDES = @PYTHON3_INCLUDES@ PYTHON3_LIBS = @PYTHON3_LIBS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ VERSION = @VERSION@ WFLAGS = @WFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CC_FOR_BUILD = @ac_ct_CC_FOR_BUILD@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gss_libs = @gss_libs@ 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@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ use_python3 = @use_python3@ CONFIG_CLEAN_FILES = *.loT *.rej *.orig EXTRA_DIST = au-remote.conf audisp-remote.conf notes.txt $(man_MANS) AM_CPPFLAGS = -I${top_srcdir} -I${top_srcdir}/lib -I${top_srcdir}/common prog_confdir = $(sysconfdir)/audit prog_conf = audisp-remote.conf plugin_confdir = $(prog_confdir)/plugins.d plugin_conf = au-remote.conf noinst_HEADERS = remote-config.h queue.h man_MANS = audisp-remote.8 audisp-remote.conf.5 TESTS = $(check_PROGRAMS) audisp_remote_DEPENDENCIES = ${top_builddir}/common/libaucommon.la audisp_remote_SOURCES = audisp-remote.c remote-config.c queue.c audisp_remote_CFLAGS = -fPIE -DPIE -g -D_REENTRANT -D_GNU_SOURCE -Wundef ${WFLAGS} audisp_remote_LDFLAGS = -pie -Wl,-z,relro -Wl,-z,now audisp_remote_LDADD = $(CAPNG_LDADD) $(gss_libs) ${top_builddir}/common/libaucommon.la test_queue_SOURCES = queue.c test-queue.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu audisp/plugins/remote/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu audisp/plugins/remote/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-checkPROGRAMS: @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(sbindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ } \ ; done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(sbindir)" && rm -f $$files clean-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list audisp-remote$(EXEEXT): $(audisp_remote_OBJECTS) $(audisp_remote_DEPENDENCIES) $(EXTRA_audisp_remote_DEPENDENCIES) @rm -f audisp-remote$(EXEEXT) $(AM_V_CCLD)$(audisp_remote_LINK) $(audisp_remote_OBJECTS) $(audisp_remote_LDADD) $(LIBS) test-queue$(EXEEXT): $(test_queue_OBJECTS) $(test_queue_DEPENDENCIES) $(EXTRA_test_queue_DEPENDENCIES) @rm -f test-queue$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_queue_OBJECTS) $(test_queue_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audisp_remote-audisp-remote.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audisp_remote-queue.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audisp_remote-remote-config.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/queue.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-queue.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< audisp_remote-audisp-remote.o: audisp-remote.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_remote_CFLAGS) $(CFLAGS) -MT audisp_remote-audisp-remote.o -MD -MP -MF $(DEPDIR)/audisp_remote-audisp-remote.Tpo -c -o audisp_remote-audisp-remote.o `test -f 'audisp-remote.c' || echo '$(srcdir)/'`audisp-remote.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audisp_remote-audisp-remote.Tpo $(DEPDIR)/audisp_remote-audisp-remote.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='audisp-remote.c' object='audisp_remote-audisp-remote.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_remote_CFLAGS) $(CFLAGS) -c -o audisp_remote-audisp-remote.o `test -f 'audisp-remote.c' || echo '$(srcdir)/'`audisp-remote.c audisp_remote-audisp-remote.obj: audisp-remote.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_remote_CFLAGS) $(CFLAGS) -MT audisp_remote-audisp-remote.obj -MD -MP -MF $(DEPDIR)/audisp_remote-audisp-remote.Tpo -c -o audisp_remote-audisp-remote.obj `if test -f 'audisp-remote.c'; then $(CYGPATH_W) 'audisp-remote.c'; else $(CYGPATH_W) '$(srcdir)/audisp-remote.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audisp_remote-audisp-remote.Tpo $(DEPDIR)/audisp_remote-audisp-remote.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='audisp-remote.c' object='audisp_remote-audisp-remote.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_remote_CFLAGS) $(CFLAGS) -c -o audisp_remote-audisp-remote.obj `if test -f 'audisp-remote.c'; then $(CYGPATH_W) 'audisp-remote.c'; else $(CYGPATH_W) '$(srcdir)/audisp-remote.c'; fi` audisp_remote-remote-config.o: remote-config.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_remote_CFLAGS) $(CFLAGS) -MT audisp_remote-remote-config.o -MD -MP -MF $(DEPDIR)/audisp_remote-remote-config.Tpo -c -o audisp_remote-remote-config.o `test -f 'remote-config.c' || echo '$(srcdir)/'`remote-config.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audisp_remote-remote-config.Tpo $(DEPDIR)/audisp_remote-remote-config.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='remote-config.c' object='audisp_remote-remote-config.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_remote_CFLAGS) $(CFLAGS) -c -o audisp_remote-remote-config.o `test -f 'remote-config.c' || echo '$(srcdir)/'`remote-config.c audisp_remote-remote-config.obj: remote-config.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_remote_CFLAGS) $(CFLAGS) -MT audisp_remote-remote-config.obj -MD -MP -MF $(DEPDIR)/audisp_remote-remote-config.Tpo -c -o audisp_remote-remote-config.obj `if test -f 'remote-config.c'; then $(CYGPATH_W) 'remote-config.c'; else $(CYGPATH_W) '$(srcdir)/remote-config.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audisp_remote-remote-config.Tpo $(DEPDIR)/audisp_remote-remote-config.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='remote-config.c' object='audisp_remote-remote-config.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_remote_CFLAGS) $(CFLAGS) -c -o audisp_remote-remote-config.obj `if test -f 'remote-config.c'; then $(CYGPATH_W) 'remote-config.c'; else $(CYGPATH_W) '$(srcdir)/remote-config.c'; fi` audisp_remote-queue.o: queue.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_remote_CFLAGS) $(CFLAGS) -MT audisp_remote-queue.o -MD -MP -MF $(DEPDIR)/audisp_remote-queue.Tpo -c -o audisp_remote-queue.o `test -f 'queue.c' || echo '$(srcdir)/'`queue.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audisp_remote-queue.Tpo $(DEPDIR)/audisp_remote-queue.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='queue.c' object='audisp_remote-queue.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_remote_CFLAGS) $(CFLAGS) -c -o audisp_remote-queue.o `test -f 'queue.c' || echo '$(srcdir)/'`queue.c audisp_remote-queue.obj: queue.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_remote_CFLAGS) $(CFLAGS) -MT audisp_remote-queue.obj -MD -MP -MF $(DEPDIR)/audisp_remote-queue.Tpo -c -o audisp_remote-queue.obj `if test -f 'queue.c'; then $(CYGPATH_W) 'queue.c'; else $(CYGPATH_W) '$(srcdir)/queue.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audisp_remote-queue.Tpo $(DEPDIR)/audisp_remote-queue.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='queue.c' object='audisp_remote-queue.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audisp_remote_CFLAGS) $(CFLAGS) -c -o audisp_remote-queue.obj `if test -f 'queue.c'; then $(CYGPATH_W) 'queue.c'; else $(CYGPATH_W) '$(srcdir)/queue.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man5: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man5dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man5dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man5dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.5[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man5dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man5dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man5dir)" || exit $$?; }; \ done; } uninstall-man5: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man5dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.5[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man5dir)'; $(am__uninstall_files_from_dir) install-man8: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man8dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man8dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man8dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.8[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \ done; } uninstall-man8: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man8dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.8[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man8dir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ elif test -n "$$redo_logs"; then \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ if test -n "$(PACKAGE_BUGREPORT)"; then \ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: $(check_PROGRAMS) @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ trs_list=`for i in $$bases; do echo $$i.trs; done`; \ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all $(check_PROGRAMS) @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? test-queue.log: test-queue$(EXEEXT) @p='test-queue$(EXEEXT)'; \ b='test-queue'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile $(PROGRAMS) $(MANS) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ clean-sbinPROGRAMS mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/audisp_remote-audisp-remote.Po -rm -f ./$(DEPDIR)/audisp_remote-queue.Po -rm -f ./$(DEPDIR)/audisp_remote-remote-config.Po -rm -f ./$(DEPDIR)/queue.Po -rm -f ./$(DEPDIR)/test-queue.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-sbinPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man5 install-man8 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/audisp_remote-audisp-remote.Po -rm -f ./$(DEPDIR)/audisp_remote-queue.Po -rm -f ./$(DEPDIR)/audisp_remote-remote-config.Po -rm -f ./$(DEPDIR)/queue.Po -rm -f ./$(DEPDIR)/test-queue.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-man uninstall-sbinPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook uninstall-man: uninstall-man5 uninstall-man8 .MAKE: check-am install-am install-data-am install-strip uninstall-am .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ check-am clean clean-checkPROGRAMS clean-generic clean-libtool \ clean-sbinPROGRAMS cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-data-hook install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-man5 install-man8 \ install-pdf install-pdf-am install-ps install-ps-am \ install-sbinPROGRAMS install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ recheck tags tags-am uninstall uninstall-am uninstall-hook \ uninstall-man uninstall-man5 uninstall-man8 \ uninstall-sbinPROGRAMS .PRECIOUS: Makefile install-data-hook: mkdir -p -m 0750 ${DESTDIR}${plugin_confdir} $(INSTALL_DATA) -D -m 640 ${srcdir}/$(plugin_conf) ${DESTDIR}${plugin_confdir} $(INSTALL_DATA) -D -m 640 ${srcdir}/$(prog_conf) ${DESTDIR}${prog_confdir} uninstall-hook: rm ${DESTDIR}${plugin_confdir}/$(plugin_conf) rm ${DESTDIR}${prog_confdir}/$(prog_conf) # 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: audit-4.0.2/audisp/plugins/remote/au-remote.conf0000644001034500103450000000035514655201403015315 # This file controls the auditd data path to the # remote event logger. This plugin will send events to # a remote machine (Central Logger). active = no direction = out path = /sbin/audisp-remote type = always #args = format = string audit-4.0.2/audisp/plugins/remote/remote-config.c0000644001034500103450000004733514655201403015463 /* remote-config.c -- * Copyright 2008,2009,2011,2015-16,2018 Red Hat Inc., Durham, North Carolina. * All Rights Reserved. * * 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 * * Authors: * Steve Grubb * */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include "remote-config.h" /* Local prototypes */ struct nv_pair { const char *name; const char *value; const char *option; }; struct kw_pair { const char *name; int (*parser)(struct nv_pair *, int, remote_conf_t *); int max_options; }; struct nv_list { const char *name; int option; }; static char *get_line(FILE *f, char *buf); static int nv_split(char *buf, struct nv_pair *nv); static const struct kw_pair *kw_lookup(const char *val); static int server_parser(struct nv_pair *nv, int line, remote_conf_t *config); static int port_parser(struct nv_pair *nv, int line, remote_conf_t *config); static int local_port_parser(struct nv_pair *nv, int line, remote_conf_t *config); static int transport_parser(struct nv_pair *nv, int line, remote_conf_t *config); static int mode_parser(struct nv_pair *nv, int line, remote_conf_t *config); static int queue_file_parser(struct nv_pair *nv, int line, remote_conf_t *config); static int depth_parser(struct nv_pair *nv, int line, remote_conf_t *config); static int format_parser(struct nv_pair *nv, int line, remote_conf_t *config); static int heartbeat_timeout_parser(struct nv_pair *nv, int line, remote_conf_t *config); static int enable_krb5_parser(struct nv_pair *nv, int line, remote_conf_t *config); static int krb5_principal_parser(struct nv_pair *nv, int line, remote_conf_t *config); static int krb5_client_name_parser(struct nv_pair *nv, int line, remote_conf_t *config); static int krb5_key_file_parser(struct nv_pair *nv, int line, remote_conf_t *config); static int network_retry_time_parser(struct nv_pair *nv, int line, remote_conf_t *config); static int max_tries_per_record_parser(struct nv_pair *nv, int line, remote_conf_t *config); static int max_time_per_record_parser(struct nv_pair *nv, int line, remote_conf_t *config); #define AP(x) static int x##_action_parser(struct nv_pair *nv, int line, \ remote_conf_t *config); AP(network_failure) AP(disk_low) AP(disk_full) AP(disk_error) AP(generic_error) AP(generic_warning) AP(queue_error) AP(startup_failure) #undef AP static int remote_ending_action_parser(struct nv_pair *nv, int line, remote_conf_t *config); static int overflow_action_parser(struct nv_pair *nv, int line, remote_conf_t *config); static int sanity_check(remote_conf_t *config, const char *file); static const struct kw_pair keywords[] = { {"remote_server", server_parser, 0 }, {"port", port_parser, 0 }, {"local_port", local_port_parser, 0 }, {"transport", transport_parser, 0 }, {"mode", mode_parser, 0 }, {"queue_file", queue_file_parser, 0 }, {"queue_depth", depth_parser, 0 }, {"format", format_parser, 0 }, {"network_retry_time", network_retry_time_parser, 0 }, {"max_tries_per_record", max_tries_per_record_parser, 0 }, {"max_time_per_record", max_time_per_record_parser, 0 }, {"heartbeat_timeout", heartbeat_timeout_parser, 0 }, {"enable_krb5", enable_krb5_parser, 0 }, {"krb5_principal", krb5_principal_parser, 0 }, {"krb5_client_name", krb5_client_name_parser, 0 }, {"krb5_key_file", krb5_key_file_parser, 0 }, {"network_failure_action", network_failure_action_parser, 1 }, {"disk_low_action", disk_low_action_parser, 1 }, {"disk_full_action", disk_full_action_parser, 1 }, {"disk_error_action", disk_error_action_parser, 1 }, {"remote_ending_action", remote_ending_action_parser, 1 }, {"generic_error_action", generic_error_action_parser, 1 }, {"generic_warning_action", generic_warning_action_parser, 1 }, {"queue_error_action", queue_error_action_parser, 1 }, {"overflow_action", overflow_action_parser, 1 }, {"startup_failure_action", startup_failure_action_parser, 1 }, { NULL, NULL, 0 } }; static const struct nv_list transport_words[] = { {"tcp", T_TCP }, #ifdef USE_GSSAPI {"krb5", T_KRB5 }, #endif { NULL, 0 } }; static const struct nv_list mode_words[] = { {"immediate", M_IMMEDIATE }, {"forward", M_STORE_AND_FORWARD }, { NULL, 0 } }; static const struct nv_list fail_action_words[] = { {"ignore", FA_IGNORE }, {"syslog", FA_SYSLOG }, {"exec", FA_EXEC }, {"warn_once_continue", FA_WARN_ONCE_CONT }, {"warn_once", FA_WARN_ONCE }, {"suspend", FA_SUSPEND }, {"single", FA_SINGLE }, {"halt", FA_HALT }, {"stop", FA_STOP }, { NULL, 0 } }; static const struct nv_list overflow_action_words[] = { {"ignore", OA_IGNORE }, {"syslog", OA_SYSLOG }, {"suspend", OA_SUSPEND }, {"single", OA_SINGLE }, {"halt", OA_HALT }, { NULL, 0 } }; static const struct nv_list format_words[] = { {"ascii", F_ASCII }, {"managed", F_MANAGED }, { NULL, 0 } }; #ifdef USE_GSSAPI static const struct nv_list enable_krb5_values[] = { {"yes", 1 }, {"no", 0 }, { NULL, 0 } }; #endif /* * Set everything to its default value */ void clear_config(remote_conf_t *config) { config->remote_server = NULL; config->port = 60; config->local_port = 0; config->transport = T_TCP; config->mode = M_IMMEDIATE; config->queue_file = NULL; config->queue_depth = 2048; config->format = F_MANAGED; config->network_retry_time = 1; config->max_tries_per_record = 3; config->max_time_per_record = 5; config->heartbeat_timeout = 0; #define IA(x,f) config->x##_action = f; config->x##_exe = NULL IA(network_failure, FA_STOP); IA(disk_low, FA_IGNORE); IA(disk_full, FA_WARN_ONCE); IA(disk_error, FA_WARN_ONCE); IA(remote_ending, FA_RECONNECT); IA(generic_error, FA_SYSLOG); IA(generic_warning, FA_SYSLOG); IA(queue_error, FA_STOP); IA(startup_failure, FA_WARN_ONCE_CONT); #undef IA config->overflow_action = OA_SYSLOG; config->krb5_principal = NULL; config->krb5_client_name = NULL; config->krb5_key_file = NULL; } int load_config(remote_conf_t *config, const char *file) { int fd, rc, mode, lineno = 1; struct stat st; FILE *f; char buf[128]; clear_config(config); /* open the file */ mode = O_RDONLY; rc = open(file, mode); if (rc < 0) { if (errno != ENOENT) { syslog(LOG_ERR, "Error opening %s (%s)", file, strerror(errno)); return 1; } syslog(LOG_WARNING, "Config file %s doesn't exist, skipping", file); return 0; } fd = rc; /* check the file's permissions: owned by root, not world writable, * not symlink. */ if (fstat(fd, &st) < 0) { syslog(LOG_ERR, "Error fstat'ing config file (%s)", strerror(errno)); close(fd); return 1; } if (st.st_uid != 0) { syslog(LOG_ERR, "Error - %s isn't owned by root", file); close(fd); return 1; } if ((st.st_mode & S_IWOTH) == S_IWOTH) { syslog(LOG_ERR, "Error - %s is world writable", file); close(fd); return 1; } if (!S_ISREG(st.st_mode)) { syslog(LOG_ERR, "Error - %s is not a regular file", file); close(fd); return 1; } /* it's ok, read line by line */ f = fdopen(fd, "rm"); if (f == NULL) { syslog(LOG_ERR, "Error - fdopen failed (%s)", strerror(errno)); close(fd); return 1; } while (get_line(f, buf)) { // convert line into name-value pair const struct kw_pair *kw; struct nv_pair nv; rc = nv_split(buf, &nv); switch (rc) { case 0: // fine break; case 1: // not the right number of tokens. syslog(LOG_ERR, "Wrong number of arguments for line %d in %s", lineno, file); break; case 2: // no '=' sign syslog(LOG_ERR, "Missing equal sign for line %d in %s", lineno, file); break; default: // something else went wrong... syslog(LOG_ERR, "Unknown error for line %d in %s", lineno, file); break; } if (nv.name == NULL) { lineno++; continue; } if (nv.value == NULL) { fclose(f); return 1; } /* identify keyword or error */ kw = kw_lookup(nv.name); if (kw->name == NULL) { syslog(LOG_ERR, "Unknown keyword \"%s\" in line %d of %s", nv.name, lineno, file); fclose(f); return 1; } /* Check number of options */ if (kw->max_options == 0 && nv.option != NULL) { syslog(LOG_ERR, "Keyword \"%s\" has invalid option " "\"%s\" in line %d of %s", nv.name, nv.option, lineno, file); fclose(f); return 1; } /* dispatch to keyword's local parser */ rc = kw->parser(&nv, lineno, config); if (rc != 0) { fclose(f); return 1; // local parser puts message out } lineno++; } fclose(f); if (lineno > 1) return sanity_check(config, file); return 0; } static char *get_line(FILE *f, char *buf) { if (fgets_unlocked(buf, 128, f)) { /* remove newline */ char *ptr = strchr(buf, 0x0a); if (ptr) *ptr = 0; return buf; } return NULL; } static int nv_split(char *buf, struct nv_pair *nv) { /* Get the name part */ char *ptr, *saved; nv->name = NULL; nv->value = NULL; nv->option = NULL; ptr = strtok_r(buf, " ", &saved); if (ptr == NULL) return 0; /* If there's nothing, go to next line */ if (ptr[0] == '#') return 0; /* If there's a comment, go to next line */ nv->name = ptr; /* Check for a '=' */ ptr = strtok_r(NULL, " ", &saved); if (ptr == NULL) return 1; if (strcmp(ptr, "=") != 0) return 2; /* get the value */ ptr = strtok_r(NULL, " ", &saved); if (ptr == NULL) return 1; nv->value = ptr; /* See if there's an option */ ptr = strtok_r(NULL, " ", &saved); if (ptr) { nv->option = ptr; /* Make sure there's nothing else */ ptr = strtok_r(NULL, " ", &saved); if (ptr) return 1; } /* Everything is OK */ return 0; } static const struct kw_pair *kw_lookup(const char *val) { int i = 0; while (keywords[i].name != NULL) { if (strcasecmp(keywords[i].name, val) == 0) break; i++; } return &keywords[i]; } static int check_exe_name(const char *val, int line) { struct stat buf; if (val == NULL) { syslog(LOG_ERR, "Executable path needed for line %d", line); return -1; } if (*val != '/') { syslog(LOG_ERR, "Absolute path needed for %s - line %d", val, line); return -1; } if (stat(val, &buf) < 0) { syslog(LOG_ERR, "Unable to stat %s (%s) - line %d", val, strerror(errno), line); return -1; } if (!S_ISREG(buf.st_mode)) { syslog(LOG_ERR, "%s is not a regular file - line %d", val, line); return -1; } if (buf.st_uid != 0) { syslog(LOG_ERR, "%s is not owned by root - line %d", val, line); return -1; } if ((buf.st_mode & (S_IRWXU|S_IRWXG|S_IWOTH)) != (S_IRWXU|S_IRGRP|S_IXGRP)) { syslog(LOG_ERR, "%s permissions should be 0750 - line %d", val, line); return -1; } return 0; } static int server_parser(struct nv_pair *nv, int line, remote_conf_t *config) { if (nv->value) config->remote_server = strdup(nv->value); else config->remote_server = NULL; return 0; } static int parse_uint (const struct nv_pair *nv, int line, unsigned int *valp, unsigned int min, unsigned int max) { const char *ptr = nv->value; unsigned int i; /* check that all chars are numbers */ for (i=0; ptr[i]; i++) { if (!isdigit((unsigned char)ptr[i])) { syslog(LOG_ERR, "Value %s should only be numbers - line %d", nv->value, line); return 1; } } /* convert to unsigned int */ errno = 0; i = strtoul(nv->value, NULL, 10); if (errno) { syslog(LOG_ERR, "Error converting string to a number (%s) - line %d", strerror(errno), line); return 1; } /* Check its range */ if (min != 0 && i < (int)min) { syslog(LOG_ERR, "Error - converted number (%s) is too small - line %d", nv->value, line); return 1; } if (max != 0 && i > max) { syslog(LOG_ERR, "Error - converted number (%s) is too large - line %d", nv->value, line); return 1; } *valp = (unsigned int)i; return 0; } static int port_parser(struct nv_pair *nv, int line, remote_conf_t *config) { return parse_uint (nv, line, &(config->port), 0, 65535); } static int local_port_parser(struct nv_pair *nv, int line, remote_conf_t *config) { if ((strcasecmp(nv->value, "any") == 0)) return 0; // The default is 0, which means any port return parse_uint (nv, line, &(config->local_port), 0, 65535); } static int transport_parser(struct nv_pair *nv, int line, remote_conf_t *config) { int i; for (i=0; transport_words[i].name != NULL; i++) { if (strcasecmp(nv->value, transport_words[i].name) == 0) { config->transport = transport_words[i].option; return 0; } } syslog(LOG_ERR, "Option %s not found - line %d", nv->value, line); return 1; } static int mode_parser(struct nv_pair *nv, int line, remote_conf_t *config) { int i; for (i=0; mode_words[i].name != NULL; i++) { if (strcasecmp(nv->value, mode_words[i].name) == 0) { config->mode = mode_words[i].option; return 0; } } syslog(LOG_ERR, "Option %s not found - line %d", nv->value, line); return 1; } static int queue_file_parser(struct nv_pair *nv, int line, remote_conf_t *config) { if (nv->value) { if (*nv->value != '/') { syslog(LOG_ERR, "Absolute path needed for %s - line %d", nv->value, line); return 1; } config->queue_file = strdup(nv->value); } else config->queue_file = NULL; return 0; } static int depth_parser(struct nv_pair *nv, int line, remote_conf_t *config) { return parse_uint (nv, line, &(config->queue_depth), 1, INT_MAX); } static int action_parser(struct nv_pair *nv, int line, failure_action_t *actp, const char **exep) { int i; for (i=0; fail_action_words[i].name != NULL; i++) { if (strcasecmp(nv->value, fail_action_words[i].name) == 0) { if (fail_action_words[i].option == FA_EXEC) { if (check_exe_name(nv->option, line)) return 1; *exep = strdup(nv->option); } *actp = fail_action_words[i].option; return 0; } } syslog(LOG_ERR, "Option %s not found - line %d", nv->value, line); return 1; } #define AP(x) \ static int x##_action_parser(struct nv_pair *nv, int line, \ remote_conf_t *config) \ { \ return action_parser(nv,line,&(config->x##_action),&(config->x##_exe));\ } \ AP(network_failure) AP(disk_low) AP(disk_full) AP(disk_error) AP(generic_error) AP(generic_warning) AP(queue_error) AP(startup_failure) #undef AP static int overflow_action_parser(struct nv_pair *nv, int line, remote_conf_t *config) { int i; for (i=0; overflow_action_words[i].name != NULL; i++) { if (strcasecmp(nv->value, overflow_action_words[i].name) == 0) { config->overflow_action = overflow_action_words[i].option; return 0; } } syslog(LOG_ERR, "Option %s not found - line %d", nv->value, line); return 1; } static int remote_ending_action_parser(struct nv_pair *nv, int line, remote_conf_t *config) { if (strcasecmp(nv->value, "reconnect") == 0) { config->remote_ending_action = FA_RECONNECT; return 0; } return action_parser(nv, line, &config->remote_ending_action, &config->remote_ending_exe); } static int format_parser(struct nv_pair *nv, int line, remote_conf_t *config) { int i; for (i=0; format_words[i].name != NULL; i++) { if (strcasecmp(nv->value, format_words[i].name) == 0) { config->format = format_words[i].option; return 0; } } syslog(LOG_ERR, "Option %s not found - line %d", nv->value, line); return 1; } static int network_retry_time_parser(struct nv_pair *nv, int line, remote_conf_t *config) { return parse_uint(nv, line, &config->network_retry_time, 1, INT_MAX); } static int max_tries_per_record_parser(struct nv_pair *nv, int line, remote_conf_t *config) { return parse_uint(nv, line, &config->max_tries_per_record, 1, INT_MAX); } static int max_time_per_record_parser(struct nv_pair *nv, int line, remote_conf_t *config) { return parse_uint(nv, line, &(config->max_time_per_record), 1, INT_MAX); } static int heartbeat_timeout_parser(struct nv_pair *nv, int line, remote_conf_t *config) { return parse_uint (nv, line, &(config->heartbeat_timeout), 0, INT_MAX); } static int enable_krb5_parser(struct nv_pair *nv, int line, remote_conf_t *config) { #ifndef USE_GSSAPI syslog(LOG_INFO, "GSSAPI support is not enabled, ignoring value at line %d", line); return 0; #else unsigned long i; for (i=0; enable_krb5_values[i].name != NULL; i++) { if (strcasecmp(nv->value, enable_krb5_values[i].name) == 0) { if (enable_krb5_values[i].option == 1) config->transport = T_KRB5; return 0; } } syslog(LOG_ERR, "Option %s not found - line %d", nv->value, line); return 1; #endif } static int krb5_principal_parser(struct nv_pair *nv, int line, remote_conf_t *config) { #ifndef USE_GSSAPI syslog(LOG_INFO, "GSSAPI support is not enabled, ignoring value at line %d", line); #else if (config->krb5_principal) free ((char *)config->krb5_principal); config->krb5_principal = strdup(nv->value); #endif return 0; } static int krb5_client_name_parser(struct nv_pair *nv, int line, remote_conf_t *config) { #ifndef USE_GSSAPI syslog(LOG_INFO, "GSSAPI support is not enabled, ignoring value at line %d", line); #else if (config->krb5_client_name) free ((char *)config->krb5_client_name); config->krb5_client_name = strdup(nv->value); #endif return 0; } static int krb5_key_file_parser(struct nv_pair *nv, int line, remote_conf_t *config) { #ifndef USE_GSSAPI syslog(LOG_INFO, "GSSAPI support is not enabled, ignoring value at line %d", line); #else if (config->krb5_key_file) free ((char *)config->krb5_key_file); config->krb5_key_file = strdup(nv->value); #endif return 0; } /* * This function is where we do the integrated check of the config * options. At this point, all fields have been read. Returns 0 if no * problems and 1 if problems detected. */ static int sanity_check(remote_conf_t *config, const char *file) { /* Error checking */ // server should have string // port should be less that 32k // queue_depth should be less than 100k // If fail_action is F_EXEC, fail_exec must exist if (config->mode == M_STORE_AND_FORWARD && config->format != F_MANAGED) { syslog(LOG_ERR, "\"mode=forward\" is valid only with " "\"format=managed\""); return 1; } if (config->startup_failure_action > FA_EXEC) { syslog(LOG_ERR, "startup_failure_action has invalid option"); return 1; } return 0; } void free_config(remote_conf_t *config) { free((void *)config->remote_server); free((void *)config->queue_file); free((void *)config->network_failure_exe); free((void *)config->disk_low_exe); free((void *)config->disk_full_exe); free((void *)config->disk_error_exe); free((void *)config->remote_ending_exe); free((void *)config->generic_error_exe); free((void *)config->generic_warning_exe); free((void *)config->queue_error_exe); free((void *)config->startup_failure_exe); free((void *)config->krb5_principal); free((void *)config->krb5_client_name); free((void *)config->krb5_key_file); } audit-4.0.2/audisp/plugins/remote/Makefile.am0000644001034500103450000000412614655201403014604 # Makefile.am -- # Copyright 2008-2009,2011,2015,2018 Red Hat Inc., Durham, North Carolina. # All Rights Reserved. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. If not, write to the # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor # Boston, MA 02110-1335, USA. # # Authors: # Steve Grubb # CONFIG_CLEAN_FILES = *.loT *.rej *.orig EXTRA_DIST = au-remote.conf audisp-remote.conf notes.txt $(man_MANS) AM_CPPFLAGS = -I${top_srcdir} -I${top_srcdir}/lib -I${top_srcdir}/common prog_confdir = $(sysconfdir)/audit prog_conf = audisp-remote.conf plugin_confdir=$(prog_confdir)/plugins.d plugin_conf = au-remote.conf sbin_PROGRAMS = audisp-remote noinst_HEADERS = remote-config.h queue.h man_MANS = audisp-remote.8 audisp-remote.conf.5 check_PROGRAMS = test-queue TESTS = $(check_PROGRAMS) audisp_remote_DEPENDENCIES = ${top_builddir}/common/libaucommon.la audisp_remote_SOURCES = audisp-remote.c remote-config.c queue.c audisp_remote_CFLAGS = -fPIE -DPIE -g -D_REENTRANT -D_GNU_SOURCE -Wundef ${WFLAGS} audisp_remote_LDFLAGS = -pie -Wl,-z,relro -Wl,-z,now audisp_remote_LDADD = $(CAPNG_LDADD) $(gss_libs) ${top_builddir}/common/libaucommon.la test_queue_SOURCES = queue.c test-queue.c install-data-hook: mkdir -p -m 0750 ${DESTDIR}${plugin_confdir} $(INSTALL_DATA) -D -m 640 ${srcdir}/$(plugin_conf) ${DESTDIR}${plugin_confdir} $(INSTALL_DATA) -D -m 640 ${srcdir}/$(prog_conf) ${DESTDIR}${prog_confdir} uninstall-hook: rm ${DESTDIR}${plugin_confdir}/$(plugin_conf) rm ${DESTDIR}${prog_confdir}/$(prog_conf) audit-4.0.2/audisp/plugins/remote/test-queue.c0000644001034500103450000001767014655201403015025 /* test-queue.c -- test suite for persistent-queue.c * Copyright 2011,2018 Red Hat Inc., Durham, North Carolina. * All Rights Reserved. * * 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 * * Authors: * Miloslav Trmač */ #include "config.h" #include #include #include #include #include #include #include #include #include "queue.h" #define NUM_ENTRIES 7 /* 3*4096, larger than MAX_AUDIT_MESSAGE_LENGTH. The same value is used in the main audisp-remote code. */ #define ENTRY_SIZE 12288 static char filename[] = "/tmp/tqXXXXXX"; static struct queue *q; static char *sample_entries[NUM_ENTRIES - 1]; #define NUM_SAMPLE_ENTRIES (sizeof(sample_entries) / sizeof(*sample_entries)) #define die(...) die__(__LINE__, __VA_ARGS__) static void __attribute__((format (printf, 2, 3))) die__(int line, const char *message, ...) { va_list ap; fprintf(stderr, "test-queue: %d: ", line); va_start(ap, message); vfprintf(stderr, message, ap); va_end(ap); putc('\n', stderr); abort(); } #define err(...) err__(__LINE__, __VA_ARGS__) static void __attribute__((format (printf, 2, 3))) err__(int line, const char *message, ...) { char *errno_str; va_list ap; errno_str = strerror(errno); fprintf(stderr, "test-queue: %d: ", line); va_start(ap, message); vfprintf(stderr, message, ap); va_end(ap); fprintf(stderr, ": (%d) %s\n", errno, errno_str); abort(); } static void init_sample_entries(void) { size_t i; for (i = 0; i < NUM_SAMPLE_ENTRIES; i++) { char *e; size_t j, len; len = rand() % ENTRY_SIZE; e = malloc(len + 1); if (e == NULL) err("malloc"); for (j = 0; j < len; j++) e[j] = rand() % CHAR_MAX + 1; e[j] = '\0'; sample_entries[i] = e; } } static void free_sample_entries(void) { size_t i; for (i = 0; i < NUM_SAMPLE_ENTRIES; i++) free(sample_entries[i]); } static void test_q_open(void) { struct queue *q2; /* Test that flags are honored */ q2 = q_open(Q_IN_FILE | Q_CREAT | Q_EXCL, filename, NUM_ENTRIES, ENTRY_SIZE); if (q2 != NULL) die("q_open didn't fail"); if (errno != EEXIST) err("q_open"); /* Test that locking is enforced. Use a separate process because fcntl()/lockf() locking is attached to processes, not file descriptors. */ fflush(NULL); switch (fork()) { case -1: err("fork"); case 0: q2 = q_open(Q_IN_FILE, filename, NUM_ENTRIES, ENTRY_SIZE); if (q2 != NULL) die("q_open didn't fail"); if (errno != EBUSY) err("q_open"); _exit(0); default: { int status; if (wait(&status) == (pid_t)-1) err("wait"); if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) die("wait status %d", status); } } } static void test_empty_q (void) { char buf[ENTRY_SIZE]; if (q_peek(q, buf, sizeof(buf)) != 0) die("q_peek reports non-empty"); if (q_drop_head(q) != -1) die("q_drop_head didn't fail"); if (errno != EINVAL) err("q_drop_head"); if (q_queue_length(q) != 0) die("Unexpected q_queue_length"); } static void test_basic_data (void) { char buf[ENTRY_SIZE + 1]; int i; if (q_append(q, " ") != 0) die("q_append"); memset (buf, 'A', ENTRY_SIZE); buf[ENTRY_SIZE] = '\0'; if (q_append(q, buf) != -1) die("q_append didn't fail"); if (errno != EINVAL) err("q_append"); buf[ENTRY_SIZE - 1] = '\0'; if (q_append(q, buf) != 0) die("q_append"); if (q_queue_length(q) != 2) die("Unexpected q_queue_length"); if (q_peek(q, buf, sizeof(buf)) < 1) err("q_peek"); if (strcmp(buf, " ") != 0) die("invalid data returned"); if (q_drop_head(q) != 0) err("q_drop_head"); if (q_peek(q, buf, ENTRY_SIZE - 1) != -1) err("q_peek didn't fail"); if (errno != ERANGE) err("q_peek"); for (i = 0; i < 2; i++) { size_t j; if (q_peek(q, buf, sizeof(buf)) < 1) err("q_peek"); for (j = 0; j < ENTRY_SIZE - 1; j++) { if (buf[j] != 'A') die("invalid data at %zu", j); } if (buf[j] != '\0') die("invalid data at %zu", j); } if (q_drop_head(q) != 0) err("q_drop_head"); if (q_queue_length(q) != 0) die("Unexpected q_queue_length"); } static void append_sample_entries(size_t count) { size_t i; for (i = 0; i < count; i++) { if (q_append(q, sample_entries[i % NUM_SAMPLE_ENTRIES]) != 0) die("q_append %zu", i); } } static void verify_sample_entries(size_t count) { char buf[ENTRY_SIZE + 1]; size_t i; if (q_queue_length(q) != count) die("Unexpected q_queue_length"); for (i = 0; i < count; i++) { if (q_peek(q, buf, sizeof(buf)) < 1) err("q_peek %zu", i); if (strcmp(buf, sample_entries[i % NUM_SAMPLE_ENTRIES]) != 0) die("invalid data %zu", i); if (q_drop_head(q) != 0) err("q_drop_head"); } if (q_peek(q, buf, sizeof(buf)) != 0) die("q_peek reports non-empty"); } static void test_run(int flags) { size_t j; q = q_open(flags | Q_CREAT | Q_EXCL, filename, NUM_ENTRIES, ENTRY_SIZE); if (q == NULL) err("q_open"); if ((flags & Q_IN_FILE) != 0) test_q_open(); /* Do this enough times to get a wraparound */ for (j = 0; j < NUM_ENTRIES; j++) { test_empty_q(); test_basic_data(); } append_sample_entries(NUM_ENTRIES - 1); if (q_queue_length(q) != NUM_ENTRIES - 1) die("Unexpected q_queue_length"); q_close(q); q = q_open(flags, filename, NUM_ENTRIES, ENTRY_SIZE); if (q == NULL) err("q_open"); if ((flags & Q_IN_FILE) != 0) /* Test that the queue can be reopened and data has been preserved. */ verify_sample_entries(NUM_ENTRIES - 1); else /* Test that a new in-memory queue is empty. */ verify_sample_entries(0); q_close(q); if ((flags & Q_IN_FILE) != 0 && unlink(filename) != 0) err("unlink"); } static void test_resizing(void) { q = q_open(Q_IN_FILE | Q_CREAT | Q_EXCL, filename, NUM_ENTRIES, ENTRY_SIZE); if (q == NULL) err("q_open"); append_sample_entries(NUM_ENTRIES); if (q_queue_length(q) != NUM_ENTRIES) die("Unexpected q_queue_length"); q_close(q); /* Verify num_entries is validated */ q = q_open(Q_IN_FILE, filename, NUM_ENTRIES + 1, ENTRY_SIZE); if (q != NULL) die("q_open didn't fail"); if (errno != EINVAL) err("q_open"); q = q_open(Q_IN_FILE, filename, NUM_ENTRIES - 1, ENTRY_SIZE); if (q != NULL) die("q_open didn't fail"); if (errno != EINVAL) err("q_open"); /* Test increasing size */ q = q_open(Q_IN_FILE | Q_RESIZE, filename, 2 * NUM_ENTRIES, ENTRY_SIZE); if (q == NULL) err("q_open"); verify_sample_entries(NUM_ENTRIES); append_sample_entries(NUM_ENTRIES); q_close(q); /* Test decreasing size */ q = q_open(Q_IN_FILE | Q_RESIZE, filename, NUM_ENTRIES / 2, ENTRY_SIZE); if (q != NULL) die("q_open didn't fail"); if (errno != ENOSPC) err("q_open"); q = q_open(Q_IN_FILE | Q_RESIZE, filename, NUM_ENTRIES, ENTRY_SIZE); if (q == NULL) err("q_open"); verify_sample_entries(NUM_ENTRIES); q_close(q); if (unlink(filename) != 0) err("unlink"); } int main(void) { static const int flags[] = { Q_IN_MEMORY, Q_IN_FILE, Q_IN_FILE | Q_SYNC, Q_IN_MEMORY | Q_IN_FILE }; int fd; size_t i; init_sample_entries(); /* We really want tmpnam() here (safe due to the Q_EXCL below), but gcc warns on any use of tmpnam(). */ fd = mkstemp(filename); if (fd == -1) err("tmpnam"); if (close(fd) != 0) err("close"); if (unlink(filename) != 0) err("unlink"); for (i = 0; i < sizeof(flags) / sizeof(*flags); i++) test_run(flags[i]); test_resizing(); free_sample_entries(); return EXIT_SUCCESS; } audit-4.0.2/audisp/plugins/zos-remote/0000755001034500103450000000000014655201457013447 5audit-4.0.2/audisp/plugins/zos-remote/zos-remote-queue.c0000644001034500103450000001062014655201403016747 /*************************************************************************** * Copyright (C) 2007 International Business Machines Corp. * * All Rights Reserved. * * * * 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. * * * * Authors: * * Klaus Heinrich Kiwi * * based on code by Steve Grubb * ***************************************************************************/ #include "zos-remote-queue.h" #include #include #include #ifndef HAVE_PTHREAD_YIELD #include #endif #include "zos-remote-log.h" static volatile BerElement **q; static pthread_mutex_t queue_lock; static pthread_cond_t queue_nonempty; static unsigned int q_next, q_last, q_depth; int init_queue(unsigned int size) { unsigned int i; q_next = 0; q_last = 0; q_depth = size; q = malloc(q_depth * sizeof(BerElement *)); if (q == NULL) return -1; for (i=0; i 3) { log_err("queue is full - dropping event"); return; } pthread_mutex_lock(&queue_lock); /* OK, have lock add event */ n = q_next%q_depth; if (q[n] == NULL) { q[n] = ber; q_next = (n+1) % q_depth; pthread_cond_signal(&queue_nonempty); pthread_mutex_unlock(&queue_lock); } else { pthread_mutex_unlock(&queue_lock); #ifdef HAVE_PTHREAD_YIELD pthread_yield(); /* Let dequeue thread run to clear queue */ #else sched_yield(); #endif retry_cnt++; goto retry; } } BerElement *dequeue(void) { BerElement *ber; unsigned int n; /* Wait until its got something in it */ pthread_mutex_lock(&queue_lock); n = q_last%q_depth; if (q[n] == NULL) { pthread_cond_wait(&queue_nonempty, &queue_lock); n = q_last%q_depth; } /* OK, grab the next event */ if (q[n] != NULL) { ber = (BerElement *) q[n]; q[n] = NULL; q_last = (n+1) % q_depth; } else ber = NULL; pthread_mutex_unlock(&queue_lock); /* Process the event */ return ber; } void nudge_queue(void) { pthread_cond_signal(&queue_nonempty); } void increase_queue_depth(unsigned int size) { pthread_mutex_lock(&queue_lock); if (size > q_depth) { unsigned int i; void *tmp_q; tmp_q = realloc(q, size * sizeof(BerElement *)); if (tmp_q == NULL) { log_err("Out of memory. Check %s file, %d line", __FILE__, __LINE__); pthread_mutex_unlock(&queue_lock); return; } q = tmp_q; for (i=q_depth; i * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_LIBCAP_NG #include #endif #include "auparse.h" #include "zos-remote-log.h" #include "zos-remote-ldap.h" #include "zos-remote-config.h" #include "zos-remote-queue.h" #define UNUSED(x) (void)(x) /* * Global vars */ volatile int stop = 0; volatile int hup = 0; static ZOS_REMOTE zos_remote_inst; static plugin_conf_t conf; static const char *def_config_file = "/etc/audit/zos-remote.conf"; static pthread_t submission_thread; pid_t mypid = 0; /* * SIGTERM handler */ static void term_handler(int sig) { UNUSED(sig); log_info("Got Termination signal - shutting down plugin"); stop = 1; nudge_queue(); } /* * SIGHUP handler - re-read config, reconnect to ITDS */ static void hup_handler(int sig) { UNUSED(sig); log_info("Got Hangup signal - flushing plugin configuration"); hup = 1; nudge_queue(); } /* * SIGALRM handler - help force exit when terminating daemon */ static void alarm_handler(int sig) { UNUSED(sig); log_err("Timeout waiting for submission thread - Aborting (some events may have been dropped)"); pthread_cancel(submission_thread); } /* * The submission thread * It's job is to dequeue the events from the queue * and sync submit them to ITDS */ static void *submission_thread_main(void *arg) { int rc; UNUSED(arg); log_debug("Starting event submission thread"); rc = zos_remote_init(&zos_remote_inst, conf.server, conf.port, conf.user, conf.password, conf.timeout); if (rc != ICTX_SUCCESS) { log_err("Error - Failed to initialize session to z/OS ITDS Server"); stop = 1; return 0; } while (stop == 0) { /* block until we have an event */ BerElement *ber = dequeue(); if (ber == NULL) { if (hup) { break; } continue; } debug_ber(ber); rc = submit_request_s(&zos_remote_inst, ber); if (rc == ICTX_E_FATAL) { log_err("Error - Fatal error in event submission. Aborting"); stop = 1; } else if (rc != ICTX_SUCCESS) { log_warn("Warning - Event submission failure - event dropped"); } else { log_debug("Event submission success"); } ber_free(ber, 1); /* also free BER buffer */ } log_debug("Stopping event submission thread"); zos_remote_destroy(&zos_remote_inst); return 0; } /* * auparse library callback that's called when an event is ready */ void push_event(auparse_state_t * au, auparse_cb_event_t cb_event_type, void *user_data) { int rc; BerElement *ber; int qualifier; char timestamp[26]; char linkValue[ZOS_REMOTE_LINK_VALUE_SIZE]; char logString[ZOS_REMOTE_LOGSTRING_SIZE]; unsigned long linkValue_tmp; UNUSED(user_data); if (cb_event_type != AUPARSE_CB_EVENT_READY) return; const au_event_t *e = auparse_get_timestamp(au); if (e == NULL) return; /* * we have an event. Each record will result in a different 'Item' * (refer ASN.1 definition in zos-remote-ldap.h) */ /* * Create a new BER element to encode the request */ ber = ber_alloc_t(LBER_USE_DER); if (ber == NULL) { log_err("Error allocating memory for BER element"); goto fatal; } /* * Collect some information to fill in every item */ const char *node = auparse_get_node(au); const char *orig_type = auparse_find_field(au, "type"); /* roll back event to get 'success' */ auparse_first_record(au); const char *success = auparse_find_field(au, "success"); /* roll back event to get 'res' */ auparse_first_record(au); const char *res = auparse_find_field(au, "res"); /* check if this event is a success or failure one */ if (success) { if (strncmp(success, "0", 1) == 0 || strncmp(success, "no", 2) == 0) qualifier = ZOS_REMOTE_QUALIF_FAIL; else qualifier = ZOS_REMOTE_QUALIF_SUCCESS; } else if (res) { if (strncmp(res, "0", 1) == 0 || strncmp(res, "failed", 6) == 0) qualifier = ZOS_REMOTE_QUALIF_FAIL; else qualifier = ZOS_REMOTE_QUALIF_SUCCESS; } else qualifier = ZOS_REMOTE_QUALIF_INFO; /* get timestamp text */ ctime_r(&e->sec, timestamp); timestamp[24] = '\0'; /* strip \n' */ /* prepare linkValue which will be used for every item */ linkValue_tmp = htonl(e->serial); /* padronize to use network * byte order */ memset(&linkValue, 0, ZOS_REMOTE_LINK_VALUE_SIZE); memcpy(&linkValue, &linkValue_tmp, sizeof(unsigned long)); /* * Prepare the logString with some meaningful text * We assume the first record type found is the * 'originating' audit record */ sprintf(logString, "Linux (%s): type: %s", node, orig_type); free((void *)node); /* * Start writing to BER element. * There's only one field (version) out of the item sequence. * Also open item sequence */ rc = ber_printf(ber, "{i{", ICTX_REQUESTVER); if (rc < 0) goto skip_event; /* * Roll back to first record and iterate through all records */ auparse_first_record(au); do { const char *type = auparse_find_field(au, "type"); if (type == NULL) goto skip_event; log_debug("got record: %s", auparse_get_record_text(au)); /* * First field is item Version, same as global version */ rc = ber_printf(ber, "{i", ICTX_REQUESTVER); /* * Second field is the itemTag * use our internal event counter, increasing it */ rc |= ber_printf(ber, "i", conf.counter++); /* * Third field is the linkValue * using ber_put_ostring since it is not null-terminated */ rc |= ber_put_ostring(ber, linkValue, ZOS_REMOTE_LINK_VALUE_SIZE, LBER_OCTETSTRING); /* * Fourth field is the violation * Don't have anything better yet to put here */ rc |= ber_printf(ber, "b", 0); /* * Fifth field is the event. * FIXME: this might be the place to switch on the * audit record type and map to a more meaningful * SMF type 83, subtype 4 event here */ rc |= ber_printf(ber, "i", ZOS_REMOTE_EVENT_AUTHORIZATION); /* * Sixth field is the qualifier. We map 'success' or * 'res' to this field */ rc |= ber_printf(ber, "i", qualifier); /* * Seventh field is the Class * always use '@LINUX' for this version * max size ZOS_REMOTE_CLASS_SIZE */ rc |= ber_printf(ber, "t", ASN1_IA5STRING_TAG); rc |= ber_printf(ber, "s", "@LINUX"); /* * Eighth field is the resource * use the record type (name) as the resource * max size ZOS_REMOTE_RESOURCE_SIZE */ rc |= ber_printf(ber, "t", ASN1_IA5STRING_TAG); rc |= ber_printf(ber, "s", type); /* * Ninth field is the LogString * we try to put something meaningful here * we also start the relocations sequence */ rc |= ber_printf(ber, "t", ASN1_IA5STRING_TAG); rc |= ber_printf(ber, "s{", logString); /* * Now we start adding the relocations. * Let's add the timestamp as the first one * so it's out of the field loop */ rc |= ber_printf(ber, "{i", ZOS_REMOTE_RELOC_TIMESTAMP); rc |= ber_printf(ber, "t", ASN1_IA5STRING_TAG); rc |= ber_printf(ber, "s}", timestamp); /* * Check that encoding is going OK until now */ if (rc < 0) goto skip_event; /* * Now go to first field, * and iterate through all fields */ auparse_first_field(au); do { /* * we set a maximum of 1024 chars for * relocation data (field=value pairs) * Hopefully this wont overflow too often */ char data[1024]; const char *name = auparse_get_field_name(au); const char *value = auparse_interpret_field(au); if (name == NULL || value == NULL) goto skip_event; /* * First reloc field is the Relocation type * We use 'OTHER' here since we don't have * anything better */ rc |= ber_printf(ber, "{i", ZOS_REMOTE_RELOC_OTHER); /* * Second field is the relocation data * We use a 'name=value' pair here * Use up to 1023 chars (one char left for '\0') */ snprintf(data, 1023, "%s=%s", name, value); rc |= ber_printf(ber, "t", ASN1_IA5STRING_TAG); rc |= ber_printf(ber, "s}", data); /* * Check encoding status */ if (rc < 0) goto skip_event; } while (auparse_next_field(au) > 0); /* * After adding all relocations we are done with * this item - finalize relocs and item */ rc |= ber_printf(ber, "}}"); /* * Check if we are doing well with encoding */ if (rc < 0) goto skip_event; } while (auparse_next_record(au) > 0); /* * We have all items in - finalize item sequence & request */ rc |= ber_printf(ber, "}}"); /* * Check if everything went alright with encoding */ if (rc < 0) goto skip_event; /* * finally, enqueue request and let the other * thread process it */ log_debug("Encoding done, enqueuing event"); enqueue(ber); return; skip_event: log_warn("Warning - error encoding request, skipping event"); ber_free(ber, 1); /* free it since we're not enqueuing it */ return; fatal: log_err("Error - Fatal error while encoding request. Aborting"); stop = 1; } int main(int argc, char *argv[]) { int rc; const char *cpath; char buf[1024]; struct sigaction sa; sigset_t ss; auparse_state_t *au; ssize_t len; mypid = getpid(); log_info("starting with pid=%d", mypid); /* * install signal handlers */ sa.sa_flags = 0; sigemptyset(&sa.sa_mask); sa.sa_handler = term_handler; sigaction(SIGTERM, &sa, NULL); sa.sa_handler = hup_handler; sigaction(SIGHUP, &sa, NULL); sa.sa_handler = alarm_handler; sigaction(SIGALRM, &sa, NULL); /* * the main program accepts a single (optional) argument: * it's configuration file (this is NOT the plugin configuration * usually located at /etc/audit/plugins.d) * We use the default (def_config_file) if no arguments are given */ if (argc == 1) { cpath = def_config_file; log_warn("No configuration file specified - using default (%s)", cpath); } else if (argc == 2) { cpath = argv[1]; log_info("Using configuration file: %s", cpath); } else { log_err("Error - invalid number of parameters passed. Aborting"); return 1; } /* initialize record counter */ conf.counter = 1; /* initialize configuration with default values */ plugin_clear_config(&conf); /* initialize the submission queue */ if (init_queue(conf.q_depth) != 0) { log_err("Error - Can't initialize event queue. Aborting"); return -1; } #ifdef HAVE_LIBCAP_NG // Drop all capabilities capng_clear(CAPNG_SELECT_BOTH); if (capng_apply(CAPNG_SELECT_BOTH)) syslog(LOG_WARNING, "zos-remote plugin was unable to drop capabilities, continuing with elevated priviles"); #endif /* set stdin to O_NONBLOCK */ if (fcntl(0, F_SETFL, O_NONBLOCK) == -1) { log_err("Error - Can't set input to Non-blocking mode: %s. Aborting", strerror(errno)); return -1; } do { hup = 0; /* don't flush unless hup == 1 */ /* * initialization is done in 4 steps: */ /* * load configuration and * increase queue depth if needed */ rc = plugin_load_config(&conf, cpath); if (rc != 0) { log_err("Error - Can't load configuration. Aborting"); return -1; } increase_queue_depth(conf.q_depth); /* 1 */ /* initialize auparse */ au = auparse_init(AUSOURCE_FEED, 0); /* 2 */ if (au == NULL) { log_err("Error - exiting due to auparse init errors"); return -1; } /* * Block signals for everyone, * Initialize submission thread, and * Unblock signals for this thread */ sigfillset(&ss); pthread_sigmask(SIG_BLOCK, &ss, NULL); pthread_create(&submission_thread, NULL, submission_thread_main, NULL); pthread_sigmask(SIG_UNBLOCK, &ss, NULL); /* 3 */ /* add our event consumer callback */ auparse_add_callback(au, push_event, NULL, NULL); /* 4 */ /* main loop */ rc = 0; while (hup == 0 && stop == 0) { fd_set rfds; struct timeval tv; if (rc == 0 && auparse_feed_has_data(au)) auparse_feed_age_events(au); FD_ZERO(&rfds); FD_SET(0, &rfds); tv.tv_sec = 5; tv.tv_usec = 0; rc = select(1, &rfds, NULL, NULL, &tv); if (rc == -1) { if (errno == EINTR) { log_debug("Select call interrupted"); continue; } else { log_err("Error - Fatal error while monitoring input: %s. Aborting", strerror(errno)); stop = 1; } } else if (rc) { len = read(0, buf, 1024); if (len > 0) /* let our callback know of the new data */ auparse_feed(au, buf, len); else if (len == 0) { log_debug("End of input - Exiting"); stop = 1; } else { /* ignore interrupted call or empty pipe */ if (errno != EINTR && errno != EAGAIN) { log_err("Error - Fatal error while reading input: %s. Aborting", strerror(errno)); stop = 1; } else { log_debug("Ignoring read interruption: %s", strerror(errno)); } } } } /* flush everything, in order */ auparse_flush_feed(au); /* 4 */ alarm(10); /* 10 seconds to clear the queue */ pthread_join(submission_thread, NULL); /* 3 */ alarm(0); /* cancel any pending alarm */ auparse_destroy(au); /* 2 */ plugin_free_config(&conf); /* 1 */ } while (hup && stop == 0); /* destroy queue before leaving */ destroy_queue(); log_info("Exiting"); return 0; } audit-4.0.2/audisp/plugins/zos-remote/Makefile.in0000644001034500103450000010722214655201422015430 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am-- # Copyright (C) 2007,2008 International Business Machines Corp. # Copyright (C) 2011, 2015 Red Hat., Durham, North Carolina. # All Rights Reserved. # # 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; see the file COPYING. If not, write to the # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor # Boston, MA 02110-1335, USA. # # Authors: # Klaus Heinrich Kiwi # 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@ sbin_PROGRAMS = audispd-zos-remote$(EXEEXT) subdir = audisp/plugins/zos-remote ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prog_cc_for_build.m4 \ $(top_srcdir)/m4/cap-ng.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/src/libev/libev.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(sbindir)" PROGRAMS = $(sbin_PROGRAMS) am_audispd_zos_remote_OBJECTS = \ audispd_zos_remote-zos-remote-plugin.$(OBJEXT) \ audispd_zos_remote-zos-remote-log.$(OBJEXT) \ audispd_zos_remote-zos-remote-ldap.$(OBJEXT) \ audispd_zos_remote-zos-remote-config.$(OBJEXT) \ audispd_zos_remote-zos-remote-queue.$(OBJEXT) audispd_zos_remote_OBJECTS = $(am_audispd_zos_remote_OBJECTS) audispd_zos_remote_LDADD = $(LDADD) am__DEPENDENCIES_1 = audispd_zos_remote_DEPENDENCIES = $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = audispd_zos_remote_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(audispd_zos_remote_CFLAGS) $(CFLAGS) \ $(audispd_zos_remote_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = \ ./$(DEPDIR)/audispd_zos_remote-zos-remote-config.Po \ ./$(DEPDIR)/audispd_zos_remote-zos-remote-ldap.Po \ ./$(DEPDIR)/audispd_zos_remote-zos-remote-log.Po \ ./$(DEPDIR)/audispd_zos_remote-zos-remote-plugin.Po \ ./$(DEPDIR)/audispd_zos_remote-zos-remote-queue.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(audispd_zos_remote_SOURCES) DIST_SOURCES = $(audispd_zos_remote_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILD_EXEEXT = @BUILD_EXEEXT@ BUILD_OBJEXT = @BUILD_OBJEXT@ CAPNG_LDADD = @CAPNG_LDADD@ CAPNG_PKG = @CAPNG_PKG@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_FOR_BUILD = @CC_FOR_BUILD@ CFLAGS = @CFLAGS@ CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ CPP_FOR_BUILD = @CPP_FOR_BUILD@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG = @DEBUG@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GOLANG = @GOLANG@ GOROOT = @GOROOT@ 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@ LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ LIBOBJS = @LIBOBJS@ LIBS = ${top_builddir}/auparse/libauparse.la LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBWRAP_LIBS = @LIBWRAP_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PYTHON = @PYTHON@ PYTHON3_CFLAGS = @PYTHON3_CFLAGS@ PYTHON3_INCLUDES = @PYTHON3_INCLUDES@ PYTHON3_LIBS = @PYTHON3_LIBS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ VERSION = @VERSION@ WFLAGS = @WFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CC_FOR_BUILD = @ac_ct_CC_FOR_BUILD@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gss_libs = @gss_libs@ 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@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ use_python3 = @use_python3@ AM_CPPFLAGS = -I${top_srcdir} -I${top_srcdir}/lib -I${top_srcdir}/auparse CONFIG_CLEAN_FILES = *.rej *.orig EXTRA_DIST = zos-remote.conf audispd-zos-remote.conf LDADD = -lpthread -lldap -llber $(CAPNG_LDADD) plugin_confdir = $(sysconfdir)/audit plugin_conf = zos-remote.conf dispatcher_confdir = $(plugin_confdir)/plugins.d dispatcher_conf = audispd-zos-remote.conf noinst_HEADERS = zos-remote-log.h zos-remote-ldap.h zos-remote-config.h \ zos-remote-queue.h audispd_zos_remote_SOURCES = zos-remote-plugin.c zos-remote-log.c \ zos-remote-ldap.c zos-remote-config.c zos-remote-queue.c audispd_zos_remote_CFLAGS = -W -Wall -Wundef -D_GNU_SOURCE -fPIE -DPIE ${WFLAGS} audispd_zos_remote_LDFLAGS = -pie -Wl,-z,relro -Wl,-z,now all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu audisp/plugins/zos-remote/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu audisp/plugins/zos-remote/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(sbindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ } \ ; done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(sbindir)" && rm -f $$files clean-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list audispd-zos-remote$(EXEEXT): $(audispd_zos_remote_OBJECTS) $(audispd_zos_remote_DEPENDENCIES) $(EXTRA_audispd_zos_remote_DEPENDENCIES) @rm -f audispd-zos-remote$(EXEEXT) $(AM_V_CCLD)$(audispd_zos_remote_LINK) $(audispd_zos_remote_OBJECTS) $(audispd_zos_remote_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audispd_zos_remote-zos-remote-config.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audispd_zos_remote-zos-remote-ldap.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audispd_zos_remote-zos-remote-log.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audispd_zos_remote-zos-remote-plugin.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audispd_zos_remote-zos-remote-queue.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< audispd_zos_remote-zos-remote-plugin.o: zos-remote-plugin.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audispd_zos_remote_CFLAGS) $(CFLAGS) -MT audispd_zos_remote-zos-remote-plugin.o -MD -MP -MF $(DEPDIR)/audispd_zos_remote-zos-remote-plugin.Tpo -c -o audispd_zos_remote-zos-remote-plugin.o `test -f 'zos-remote-plugin.c' || echo '$(srcdir)/'`zos-remote-plugin.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audispd_zos_remote-zos-remote-plugin.Tpo $(DEPDIR)/audispd_zos_remote-zos-remote-plugin.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='zos-remote-plugin.c' object='audispd_zos_remote-zos-remote-plugin.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audispd_zos_remote_CFLAGS) $(CFLAGS) -c -o audispd_zos_remote-zos-remote-plugin.o `test -f 'zos-remote-plugin.c' || echo '$(srcdir)/'`zos-remote-plugin.c audispd_zos_remote-zos-remote-plugin.obj: zos-remote-plugin.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audispd_zos_remote_CFLAGS) $(CFLAGS) -MT audispd_zos_remote-zos-remote-plugin.obj -MD -MP -MF $(DEPDIR)/audispd_zos_remote-zos-remote-plugin.Tpo -c -o audispd_zos_remote-zos-remote-plugin.obj `if test -f 'zos-remote-plugin.c'; then $(CYGPATH_W) 'zos-remote-plugin.c'; else $(CYGPATH_W) '$(srcdir)/zos-remote-plugin.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audispd_zos_remote-zos-remote-plugin.Tpo $(DEPDIR)/audispd_zos_remote-zos-remote-plugin.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='zos-remote-plugin.c' object='audispd_zos_remote-zos-remote-plugin.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audispd_zos_remote_CFLAGS) $(CFLAGS) -c -o audispd_zos_remote-zos-remote-plugin.obj `if test -f 'zos-remote-plugin.c'; then $(CYGPATH_W) 'zos-remote-plugin.c'; else $(CYGPATH_W) '$(srcdir)/zos-remote-plugin.c'; fi` audispd_zos_remote-zos-remote-log.o: zos-remote-log.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audispd_zos_remote_CFLAGS) $(CFLAGS) -MT audispd_zos_remote-zos-remote-log.o -MD -MP -MF $(DEPDIR)/audispd_zos_remote-zos-remote-log.Tpo -c -o audispd_zos_remote-zos-remote-log.o `test -f 'zos-remote-log.c' || echo '$(srcdir)/'`zos-remote-log.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audispd_zos_remote-zos-remote-log.Tpo $(DEPDIR)/audispd_zos_remote-zos-remote-log.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='zos-remote-log.c' object='audispd_zos_remote-zos-remote-log.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audispd_zos_remote_CFLAGS) $(CFLAGS) -c -o audispd_zos_remote-zos-remote-log.o `test -f 'zos-remote-log.c' || echo '$(srcdir)/'`zos-remote-log.c audispd_zos_remote-zos-remote-log.obj: zos-remote-log.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audispd_zos_remote_CFLAGS) $(CFLAGS) -MT audispd_zos_remote-zos-remote-log.obj -MD -MP -MF $(DEPDIR)/audispd_zos_remote-zos-remote-log.Tpo -c -o audispd_zos_remote-zos-remote-log.obj `if test -f 'zos-remote-log.c'; then $(CYGPATH_W) 'zos-remote-log.c'; else $(CYGPATH_W) '$(srcdir)/zos-remote-log.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audispd_zos_remote-zos-remote-log.Tpo $(DEPDIR)/audispd_zos_remote-zos-remote-log.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='zos-remote-log.c' object='audispd_zos_remote-zos-remote-log.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audispd_zos_remote_CFLAGS) $(CFLAGS) -c -o audispd_zos_remote-zos-remote-log.obj `if test -f 'zos-remote-log.c'; then $(CYGPATH_W) 'zos-remote-log.c'; else $(CYGPATH_W) '$(srcdir)/zos-remote-log.c'; fi` audispd_zos_remote-zos-remote-ldap.o: zos-remote-ldap.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audispd_zos_remote_CFLAGS) $(CFLAGS) -MT audispd_zos_remote-zos-remote-ldap.o -MD -MP -MF $(DEPDIR)/audispd_zos_remote-zos-remote-ldap.Tpo -c -o audispd_zos_remote-zos-remote-ldap.o `test -f 'zos-remote-ldap.c' || echo '$(srcdir)/'`zos-remote-ldap.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audispd_zos_remote-zos-remote-ldap.Tpo $(DEPDIR)/audispd_zos_remote-zos-remote-ldap.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='zos-remote-ldap.c' object='audispd_zos_remote-zos-remote-ldap.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audispd_zos_remote_CFLAGS) $(CFLAGS) -c -o audispd_zos_remote-zos-remote-ldap.o `test -f 'zos-remote-ldap.c' || echo '$(srcdir)/'`zos-remote-ldap.c audispd_zos_remote-zos-remote-ldap.obj: zos-remote-ldap.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audispd_zos_remote_CFLAGS) $(CFLAGS) -MT audispd_zos_remote-zos-remote-ldap.obj -MD -MP -MF $(DEPDIR)/audispd_zos_remote-zos-remote-ldap.Tpo -c -o audispd_zos_remote-zos-remote-ldap.obj `if test -f 'zos-remote-ldap.c'; then $(CYGPATH_W) 'zos-remote-ldap.c'; else $(CYGPATH_W) '$(srcdir)/zos-remote-ldap.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audispd_zos_remote-zos-remote-ldap.Tpo $(DEPDIR)/audispd_zos_remote-zos-remote-ldap.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='zos-remote-ldap.c' object='audispd_zos_remote-zos-remote-ldap.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audispd_zos_remote_CFLAGS) $(CFLAGS) -c -o audispd_zos_remote-zos-remote-ldap.obj `if test -f 'zos-remote-ldap.c'; then $(CYGPATH_W) 'zos-remote-ldap.c'; else $(CYGPATH_W) '$(srcdir)/zos-remote-ldap.c'; fi` audispd_zos_remote-zos-remote-config.o: zos-remote-config.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audispd_zos_remote_CFLAGS) $(CFLAGS) -MT audispd_zos_remote-zos-remote-config.o -MD -MP -MF $(DEPDIR)/audispd_zos_remote-zos-remote-config.Tpo -c -o audispd_zos_remote-zos-remote-config.o `test -f 'zos-remote-config.c' || echo '$(srcdir)/'`zos-remote-config.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audispd_zos_remote-zos-remote-config.Tpo $(DEPDIR)/audispd_zos_remote-zos-remote-config.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='zos-remote-config.c' object='audispd_zos_remote-zos-remote-config.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audispd_zos_remote_CFLAGS) $(CFLAGS) -c -o audispd_zos_remote-zos-remote-config.o `test -f 'zos-remote-config.c' || echo '$(srcdir)/'`zos-remote-config.c audispd_zos_remote-zos-remote-config.obj: zos-remote-config.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audispd_zos_remote_CFLAGS) $(CFLAGS) -MT audispd_zos_remote-zos-remote-config.obj -MD -MP -MF $(DEPDIR)/audispd_zos_remote-zos-remote-config.Tpo -c -o audispd_zos_remote-zos-remote-config.obj `if test -f 'zos-remote-config.c'; then $(CYGPATH_W) 'zos-remote-config.c'; else $(CYGPATH_W) '$(srcdir)/zos-remote-config.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audispd_zos_remote-zos-remote-config.Tpo $(DEPDIR)/audispd_zos_remote-zos-remote-config.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='zos-remote-config.c' object='audispd_zos_remote-zos-remote-config.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audispd_zos_remote_CFLAGS) $(CFLAGS) -c -o audispd_zos_remote-zos-remote-config.obj `if test -f 'zos-remote-config.c'; then $(CYGPATH_W) 'zos-remote-config.c'; else $(CYGPATH_W) '$(srcdir)/zos-remote-config.c'; fi` audispd_zos_remote-zos-remote-queue.o: zos-remote-queue.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audispd_zos_remote_CFLAGS) $(CFLAGS) -MT audispd_zos_remote-zos-remote-queue.o -MD -MP -MF $(DEPDIR)/audispd_zos_remote-zos-remote-queue.Tpo -c -o audispd_zos_remote-zos-remote-queue.o `test -f 'zos-remote-queue.c' || echo '$(srcdir)/'`zos-remote-queue.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audispd_zos_remote-zos-remote-queue.Tpo $(DEPDIR)/audispd_zos_remote-zos-remote-queue.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='zos-remote-queue.c' object='audispd_zos_remote-zos-remote-queue.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audispd_zos_remote_CFLAGS) $(CFLAGS) -c -o audispd_zos_remote-zos-remote-queue.o `test -f 'zos-remote-queue.c' || echo '$(srcdir)/'`zos-remote-queue.c audispd_zos_remote-zos-remote-queue.obj: zos-remote-queue.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audispd_zos_remote_CFLAGS) $(CFLAGS) -MT audispd_zos_remote-zos-remote-queue.obj -MD -MP -MF $(DEPDIR)/audispd_zos_remote-zos-remote-queue.Tpo -c -o audispd_zos_remote-zos-remote-queue.obj `if test -f 'zos-remote-queue.c'; then $(CYGPATH_W) 'zos-remote-queue.c'; else $(CYGPATH_W) '$(srcdir)/zos-remote-queue.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audispd_zos_remote-zos-remote-queue.Tpo $(DEPDIR)/audispd_zos_remote-zos-remote-queue.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='zos-remote-queue.c' object='audispd_zos_remote-zos-remote-queue.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(audispd_zos_remote_CFLAGS) $(CFLAGS) -c -o audispd_zos_remote-zos-remote-queue.obj `if test -f 'zos-remote-queue.c'; then $(CYGPATH_W) 'zos-remote-queue.c'; else $(CYGPATH_W) '$(srcdir)/zos-remote-queue.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(sbindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-sbinPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/audispd_zos_remote-zos-remote-config.Po -rm -f ./$(DEPDIR)/audispd_zos_remote-zos-remote-ldap.Po -rm -f ./$(DEPDIR)/audispd_zos_remote-zos-remote-log.Po -rm -f ./$(DEPDIR)/audispd_zos_remote-zos-remote-plugin.Po -rm -f ./$(DEPDIR)/audispd_zos_remote-zos-remote-queue.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-sbinPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/audispd_zos_remote-zos-remote-config.Po -rm -f ./$(DEPDIR)/audispd_zos_remote-zos-remote-ldap.Po -rm -f ./$(DEPDIR)/audispd_zos_remote-zos-remote-log.Po -rm -f ./$(DEPDIR)/audispd_zos_remote-zos-remote-plugin.Po -rm -f ./$(DEPDIR)/audispd_zos_remote-zos-remote-queue.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-sbinPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook .MAKE: install-am install-data-am install-strip uninstall-am .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-sbinPROGRAMS cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-data-hook install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-sbinPROGRAMS \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-hook uninstall-sbinPROGRAMS .PRECIOUS: Makefile install-data-hook: mkdir -p -m 0750 ${DESTDIR}${plugin_confdir} $(INSTALL_DATA) -D -m 640 ${srcdir}/$(plugin_conf) \ ${DESTDIR}${plugin_confdir} $(INSTALL_DATA) -D -m 640 ${srcdir}/$(dispatcher_conf) \ ${DESTDIR}${dispatcher_confdir} uninstall-hook: rm ${DESTDIR}${plugin_confdir}/$(plugin_conf) rm ${DESTDIR}${dispatcher_confdir}/$(dispatcher_conf) # 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: audit-4.0.2/audisp/plugins/zos-remote/zos-remote-ldap.c0000644001034500103450000005734014655201403016555 /*************************************************************************** * Copyright (C) 2007 International Business Machines Corp. * * All Rights Reserved. * * * * 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. * * * * Authors: * * Klaus Heinrich Kiwi * ***************************************************************************/ #include "zos-remote-ldap.h" #include #include #include #include #include "zos-remote-log.h" /*************************************************************************** * Audit response struct * ***************************************************************************/ typedef struct audit_resp_item { ber_int_t version; /* Version of Response data itself */ ber_int_t itemTag; /* Copy of itemTag from Operation */ ber_int_t majorCode; /* Majorcode. Main return code of this Outcome */ ber_int_t minorCode1; /* minorCode1. SAFRc or other Rc */ ber_int_t minorCode2; /* minorCode2. RacfRc or other Rc */ ber_int_t minorCode3; /* minorCode3. RacfRsn or other Rc */ } audit_resp_item_t; typedef struct audit_response { ber_int_t respVersion; /* Overall version */ ber_int_t respMajor; /* Overall major code */ unsigned int numItems; /* Number of response items */ audit_resp_item_t **itemList; /* response ItemList */ } audit_response_t; /*************************************************************************** * z/OS Remote-services Major return code handling * ***************************************************************************/ struct zos_remote_error { int code; char *str; }; static struct zos_remote_error zos_remote_errlist[] = { {ZOS_REMOTE_MAJOR_SUCCESS, "Success"}, {ZOS_REMOTE_MAJOR_WARNINGMODE, "WARNINGMODE - Event was logged, with warnings"}, {ZOS_REMOTE_MAJOR_NOTREQ, "NOTREQ - No logging required"}, {ZOS_REMOTE_MAJOR_UNDETERMINED, "UNDETERMINED - Undetermined result"}, {ZOS_REMOTE_MAJOR_UNAUTHORIZED, "UNAUTHORIZED - The user does not have authority the R_auditx service"}, {ZOS_REMOTE_MAJOR_RACROUTE, "RACROUTE - The R_auditx service returned an unexpected error"}, {ZOS_REMOTE_MAJOR_VAL_ERR, "VAL_ERR - Value error in request"}, {ZOS_REMOTE_MAJOR_ENC_ERR, "ENC_ERR - DER decoding error in request"}, {ZOS_REMOTE_MAJOR_UNSUF_AUTH, "UNSUF_AUTH - The user has insufficient authority for the requested function"}, {ZOS_REMOTE_MAJOR_EMPTY, "EMPTY - Empty request received - No items found within the ItemList"}, {ZOS_REMOTE_MAJOR_INVALID_VER, "INVALID_VER - Invalid RequestVersion"}, {ZOS_REMOTE_MAJOR_INTERNAL_ERR, "INTERNAL_ERR - An internal error was encountered within the ICTX component"}, {-1, NULL} }; /*************************************************************************** * Internal functions prototypes * ***************************************************************************/ static int _zos_remote_init(ZOS_REMOTE *); static void _zos_remote_destroy(ZOS_REMOTE *); static int zos_remote_connect(ZOS_REMOTE *); static void zos_remote_disconnect(ZOS_REMOTE *); static int submit_xop_s(ZOS_REMOTE *, struct berval *); static int decode_response(audit_response_t *, struct berval *); /*************************************************************************** * Exported functions * ***************************************************************************/ int submit_request_s(ZOS_REMOTE *zos_remote, BerElement *ber) { int rc, retry = 1; /* retry once and give up */ struct berval bv; rc = ber_flatten2(ber, &bv, 0); /* 0 = Use ber's buffer */ if (rc == -1) { log_err("Error flattening BER element"); return ICTX_E_ABORT; } retry: rc = submit_xop_s(zos_remote, &bv); switch (rc) { case ICTX_SUCCESS: break; case ICTX_E_TRYAGAIN: /* * Usually means that the server connection timed-out * So we flush the LDAP connection by unsetting the * 'connected' flag and trying again. */ if (retry > 0) { log_debug("Connection seems down - retrying"); retry--; _zos_remote_destroy(zos_remote); rc = _zos_remote_init(zos_remote); if (rc != ICTX_SUCCESS) log_err("Error - failed to re-initialize LDAP session"); else goto retry; /* go to submit_xop_s once more */ } log_err("Can't establish connection"); break; case ICTX_E_ABORT: break; default: log_err("Event resulted failure, code: 0x%x", rc); } return rc; } int zos_remote_init(ZOS_REMOTE *zos_remote, const char *server, int port, const char *user, const char *password, int timeout) { if (server == NULL || user == NULL || password == NULL) { log_err("Error: required parameters are not present in config file"); return ICTX_E_FATAL; } zos_remote->server = strdup(server); zos_remote->port = port; zos_remote->user = strdup(user); zos_remote->password = strdup(password); zos_remote->timeout = timeout; zos_remote->connected = 0; if (!zos_remote->server || !zos_remote->user || !zos_remote->password) { log_err("Error allocating memory for session members"); return ICTX_E_FATAL; } return _zos_remote_init(zos_remote); } void zos_remote_destroy(ZOS_REMOTE *zos_remote) { _zos_remote_destroy(zos_remote); free(zos_remote->server); free(zos_remote->user); free(zos_remote->password); } char *zos_remote_err2string(int err) { int i; for (i = 0; zos_remote_errlist[i].str != NULL; i++) { if (err == zos_remote_errlist[i].code) return zos_remote_errlist[i].str; } return "Unknown error"; } /*************************************************************************** * Internal Functions * ***************************************************************************/ static int _zos_remote_init(ZOS_REMOTE *zos_remote) { int version, rc; char *uri = NULL; #ifdef LDAP_DEPRECATED log_debug("Initializing z/OS Remote-services LDAP connection at ldap://%s:%d", zos_remote->server, zos_remote->port); zos_remote->ld = ldap_init(zos_remote->server zos_remote->port ? zos_remote->port : LDAP_PORT); if (zos_remote->ld == NULL) { log_err("Error initializing LDAP session: %s", strerror(errno)); rc = ICTX_E_FATAL; goto end; } #else /* build ldap URI */ if (zos_remote->port == 0 || zos_remote->port == LDAP_PORT) rc = asprintf(&uri, "ldap://%s", zos_remote->server); else rc = asprintf(&uri, "ldap://%s:%u", zos_remote->server, zos_remote->port); if (rc == -1) { log_err("Out of memory building LDAP server URI"); rc = ICTX_E_FATAL; uri = NULL; goto end; } log_debug("Initializing z/OS Remote-services LDAP connection at %s", uri); /* Get a handle to an LDAP connection */ rc = ldap_initialize(&zos_remote->ld, uri); if (rc != LDAP_SUCCESS) { log_err("Error initializing LDAP session: %s", ldap_err2string(rc)); rc = ICTX_E_FATAL; goto free_uri; } #endif /* * Ensure the LDAP protocol version supported by the client * to 3. (Extended operations are part of version 3). */ rc = ldap_get_option(zos_remote->ld, LDAP_OPT_PROTOCOL_VERSION, &version); if (rc != LDAP_OPT_SUCCESS) { log_err("Error getting LDAP session options"); rc = ICTX_E_FATAL; goto unbind; } if (version < LDAP_VERSION3) { log_debug("Setting LDAP session version to %d", LDAP_VERSION3); version = LDAP_VERSION3; rc = ldap_set_option(zos_remote->ld, LDAP_OPT_PROTOCOL_VERSION, &version); if (rc != LDAP_OPT_SUCCESS) { log_err("Error setting LDAP session version"); rc = ICTX_E_FATAL; goto unbind; } } goto free_uri; unbind: ldap_unbind_ext_s(zos_remote->ld, NULL, NULL); zos_remote->ld = NULL; free_uri: free(uri); end: return rc; } static void _zos_remote_destroy(ZOS_REMOTE *zos_remote) { zos_remote_disconnect(zos_remote); zos_remote->ld = NULL; } static int zos_remote_connect(ZOS_REMOTE *zos_remote) { struct berval cred; int rc; char bindusr[255]; snprintf(bindusr, 255, "racfid=%s,cn=ictx", zos_remote->user); log_debug("Attempting BIND. User '%s', password ''", bindusr); cred.bv_val = (char *) zos_remote->password; cred.bv_len = strlen(zos_remote->password); rc = ldap_sasl_bind_s(zos_remote->ld, bindusr, LDAP_SASL_SIMPLE, &cred, NULL, NULL, NULL); switch (rc) { case LDAP_SUCCESS: log_debug("LDAP BIND succeeded"); zos_remote->connected = 1; rc = ICTX_SUCCESS; break; case LDAP_SERVER_DOWN: case LDAP_BUSY: case LDAP_UNAVAILABLE: case LDAP_TIMEOUT: case LDAP_CONNECT_ERROR: log_warn("z/OS Remote-services connection failed: %s", ldap_err2string(rc)); rc = ICTX_E_TRYAGAIN; break; default: log_err("Error - z/OS Remote-services initialization failed: %s", ldap_err2string(rc)); rc = ICTX_E_FATAL; } return rc; } static void zos_remote_disconnect(ZOS_REMOTE *zos_remote) { if (zos_remote->ld) { log_debug("Unbinding LDAP session"); #ifdef LDAP_DEPRECATED ldap_unbind(zos_remote->ld); #else ldap_unbind_ext_s(zos_remote->ld, NULL, NULL); #endif } zos_remote->connected = 0; } /* * Sync-submit extended operation given in *bv * return ICTX_SUCCESS if submission (and response) * succeeded. * Log errors using log_err() functions */ int submit_xop_s(ZOS_REMOTE *zos_remote, struct berval *bv) { LDAPMessage *result; audit_response_t response; int rc, errcode, msgId; unsigned int i; char *errmsg, *oid; struct berval *bv_response; struct timeval t; if (zos_remote->connected == 0) { rc = zos_remote_connect(zos_remote); if (rc != ICTX_SUCCESS) return rc; } /* call LDAP - won't block */ rc = ldap_extended_operation(zos_remote->ld, ICTX_OIDAUDITREQUEST, bv, NULL, NULL, &msgId); if (rc == LDAP_SERVER_DOWN) { zos_remote->connected = 0; return ICTX_E_TRYAGAIN; } else if (rc != LDAP_SUCCESS) { log_err("LDAP extended operation submission failure: %s", ldap_err2string(rc)); return ICTX_E_ABORT; } else { log_debug("Sent LDAP extended operation request, msgId=0x%x", msgId); } /* call blocking ldap_result with specified timeout */ t.tv_sec = zos_remote->timeout; t.tv_usec = 0; rc = ldap_result(zos_remote->ld, msgId, 1, &t, &result); if (rc == -1) { /* error in ldap operation */ ldap_get_option(zos_remote->ld, LDAP_OPT_ERROR_NUMBER, &errcode); switch (errcode) { case LDAP_SERVER_DOWN: /* Connection may have timed out, let's retry */ zos_remote->connected = 0; rc = ICTX_E_TRYAGAIN; break; default: log_err("ldap_result unexpected failure: %s (0x%x)", ldap_err2string(rc), rc); rc = ICTX_E_ABORT; } goto end; } else if (rc == 0) { /* timeout reached */ log_warn("LDAP extended operation timed out"); rc = ICTX_E_ABORT; goto end; } else if (rc != LDAP_RES_EXTENDED) { /* not an extended operation response! */ log_err("LDAP extended operation resulted in unexpected answer: 0x%x", rc); rc = ICTX_E_ABORT; goto free_result; } log_debug("Got LDAP Extended result"); /* * we have an extended operation result * first parse_result will check for errcode, later * parse_extended_result will give us the oid and the BER value */ rc = ldap_parse_result(zos_remote->ld, result, &errcode, NULL, &errmsg, NULL, NULL, 0); if (rc != LDAP_SUCCESS) { log_err("LDAP parse result internal failure (code 0x%x)", rc); rc = ICTX_E_ABORT; goto free_result; } if (errcode != LDAP_SUCCESS) { log_err("LDAP extended operation failed: %s", errmsg); rc = ICTX_E_ABORT; goto free_errmsg; } rc = ldap_parse_extended_result(zos_remote->ld, result, &oid, &bv_response, 0); if (rc != LDAP_SUCCESS) { log_err("Failed to parse ldap extended result (code 0x%x)", rc); rc = ICTX_E_ABORT; goto free_errmsg; } if (oid && strcmp(oid, ICTX_OIDAUDITRESPONSE) != 0) { /* oid == null shouldn't be a problem to log_err */ log_err("LDAP extended operation returned an invalid oid: %s", oid); rc = ICTX_E_ABORT; goto free_bv; } rc = decode_response(&response, bv_response); if (rc != ICTX_SUCCESS) { log_err("Error decoding extended operation response"); goto free_bv; } if (response.respMajor == ZOS_REMOTE_MAJOR_SUCCESS) { /* submission was successful, no further processing needed */ log_debug("Successfully submitted Remote audit Request"); rc = ICTX_SUCCESS; goto free_response; } else if (response.respMajor == ZOS_REMOTE_MAJOR_EMPTY) { /* something is going on. Set error and stop processing */ log_warn("Warning - LDAP extended operation returned empty result"); rc = ICTX_E_ABORT; goto free_response; } else if (response.respMajor == ZOS_REMOTE_MAJOR_WARNINGMODE || response.respMajor == ZOS_REMOTE_MAJOR_NOTREQ) rc = ICTX_SUCCESS; /* don't fail, but continue processing */ else rc = ICTX_E_ABORT; /* set return code and continue processing */ /* If it's not success nor empty, let's check for errors in the response */ for (i = 0; i < response.numItems; i++) { switch ((response.itemList[i])->majorCode) { /* 0 <= Major Code <= 14 */ case ZOS_REMOTE_MAJOR_SUCCESS: break; case ZOS_REMOTE_MAJOR_WARNINGMODE: case ZOS_REMOTE_MAJOR_NOTREQ: log_debug("Warning - LDAP extended operation returned '%s' for item %d", zos_remote_err2string((response.itemList[i])->majorCode), (response.itemList[i])->itemTag); log_debug("SAF code: 0x%x, RACF code: 0x%x, RACF reason: 0x%x", (response.itemList[i])->minorCode1, (response.itemList[i])->minorCode2, (response.itemList[i])->minorCode3); break; case ZOS_REMOTE_MAJOR_UNDETERMINED: case ZOS_REMOTE_MAJOR_UNAUTHORIZED: case ZOS_REMOTE_MAJOR_RACROUTE: log_err("Error - LDAP extended operation returned '%s' for item %d", zos_remote_err2string((response.itemList[i])->majorCode), (response.itemList[i])->itemTag); log_err("SAF code: 0x%x, RACF code: 0x%x, RACF reason: 0x%x", (response.itemList[i])->minorCode1, (response.itemList[i])->minorCode2, (response.itemList[i])->minorCode3); break; /* 16 <= Major Code <= 20 */ case ZOS_REMOTE_MAJOR_VAL_ERR: case ZOS_REMOTE_MAJOR_ENC_ERR: log_err("Error - LDAP extended operation returned '%s' for item %d", zos_remote_err2string((response.itemList[i])->majorCode), (response.itemList[i])->itemTag); log_err("Item field: %d, reason %d", (response.itemList[i])-> minorCode1, (response.itemList[i])->minorCode2); break; /* 24 <= Major code <= 100 */ case ZOS_REMOTE_MAJOR_UNSUF_AUTH: case ZOS_REMOTE_MAJOR_EMPTY: case ZOS_REMOTE_MAJOR_INVALID_VER: case ZOS_REMOTE_MAJOR_INTERNAL_ERR: log_err("Error - LDAP extended operation returned '%s' for item %d", zos_remote_err2string((response.itemList[i])->majorCode), (response.itemList[i])->itemTag); break; default: log_err("Error - LDAP extended operation returned an unknown Major code for item %d", (response.itemList[i])->majorCode); } } free_response: for (; response.numItems > 0; response.numItems--) free(response.itemList[response.numItems - 1]); free(response.itemList); free_bv: if (bv_response) ber_bvfree(bv_response); if (oid) ldap_memfree(oid); free_errmsg: ldap_memfree(errmsg); free_result: ldap_msgfree(result); end: return rc; } static int decode_response(audit_response_t * r, struct berval *bv) { BerElement *ber; ber_len_t len; int rc; if (!bv) { log_err("LDAP extended operation returned NULL message"); return ICTX_E_ABORT; } else if ((ber = ber_init(bv)) == NULL) { log_err("Error initializing BER response data"); return ICTX_E_ABORT; } log_debug("---Got an encoded request response:"); debug_bv(bv); r->respVersion = 0; r->respMajor = 0; r->numItems = 0; r->itemList = NULL; rc = ber_scanf(ber, "{ii", &r->respVersion, &r->respMajor); if (r->respVersion != ICTX_REQUESTVER) { log_err("Invalid version returned by z/OS Remote-services server"); log_err("Should be %d, got %d", ICTX_REQUESTVER, r->respVersion); rc = ICTX_E_ABORT; goto free_ber; } if (r->respMajor == ZOS_REMOTE_MAJOR_SUCCESS || r->respMajor == ZOS_REMOTE_MAJOR_EMPTY) { rc = ICTX_SUCCESS; /* No further processing required */ goto free_ber; } /* Inspect ber response otherwise */ while (ber_peek_tag(ber, &len) == LBER_SEQUENCE) { r->numItems++; r->itemList = (audit_resp_item_t **) realloc(r->itemList, r->numItems * sizeof (audit_resp_item_t *)); if (errno == ENOMEM) { if (r->itemList) free(r->itemList); rc = ICTX_E_FATAL; goto free_ber; } audit_resp_item_t *item = (audit_resp_item_t *) malloc(sizeof(audit_resp_item_t)); if (!item) { rc = ICTX_E_FATAL; goto free_ber; } rc |= ber_scanf(ber, "{{iiiiii}}", &item->version, &item->itemTag, &item->majorCode, &item->minorCode1, &item->minorCode2, &item->minorCode3); r->itemList[r->numItems - 1] = item; } rc |= ber_scanf(ber, "}"); if (rc == -1) { for (; r->numItems > 0; r->numItems--) free(r->itemList[r->numItems - 1]); free(r->itemList); rc = ICTX_E_ABORT; } else rc = ICTX_SUCCESS; free_ber: ber_free(ber, 1); return rc; } audit-4.0.2/audisp/plugins/zos-remote/zos-remote-config.c0000644001034500103450000003207014655201403017073 /*************************************************************************** * Copyright (C) 2007 International Business Machines Corp. * * All Rights Reserved. * * * * 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. * * * * Authors: * * Klaus Heinrich Kiwi * * based on code by Steve Grubb * ***************************************************************************/ #include "zos-remote-config.h" #include #include #include #include #include #include #include #include #include "zos-remote-log.h" /* Local prototypes */ struct nv_pair { const char *name; const char *value; const char *option; }; struct kw_pair { const char *name; int (*parser) (struct nv_pair *, int, plugin_conf_t *); int max_options; }; struct nv_list { const char *name; int option; }; static char *get_line(FILE *, char *); static int nv_split(char *, struct nv_pair *); static const struct kw_pair *kw_lookup(const char *); static int server_parser(struct nv_pair *, int, plugin_conf_t *); static int port_parser(struct nv_pair *, int, plugin_conf_t *); static int timeout_parser(struct nv_pair *, int, plugin_conf_t *); static int user_parser(struct nv_pair *, int, plugin_conf_t *); static int password_parser(struct nv_pair *, int, plugin_conf_t *); static int q_depth_parser(struct nv_pair *, int, plugin_conf_t *); static int sanity_check(plugin_conf_t *); static const struct kw_pair keywords[] = { {"server", server_parser, 0}, {"port", port_parser, 0}, {"timeout", timeout_parser, 0}, {"user", user_parser, 0}, {"password", password_parser, 0}, {"q_depth", q_depth_parser, 0}, {NULL, NULL, 0} }; #define UNUSED(x) (void)(x) /* * Set everything to its default value */ void plugin_clear_config(plugin_conf_t * c) { c->server = NULL; c->port = 0; c->user = NULL; c->password = NULL; c->timeout = 15; c->q_depth = 64; /* not re-setting counter */ } int plugin_load_config(plugin_conf_t * c, const char *file) { int fd, rc, mode, lineno = 1; struct stat st; FILE *f; char buf[128]; plugin_clear_config(c); /* open the file */ mode = O_RDONLY; rc = open(file, mode); if (rc < 0) { if (errno != ENOENT) { log_err("Error opening %s (%s)", file, strerror(errno)); return 1; } log_warn("Config file %s doesn't exist, skipping", file); return 1; } fd = rc; /* check the file's permissions: owned by root, not world anything, * not symlink. */ if (fstat(fd, &st) < 0) { log_err("Error fstat'ing config file (%s)", strerror(errno)); close(fd); return 1; } if (st.st_uid != 0) { log_err("Error - %s isn't owned by root", file); close(fd); return 1; } if ((st.st_mode & (S_IRUSR | S_IWUSR | S_IRGRP)) != (S_IRUSR | S_IWUSR | S_IRGRP)) { log_err("%s permissions should be 0640", file); close(fd); return 1; } if (!S_ISREG(st.st_mode)) { log_err("Error - %s is not a regular file", file); close(fd); return 1; } /* it's ok, read line by line */ f = fdopen(fd, "r"); if (f == NULL) { log_err("Error - fdopen failed (%s)", strerror(errno)); close(fd); return 1; } while (get_line(f, buf)) { /* convert line into name-value pair */ const struct kw_pair *kw; struct nv_pair nv; rc = nv_split(buf, &nv); switch (rc) { case 0: /* fine */ break; case 1: /* not the right number of tokens. */ log_err("Wrong number of arguments for line %d in %s", lineno, file); break; case 2: /* no '=' sign */ log_err("Missing equal sign for line %d in %s", lineno, file); break; default: /* something else went wrong... */ log_err("Unknown error for line %d in %s", lineno, file); break; } if (nv.name == NULL) { lineno++; continue; } if (nv.value == NULL) { fclose(f); return 1; } /* identify keyword or error */ kw = kw_lookup(nv.name); if (kw->name == NULL) { log_err("Unknown keyword \"%s\" in line %d of %s", nv.name, lineno, file); fclose(f); return 1; } /* Check number of options */ if (kw->max_options == 0 && nv.option != NULL) { log_err("Keyword \"%s\" has invalid option " "\"%s\" in line %d of %s", nv.name, nv.option, lineno, file); fclose(f); return 1; } /* dispatch to keyword's local parser */ rc = kw->parser(&nv, lineno, c); if (rc != 0) { fclose(f); return 1; /* local parser puts message out */ } lineno++; } fclose(f); c->name = strdup(basename(file)); if (lineno > 1) return sanity_check(c); return 0; } static char *get_line(FILE * f, char *buf) { if (fgets_unlocked(buf, 128, f)) { /* remove newline */ char *ptr = strchr(buf, 0x0a); if (ptr) *ptr = 0; return buf; } return NULL; } static int nv_split(char *buf, struct nv_pair *nv) { /* Get the name part */ char *ptr, *saved; nv->name = NULL; nv->value = NULL; nv->option = NULL; ptr = strtok_r(buf, " ", &saved); if (ptr == NULL) return 0; /* If there's nothing, go to next line */ if (ptr[0] == '#') return 0; /* If there's a comment, go to next line */ nv->name = ptr; /* Check for a '=' */ ptr = strtok_r(NULL, " ", &saved); if (ptr == NULL) return 1; if (strcmp(ptr, "=") != 0) return 2; /* get the value */ ptr = strtok_r(NULL, " ", &saved); if (ptr == NULL) return 1; nv->value = ptr; /* See if there's an option */ ptr = strtok_r(NULL, " ", &saved); if (ptr) { nv->option = ptr; /* Make sure there's nothing else */ ptr = strtok_r(NULL, " ", &saved); if (ptr) return 1; } /* Everything is OK */ return 0; } static const struct kw_pair *kw_lookup(const char *val) { int i = 0; while (keywords[i].name != NULL) { if (strcasecmp(keywords[i].name, val) == 0) break; i++; } return &keywords[i]; } static int server_parser(struct nv_pair *nv, int line, plugin_conf_t * c) { UNUSED(line); if (nv->value == NULL) c->server = NULL; else c->server = strdup(nv->value); return 0; } static int port_parser(struct nv_pair *nv, int line, plugin_conf_t * c) { const char *ptr = nv->value; unsigned long i; /* check that all chars are numbers */ for (i = 0; ptr[i]; i++) { if (!isdigit((unsigned char)ptr[i])) { log_err("Value %s should only be numbers - line %d", nv->value, line); return 1; } } /* convert to unsigned long */ errno = 0; i = strtoul(nv->value, NULL, 10); if (errno) { log_err("Error converting string to a number (%s) - line %d", strerror(errno), line); return 1; } c->port = i; return 0; } static int timeout_parser(struct nv_pair *nv, int line, plugin_conf_t * c) { const char *ptr = nv->value; unsigned long i; /* check that all chars are numbers */ for (i = 0; ptr[i]; i++) { if (!isdigit((unsigned char)ptr[i])) { log_err("Value %s should only be numbers - line %d", nv->value, line); return 1; } } /* convert to unsigned long */ errno = 0; i = strtoul(nv->value, NULL, 10); if (errno) { log_err("Error converting string to a number (%s) - line %d", strerror(errno), line); return 1; } c->timeout = i; return 0; } static int user_parser(struct nv_pair *nv, int line, plugin_conf_t * c) { UNUSED(line); if (nv->value == NULL) c->user = NULL; else c->user = strdup(nv->value); return 0; } static int password_parser(struct nv_pair *nv, int line, plugin_conf_t * c) { UNUSED(line); if (nv->value == NULL) c->password = NULL; else c->password = strdup(nv->value); return 0; } static int q_depth_parser(struct nv_pair *nv, int line, plugin_conf_t * c) { const char *ptr = nv->value; unsigned long i; /* check that all chars are numbers */ for (i = 0; ptr[i]; i++) { if (!isdigit((unsigned char)ptr[i])) { log_err("Value %s should only be numbers - line %d", nv->value, line); return 1; } } /* convert to unsigned long */ errno = 0; i = strtoul(nv->value, NULL, 10); if (errno) { log_err("Error converting string to a number (%s) - line %d", strerror(errno), line); return 1; } if (i < 16 || i > 99999) { log_err("q_depth must be between 16 and 99999"); return 1; } c->q_depth = i; return 0; } /* * Check configuration.At this point, all fields have been read. * Returns 0 if no problems and 1 if problems detected. */ static int sanity_check(plugin_conf_t * c) { /* Error checking */ if (!c->server) { log_err("Error - no server hostname given"); return 1; } if (!c->user) { log_err("Error - no bind user given"); return 1; } if (!c->password) { log_err("Error - no password given"); return 1; } if (!c->timeout) { log_err("Error - timeout can't be zero"); return 1; } return 0; } void plugin_free_config(plugin_conf_t * c) { if (c == NULL) return; free((void *) c->server); free((void *) c->user); free((void *) c->password); free((void *) c->name); } audit-4.0.2/audisp/plugins/zos-remote/Makefile.am0000644001034500103450000000412014655201403015407 # Makefile.am-- # Copyright (C) 2007,2008 International Business Machines Corp. # Copyright (C) 2011, 2015 Red Hat., Durham, North Carolina. # All Rights Reserved. # # 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; see the file COPYING. If not, write to the # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor # Boston, MA 02110-1335, USA. # # Authors: # Klaus Heinrich Kiwi # AM_CPPFLAGS = -I${top_srcdir} -I${top_srcdir}/lib -I${top_srcdir}/auparse CONFIG_CLEAN_FILES = *.rej *.orig EXTRA_DIST = zos-remote.conf audispd-zos-remote.conf LIBS = ${top_builddir}/auparse/libauparse.la LDADD = -lpthread -lldap -llber $(CAPNG_LDADD) plugin_confdir=$(sysconfdir)/audit plugin_conf = zos-remote.conf dispatcher_confdir = $(plugin_confdir)/plugins.d dispatcher_conf = audispd-zos-remote.conf sbin_PROGRAMS = audispd-zos-remote noinst_HEADERS = zos-remote-log.h zos-remote-ldap.h zos-remote-config.h \ zos-remote-queue.h audispd_zos_remote_SOURCES = zos-remote-plugin.c zos-remote-log.c \ zos-remote-ldap.c zos-remote-config.c zos-remote-queue.c audispd_zos_remote_CFLAGS = -W -Wall -Wundef -D_GNU_SOURCE -fPIE -DPIE ${WFLAGS} audispd_zos_remote_LDFLAGS = -pie -Wl,-z,relro -Wl,-z,now install-data-hook: mkdir -p -m 0750 ${DESTDIR}${plugin_confdir} $(INSTALL_DATA) -D -m 640 ${srcdir}/$(plugin_conf) \ ${DESTDIR}${plugin_confdir} $(INSTALL_DATA) -D -m 640 ${srcdir}/$(dispatcher_conf) \ ${DESTDIR}${dispatcher_confdir} uninstall-hook: rm ${DESTDIR}${plugin_confdir}/$(plugin_conf) rm ${DESTDIR}${dispatcher_confdir}/$(dispatcher_conf) audit-4.0.2/audisp/plugins/zos-remote/zos-remote-log.c0000644001034500103450000000660714655201403016416 /*************************************************************************** * Copyright (C) 2007 International Business Machines Corp. * * All Rights Reserved. * * * * 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. * * * * Authors: * * Klaus Heinrich Kiwi * ***************************************************************************/ #include "zos-remote-log.h" #include #include #include #include "auparse.h" static void vlog_prio(int prio, const char *fmt, va_list ap) { char *str; if (asprintf(&str, "pid=%d: %s", mypid, fmt) != -1) { vsyslog(LOG_DAEMON | prio, str, ap); free(str); } } void log_err(const char *fmt, ...) { va_list ap; va_start(ap, fmt); vlog_prio(LOG_ERR, fmt, ap); va_end(ap); } void log_warn(const char *fmt, ...) { va_list ap; va_start(ap, fmt); vlog_prio(LOG_WARNING, fmt, ap); va_end(ap); } void log_info(const char *fmt, ...) { va_list ap; va_start(ap, fmt); vlog_prio(LOG_INFO, fmt, ap); va_end(ap); } void _log_debug(const char *fmt, ...) { va_list ap; va_start(ap, fmt); vlog_prio(LOG_INFO, fmt, ap); va_end(ap); } void _debug_ber(BerElement * ber) { struct berval bv; if (ber_flatten2(ber, &bv, 0) != -1) { debug_bv(&bv); } } void _debug_bv(struct berval *bv) { char *out; char octet[4]; ber_len_t i; log_debug("---BER value HEX dump (size %u bytes)", (unsigned int) bv->bv_len); if (bv->bv_len > 0) { out = (char *) calloc((3 * (bv->bv_len)) + 1, sizeof(char)); if (!out) return; for (i = 1; i <= bv->bv_len; i++) { snprintf(octet, 4, "%02x ", (unsigned char) bv->bv_val[i - 1]); strcat(out, octet); } log_debug(out); free(out); } } audit-4.0.2/audisp/plugins/zos-remote/audispd-zos-remote.conf0000644001034500103450000000066214655201403017764 # This is the configuration for the audispd-zos-remote # audit dispatcher plugin - See auditd(8) # # Note that this specific plugin has a configuration file of # its own. The complete path for this file must be entered as # the argument for the plugin in the 'args' field below # See audispd-zos-remote(8) active = no direction = out path = /sbin/audispd-zos-remote type = always args = /etc/audit/zos-remote.conf format = string audit-4.0.2/audisp/plugins/zos-remote/zos-remote-log.h0000644001034500103450000000460714655201403016421 /*************************************************************************** * Copyright (C) 2007 International Business Machines Corp. * * All Rights Reserved. * * * * 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. * * * * Authors: * * Klaus Heinrich Kiwi * ***************************************************************************/ #ifndef _ZOS_REMOTE_LOG_H #define _ZOS_REMOTE_LOG_H #include "zos-remote-ldap.h" #include #include #include #include extern pid_t mypid; void log_err(const char *, ...); void log_warn(const char *, ...); void log_info(const char *, ...); void _log_debug(const char *, ...); void _debug_bv(struct berval *); void _debug_ber(BerElement *); #ifdef DEBUG #define log_debug(fmt, ...) _log_debug(fmt, ## __VA_ARGS__) #define debug_bv(bv) _debug_bv(bv) #define debug_ber(ber) _debug_ber(ber) #else #define log_debug(fmt, ...) #define debug_bv(bv) #define debug_ber(ber) #endif /* DEBUG */ #endif /* _ZOS_REMOTE_LOG_H */ audit-4.0.2/audisp/plugins/zos-remote/zos-remote-queue.h0000644001034500103450000000403414655201403016756 /*************************************************************************** * Copyright (C) 2007 International Business Machines Corp. * * All Rights Reserved. * * * * 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. * * * * Authors: * * Klaus Heinrich Kiwi * * based on code by Steve Grubb * ***************************************************************************/ #ifndef _ZOS_REMOTE_QUEUE_H #define _ZOS_REMOTE_QUEUE_H #include int init_queue(unsigned int size); void enqueue(BerElement *); BerElement *dequeue(void); void nudge_queue(void); void increase_queue_depth(unsigned int size); void destroy_queue(void); #endif /* _ZOS_REMOTE_QUEUE_H */ audit-4.0.2/audisp/plugins/zos-remote/zos-remote-ldap.h0000644001034500103450000003336314655201403016561 /*************************************************************************** * Copyright (C) 2007 International Business Machines Corp. * * All Rights Reserved. * * * * 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. * * * * Authors: * * Klaus Heinrich Kiwi * ***************************************************************************/ #ifndef _ZOS_REMOTE_LDAP_H #define _ZOS_REMOTE_LDAP_H #include #include /*************************************************************************** * LDAP Extended Op OID for ICTX Audit * ***************************************************************************/ /* ICTX EIM component AUDIT Request OID */ #define ICTX_OIDAUDITREQUEST "1.3.18.0.2.12.68" /* The AUDIT Response OID */ #define ICTX_OIDAUDITRESPONSE "1.3.18.0.2.12.69" /* This implementation version Request and response must match this */ #define ICTX_REQUESTVER 0x1 /* Needed for BER-encoding */ #define ASN1_IA5STRING_TAG 0x16 /*************************************************************************** * the ASN.1 struct for the remote audit request and response: * * * * RequestValue ::= SEQUENCE { * * RequestVersion INTEGER, * * ItemList SEQUENCE OF * * Item SEQUENCE { * * ItemVersion INTEGER, * * ItemTag INTEGER, * * LinkValue OCTET STRING SIZE(8), * * Violation BOOLEAN, * * Event INTEGER, * * Qualifier INTEGER, * * Class IA5String, * * Resource IA5String, * * LogString IA5String, * * DatafieldList SEQUENCE OF * * DataField SEQUENCE { * * TYPE INTEGER, * * VALUE IA5STRING * * } * * } * * } * * * * Response ::= SEQUENCE { * * Version INTEGER, * * ResponseCode INTEGER, * * ItemList SEQUENCE OF * * Item SEQUENCE { * * ItemVersion INTEGER, * * ItemTag INTEGER, * * MajorCode INTEGER, * * MinorCode1 INTEGER, * * MinorCode2 INTEGER, * * MinorCode3 INTEGER * * } * * } * ***************************************************************************/ /*************************************************************************** * z/OS Remote-services Audit Minor return codes meaning Major Code Meaning ---------- --------------------------------------------------------- 0-14 - MinorCode1 is the SAF return code - MinorCode2 is the RACF return code - MinorCode3 is the RACF reason code 16-20 - MinorCode1 identifies the extended operation request parameter number (see audit request ASN.1 definition): 0 - Item 1 - ItemVersion 2 - ItemTag 3 - LinkValue 4 - Violation 5 - Event 6 - Qualifier 7 - Class 8 - Resource 9 - LogString 10 - DataFieldList 11 - DataField * 12 - TYPE * 13 - VALUE * - MinorCode2 indicates one of the Following: 32 - incorrect length 36 - incorrect value 40 - encoding error - MinorCode3 has no defined meaning 24-100 - MinorCode1 has no defined meaning - MinorCode2 has no defined meaning - MinorCode3 has no defined meaning * There can be multiple DataField, TYPEs and VALUEs in a request. If any of them is bad you get the same 11, 12 or 13 MinorCode1. There is no further breakdown of which one is bad. ***************************************************************************/ /*************************************************************************** * Audit Request 'event' field meaning * ***************************************************************************/ #define ZOS_REMOTE_EVENT_AUTHENTICATION 0x1 #define ZOS_REMOTE_EVENT_AUTHORIZATION 0x2 #define ZOS_REMOTE_EVENT_AUTHORIZATION_MAPPING 0x3 #define ZOS_REMOTE_EVENT_KEY_MGMT 0x4 #define ZOS_REMOTE_EVENT_POLICY_MGMT 0x5 #define ZOS_REMOTE_EVENT_ADMIN_CONFIG 0x6 #define ZOS_REMOTE_EVENT_ADMIN_ACTION 0x7 /*************************************************************************** * Audit Request 'qualifier' field meaning * ***************************************************************************/ #define ZOS_REMOTE_QUALIF_SUCCESS 0x0 #define ZOS_REMOTE_QUALIF_INFO 0x1 #define ZOS_REMOTE_QUALIF_WARN 0x2 #define ZOS_REMOTE_QUALIF_FAIL 0x3 /*************************************************************************** * Relocate types for Audit Request * ***************************************************************************/ /* SAF identifier for bind user */ #define ZOS_REMOTE_RELOC_SAF_BIND_USER 100 /* Reguestor's bind user identifier */ #define ZOS_REMOTE_RELOC_REQ_BIND_USER 101 /* Originating security domain */ #define ZOS_REMOTE_RELOC_ORIG_SECURITY 102 /* Originating registry / realm */ #define ZOS_REMOTE_RELOC_ORIG_REALM 103 /* Originating user name */ #define ZOS_REMOTE_RELOC_ORIG_USER 104 /* Mapped security domain */ #define ZOS_REMOTE_RELOC_MAPPED_SECURITY 105 /* Mapped registry / realm */ #define ZOS_REMOTE_RELOC_MAPPED_REALM 106 /* Mapped user name */ #define ZOS_REMOTE_RELOC_MAPPED_USER 107 /* Operation performed */ #define ZOS_REMOTE_RELOC_OPERATION 108 /* Mechanism / object name */ #define ZOS_REMOTE_RELOC_OBJECT 109 /* Method / function used */ #define ZOS_REMOTE_RELOC_FUNCTION 110 /* Key / certificate name */ #define ZOS_REMOTE_RELOC_CERTIFICATE 111 /* Caller subject initiating security event */ #define ZOS_REMOTE_RELOC_INITIATING_EVENT 112 /* Date and time security event occurred */ #define ZOS_REMOTE_RELOC_TIMESTAMP 113 /* Application specific data. (i.e. Other) */ #define ZOS_REMOTE_RELOC_OTHER 114 /*************************************************************************** * z/OS Remote-services Audit Major return codes * ***************************************************************************/ #define ZOS_REMOTE_MAJOR_SUCCESS 0 /* Event was logged, with warnings */ #define ZOS_REMOTE_MAJOR_WARNINGMODE 2 /* No logging required No audit controls are set to require it */ #define ZOS_REMOTE_MAJOR_NOTREQ 3 /* Class not active/ractlisted, covering profile not found or RACF is not installed */ #define ZOS_REMOTE_MAJOR_UNDETERMINED 4 /* The user does not have authority the R_auditx service. The userid associated with the LDAP server must have at least READ access to the FACILITY class profile IRR.RAUDITX. */ #define ZOS_REMOTE_MAJOR_UNAUTHORIZED 8 /* The R_auditx service returned an unexpected error. Compare the returned minor codes with the SAF RACF codes documented in Security Server Callable Services */ #define ZOS_REMOTE_MAJOR_RACROUTE 12 /* A value specified in the extended operation request is incorrect or unsupported. Check the returned minor codes to narrow the reason */ #define ZOS_REMOTE_MAJOR_VAL_ERR 16 /* A DER decoding error was encountered in an item. Processing Terminated. Partial results may be returned */ #define ZOS_REMOTE_MAJOR_ENC_ERR 20 /* The requestor does not have sufficient authority for the requested function. The userid associated with the LDAP bind user must have at least READ access to the FACILITY class profile IRR.LDAP.REMOTE.AUDIT. */ #define ZOS_REMOTE_MAJOR_UNSUF_AUTH 24 /* No items are found within the ItemList sequence of the extended operation request, so no response items are returned */ #define ZOS_REMOTE_MAJOR_EMPTY 28 /* Invalid RequestVersion */ #define ZOS_REMOTE_MAJOR_INVALID_VER 61 /* An internal error was encountered within the ICTX component */ #define ZOS_REMOTE_MAJOR_INTERNAL_ERR 100 /*************************************************************************** * Some standard sizes for remote audit request items * ***************************************************************************/ #define ZOS_REMOTE_LINK_VALUE_SIZE 8 #define ZOS_REMOTE_CLASS_SIZE 8 #define ZOS_REMOTE_RESOURCE_SIZE 240 #define ZOS_REMOTE_LOGSTRING_SIZE 200 /*************************************************************************** * Some standard Error defines * ***************************************************************************/ #define ICTX_SUCCESS 0x00 /* maybe a temporary failure? */ #define ICTX_E_TRYAGAIN 0x01 /* permanent failure - abort event submission */ #define ICTX_E_ABORT 0x02 /* Fatal failure - abort program */ #define ICTX_E_FATAL 0x03 /* generic error */ #define ICTX_E_ERROR 0x10 /*************************************************************************** * structure representing an z/OS Remote-services session * ***************************************************************************/ typedef struct opaque { char *server; unsigned int port; char *user; char *password; unsigned int timeout; LDAP *ld; int connected; } ZOS_REMOTE; /*************************************************************************** * LDAP XOP operations * ***************************************************************************/ /* * Initializes z/OS Remote-services (LDAP to ITDS) connection, * binds to ITDS Server using configured RACF ID * Args are: * server, bind user, bind password, server port, timeout * Caller must call zos_remote_destroy() to free memory allocation */ int zos_remote_init(ZOS_REMOTE *, const char *, int, const char *, const char *, int); /* * Uninitializes z/OS Remote-services (LDAP) connection */ void zos_remote_destroy(ZOS_REMOTE *); /* * sync submit request - possibly reconnect to server * if the connection if found to be dead */ int submit_request_s(ZOS_REMOTE *, BerElement *); #endif /* _ZOS_REMOTE_LDAP_H */ audit-4.0.2/audisp/plugins/zos-remote/zos-remote.conf0000644001034500103450000000036614655201403016336 ## This is the configuration file for the audispd-zos-remote ## Audit dispatcher plugin. ## See zos-remote.conf(5) for more information server = zos_server.localdomain port = 389 user = RACF_ID password = racf_password timeout = 15 q_depth = 64 audit-4.0.2/audisp/plugins/zos-remote/zos-remote-config.h0000644001034500103450000000471314655201403017103 /*************************************************************************** * Copyright (C) 2007 International Business Machines Corp. * * All Rights Reserved. * * * * 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. * * * * Authors: * * Klaus Heinrich Kiwi * * based on code by Steve Grubb * ***************************************************************************/ #ifndef _ZOS_REMOTE_CONFIG_H #define _ZOS_REMOTE_CONFIG_H /*************************************************************************** * z/OS Remote-services Plugin configuration * ***************************************************************************/ typedef struct plugin_conf { char *name; char *server; unsigned int port; char *user; char *password; long timeout; unsigned int q_depth; unsigned int counter; } plugin_conf_t; void plugin_clear_config(plugin_conf_t *); int plugin_load_config(plugin_conf_t *, const char *); void plugin_free_config(plugin_conf_t *); #endif /* _ZOS_REMOTE_CONFIG_H */ audit-4.0.2/configure0000755001034500103450000217632614655201417010241 #! /bin/sh # From configure.ac Revision: 1.3 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.71 for audit 4.0.2. # # # Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, # Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi # Reset variables that may have inherited troublesome values from # the environment. # IFS needs to be set, to space, tab, and newline, in precisely that order. # (If _AS_PATH_WALK were called with IFS unset, it would have the # side effect of setting IFS to empty, thus disabling word splitting.) # Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl IFS=" "" $as_nl" PS1='$ ' PS2='> ' PS4='+ ' # Ensure predictable behavior from utilities with locale-dependent output. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # We cannot yet rely on "unset" to work, but we need these variables # to be unset--not just set to an empty or harmless value--now, to # avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct # also avoids known problems related to "unset" and subshell syntax # in other old shells (e.g. bash 2.01 and pdksh 5.2.14). for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH do eval test \${$as_var+y} \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done # Ensure that fds 0, 1, and 2 are open. if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="as_nop=: if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else \$as_nop case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ) then : else \$as_nop exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 blah=\$(echo \$(echo blah)) test x\"\$blah\" = xblah || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null then : as_have_required=yes else $as_nop as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null then : else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$as_shell as_have_required=yes if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null then : break 2 fi fi done;; esac as_found=false done IFS=$as_save_IFS if $as_found then : else $as_nop if { test -f "$SHELL" || test -f "$SHELL.exe"; } && as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$SHELL as_have_required=yes fi fi if test "x$CONFIG_SHELL" != x then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno then : printf "%s\n" "$0: This script requires a shell more modern than all" printf "%s\n" "$0: the shells that I found on your system." if test ${ZSH_VERSION+y} ; then printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." else printf "%s\n" "$0: Please tell bug-autoconf@gnu.org 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_nop # --------- # Do nothing but, unlike ":", preserve the value of $?. as_fn_nop () { return $? } as_nop=as_fn_nop # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null then : eval 'as_fn_append () { eval $1+=\$2 }' else $as_nop as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null then : eval 'as_fn_arith () { as_val=$(( $* )) }' else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_nop # --------- # Do nothing but, unlike ":", preserve the value of $?. as_fn_nop () { return $? } as_nop=as_fn_nop # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } # Determine whether it's possible to make 'echo' print without a newline. # These variables are no longer used directly by Autoconf, but are AC_SUBSTed # for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac # For backward compatibility with old third-party macros, we provide # the shell variables $as_echo and $as_echo_n. New code should use # AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. as_echo='printf %s\n' as_echo_n='printf %s' rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='audit' PACKAGE_TARNAME='audit' PACKAGE_VERSION='4.0.2' PACKAGE_STRING='audit 4.0.2' PACKAGE_BUGREPORT='' PACKAGE_URL='' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_STDIO_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_header_c_list= ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS LIBWRAP_LIBS DEBUG CAPNG_PKG CAPNG_LDADD USE_AARCH64_FALSE USE_AARCH64_TRUE USE_ARM_FALSE USE_ARM_TRUE WFLAGS DEBUG_FALSE DEBUG_TRUE ENABLE_EXPERIMENTAL_FALSE ENABLE_EXPERIMENTAL_TRUE ENABLE_GSSAPI_FALSE ENABLE_GSSAPI_TRUE gss_libs ENABLE_ZOS_REMOTE_FALSE ENABLE_ZOS_REMOTE_TRUE ENABLE_LISTENER_FALSE ENABLE_LISTENER_TRUE HAVE_GOLANG_FALSE HAVE_GOLANG_TRUE GOROOT GOLANG SWIG USE_PYTHON3_FALSE USE_PYTHON3_TRUE PYTHON3_INCLUDES PYTHON3_LIBS PYTHON3_CFLAGS pkgpyexecdir pyexecdir pkgpythondir pythondir PYTHON_EXEC_PREFIX PYTHON_PREFIX PYTHON_PLATFORM PYTHON_VERSION PYTHON use_python3 LDFLAGS_FOR_BUILD CPPFLAGS_FOR_BUILD CFLAGS_FOR_BUILD BUILD_OBJEXT BUILD_EXEEXT CPP_FOR_BUILD ac_ct_CC_FOR_BUILD CC_FOR_BUILD CPP LIBTOOL_DEPS LT_SYS_LIBRARY_PATH OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP FILECMD LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP EGREP GREP SED am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC LIBTOOL AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V CSCOPE ETAGS CTAGS am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_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 am__quote' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_shared enable_static with_pic enable_fast_install with_aix_soname enable_dependency_tracking with_gnu_ld with_sysroot enable_libtool_lock with_python3 with_python_sys_prefix with_python_prefix with_python_exec_prefix with_golang enable_listener enable_zos_remote enable_gssapi_krb5 enable_experimental with_debug with_arm with_aarch64 with_apparmor with_libwrap with_io_uring with_libcap_ng ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS LT_SYS_LIBRARY_PATH CPP PYTHON' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst | --runs \ | --run | --ru | --r) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | --run=* | --ru=* | --r=*) runstatedir=$ac_optarg ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures audit 4.0.2 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/audit] --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 audit 4.0.2:";; 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-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --disable-libtool-lock avoid locking (might break parallel builds) --disable-listener Disable auditd network listener support --disable-zos-remote Disable audisp ZOS remote plugin --enable-gssapi-krb5 Enable GSSAPI Kerberos 5 support [default=no] --enable-experimental Enable experimental audit components [default=no] Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-aix-soname=aix|svr4|both shared library versioning (aka "SONAME") variant to provide on AIX, [default=aix]. --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-python3 enable building python3 bindings --with-python-sys-prefix use Python's sys.prefix and sys.exec_prefix values --with-python_prefix override the default PYTHON_PREFIX --with-python_exec_prefix override the default PYTHON_EXEC_PREFIX --with-golang enable building golang bindings --with-debug turn on debugging [default=no] --with-arm enable Arm eabi processor support --with-aarch64 enable Aarch64 processor support --with-apparmor enable AppArmor events --with-libwrap=PATH Compile in libwrap (tcp_wrappers) support. --with-io_uring enable io_uring support --with-libcap-ng=auto/yes/no Add Libcap-ng support default=auto 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 LT_SYS_LIBRARY_PATH User-defined run-time library search path. CPP C preprocessor PYTHON the Python interpreter 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=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for configure.gnu first; this name is used for a wrapper for # Metaconfig's "Configure" on case-insensitive file systems. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF audit configure 4.0.2 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext then : ac_retval=0 else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext } then : ac_retval=0 else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$3=yes" else $as_nop eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. */ #include #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main (void) { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$3=yes" else $as_nop eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else $as_nop eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { 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 (void) { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else $as_nop eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$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 printf "%s\n" "$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_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that # executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; } then : ac_retval=0 else $as_nop printf "%s\n" "$as_me: program exited with status $ac_status" >&5 printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_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 (void) { 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 (void) { 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_nop 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.beam conftest.$ac_ext done else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { 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 (void) { 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_nop 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.beam conftest.$ac_ext done else $as_nop ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext # 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 (void) { 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_nop as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.beam 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 (void) { return $2; } static unsigned long int ulongval (void) { return $2; } #include #include int main (void) { 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 printf %s "checking whether $as_decl_name is declared... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else $as_nop as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` eval ac_save_FLAGS=\$$6 as_fn_append $6 " $5" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { #ifndef $as_decl_name #ifdef __cplusplus (void) $as_decl_use; #else (void) $as_decl_name; #endif #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$3=yes" else $as_nop eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext eval $6=\$ac_save_FLAGS fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_check_decl # ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES # ---------------------------------------------------- # Tries to find if the field MEMBER exists in type AGGR, after including # INCLUDES, setting cache variable VAR accordingly. ac_fn_c_check_member () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 printf %s "checking for $2.$3... " >&6; } if eval test \${$4+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main (void) { static $2 ac_aggr; if (ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$4=yes" else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main (void) { static $2 ac_aggr; if (sizeof ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$4=yes" else $as_nop eval "$4=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$4 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_member ac_configure_args_raw= for ac_arg do case $ac_arg in *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append ac_configure_args_raw " '$ac_arg'" done case $ac_configure_args_raw in *$as_nl*) ac_safe_unquote= ;; *) ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. ac_unsafe_a="$ac_unsafe_z#~" ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; esac cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by audit $as_me 4.0.2, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac printf "%s\n" "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Sanitize IFS. IFS=" "" $as_nl" # Save into config.log some information that might help in debugging. { echo printf "%s\n" "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo printf "%s\n" "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then printf "%s\n" "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then printf "%s\n" "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && printf "%s\n" "$as_me: caught signal $ac_signal" printf "%s\n" "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h printf "%s\n" "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then ac_site_files="$CONFIG_SITE" elif test "x$prefix" != xNONE; then ac_site_files="$prefix/share/config.site $prefix/etc/config.site" else ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi for ac_site_file in $ac_site_files do case $ac_site_file in #( */*) : ;; #( *) : ac_site_file=./$ac_site_file ;; esac if test -f "$ac_site_file" && test -r "$ac_site_file"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 printf "%s\n" "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 printf "%s\n" "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Test code for whether the C compiler supports C89 (global declarations) ac_c_conftest_c89_globals=' /* Does the compiler advertise C89 conformance? Do not test the value of __STDC__, because some compilers set it to 0 while being otherwise adequately conformant. */ #if !defined __STDC__ # error "Compiler does not advertise C89 conformance" #endif #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ struct buf { int x; }; struct buf * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not \xHH hex character constants. These do not provoke an error unfortunately, instead are silently treated as an "x". The following induces an error, until -std is added to get proper ANSI mode. Curiously \x00 != x always comes out true, for an array size at least. It is necessary to write \x00 == 0 to get something that is true only with -std. */ int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) '\''x'\'' int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), int, int);' # Test code for whether the C compiler supports C89 (body of main). ac_c_conftest_c89_main=' ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); ' # Test code for whether the C compiler supports C99 (global declarations) ac_c_conftest_c99_globals=' // Does the compiler advertise C99 conformance? #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L # error "Compiler does not advertise C99 conformance" #endif #include extern int puts (const char *); extern int printf (const char *, ...); extern int dprintf (int, const char *, ...); extern void *malloc (size_t); // Check varargs macros. These examples are taken from C99 6.10.3.5. // dprintf is used instead of fprintf to avoid needing to declare // FILE and stderr. #define debug(...) dprintf (2, __VA_ARGS__) #define showlist(...) puts (#__VA_ARGS__) #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) static void test_varargs_macros (void) { int x = 1234; int y = 5678; debug ("Flag"); debug ("X = %d\n", x); showlist (The first, second, and third items.); report (x>y, "x is %d but y is %d", x, y); } // Check long long types. #define BIG64 18446744073709551615ull #define BIG32 4294967295ul #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) #if !BIG_OK #error "your preprocessor is broken" #endif #if BIG_OK #else #error "your preprocessor is broken" #endif static long long int bignum = -9223372036854775807LL; static unsigned long long int ubignum = BIG64; struct incomplete_array { int datasize; double data[]; }; struct named_init { int number; const wchar_t *name; double average; }; typedef const char *ccp; static inline int test_restrict (ccp restrict text) { // See if C++-style comments work. // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) continue; return 0; } // Check varargs and va_copy. static bool test_varargs (const char *format, ...) { va_list args; va_start (args, format); va_list args_copy; va_copy (args_copy, args); const char *str = ""; int number = 0; float fnumber = 0; while (*format) { switch (*format++) { case '\''s'\'': // string str = va_arg (args_copy, const char *); break; case '\''d'\'': // int number = va_arg (args_copy, int); break; case '\''f'\'': // float fnumber = va_arg (args_copy, double); break; default: break; } } va_end (args_copy); va_end (args); return *str && number && fnumber; } ' # Test code for whether the C compiler supports C99 (body of main). ac_c_conftest_c99_main=' // Check bool. _Bool success = false; success |= (argc != 0); // Check restrict. if (test_restrict ("String literal") == 0) success = true; char *restrict newvar = "Another string"; // Check varargs. success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); test_varargs_macros (); // Check flexible array members. struct incomplete_array *ia = malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; // Check named initializers. struct named_init ni = { .number = 34, .name = L"Test wide string", .average = 543.34343, }; ni.number = 58; int dynamic_array[ni.number]; dynamic_array[0] = argv[0][0]; dynamic_array[ni.number - 1] = 543; // work around unused variable warnings ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' || dynamic_array[ni.number - 1] != 543); ' # Test code for whether the C compiler supports C11 (global declarations) ac_c_conftest_c11_globals=' // Does the compiler advertise C11 conformance? #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L # error "Compiler does not advertise C11 conformance" #endif // Check _Alignas. char _Alignas (double) aligned_as_double; char _Alignas (0) no_special_alignment; extern char aligned_as_int; char _Alignas (0) _Alignas (int) aligned_as_int; // Check _Alignof. enum { int_alignment = _Alignof (int), int_array_alignment = _Alignof (int[100]), char_alignment = _Alignof (char) }; _Static_assert (0 < -_Alignof (int), "_Alignof is signed"); // Check _Noreturn. int _Noreturn does_not_return (void) { for (;;) continue; } // Check _Static_assert. struct test_static_assert { int x; _Static_assert (sizeof (int) <= sizeof (long int), "_Static_assert does not work in struct"); long int y; }; // Check UTF-8 literals. #define u8 syntax error! char const utf8_literal[] = u8"happens to be ASCII" "another string"; // Check duplicate typedefs. typedef long *long_ptr; typedef long int *long_ptr; typedef long_ptr long_ptr; // Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. struct anonymous { union { struct { int i; int j; }; struct { int k; long int l; } w; }; int m; } v1; ' # Test code for whether the C compiler supports C11 (body of main). ac_c_conftest_c11_main=' _Static_assert ((offsetof (struct anonymous, i) == offsetof (struct anonymous, w.k)), "Anonymous union alignment botch"); v1.i = 2; v1.w.k = 5; ok |= v1.i != 5; ' # Test code for whether the C compiler supports C11 (complete). ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} ${ac_c_conftest_c11_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} ${ac_c_conftest_c11_main} return ok; } " # Test code for whether the C compiler supports C99 (complete). ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} return ok; } " # Test code for whether the C compiler supports C89 (complete). ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} return ok; } " as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" # Auxiliary files required by this configure script. ac_aux_files="compile ltmain.sh missing install-sh config.guess config.sub" # Locations in which to look for auxiliary files. ac_aux_dir_candidates="${srcdir}${PATH_SEPARATOR}${srcdir}/..${PATH_SEPARATOR}${srcdir}/../.." # Search for a directory containing all of the required auxiliary files, # $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. # If we don't find one directory that contains all the files we need, # we report the set of missing files from the *first* directory in # $ac_aux_dir_candidates and give up. ac_missing_aux_files="" ac_first_candidate=: printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in $ac_aux_dir_candidates do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac as_found=: printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 ac_aux_dir_found=yes ac_install_sh= for ac_aux in $ac_aux_files do # As a special case, if "install-sh" is required, that requirement # can be satisfied by any of "install-sh", "install.sh", or "shtool", # and $ac_install_sh is set appropriately for whichever one is found. if test x"$ac_aux" = x"install-sh" then if test -f "${as_dir}install-sh"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 ac_install_sh="${as_dir}install-sh -c" elif test -f "${as_dir}install.sh"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 ac_install_sh="${as_dir}install.sh -c" elif test -f "${as_dir}shtool"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 ac_install_sh="${as_dir}shtool install -c" else ac_aux_dir_found=no if $ac_first_candidate; then ac_missing_aux_files="${ac_missing_aux_files} install-sh" else break fi fi else if test -f "${as_dir}${ac_aux}"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 else ac_aux_dir_found=no if $ac_first_candidate; then ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" else break fi fi fi done if test "$ac_aux_dir_found" = yes; then ac_aux_dir="$as_dir" break fi ac_first_candidate=false as_found=false done IFS=$as_save_IFS if $as_found then : else $as_nop as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. if test -f "${ac_aux_dir}config.guess"; then ac_config_guess="$SHELL ${ac_aux_dir}config.guess" fi if test -f "${ac_aux_dir}config.sub"; then ac_config_sub="$SHELL ${ac_aux_dir}config.sub" fi if test -f "$ac_aux_dir/configure"; then ac_configure="$SHELL ${ac_aux_dir}configure" fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers config.h" echo Configuring auditd $VERSION # 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 printf %s "checking build system type... " >&6; } if test ${ac_cv_build+y} then : printf %s "(cached) " >&6 else $as_nop 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 printf "%s\n" "$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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 printf %s "checking host system type... " >&6; } if test ${ac_cv_host+y} then : printf %s "(cached) " >&6 else $as_nop 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 printf "%s\n" "$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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 printf %s "checking target system type... " >&6; } if test ${ac_cv_target+y} then : printf %s "(cached) " >&6 else $as_nop 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 printf "%s\n" "$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.16' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 printf %s "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test ${ac_cv_path_install+y} then : printf %s "(cached) " >&6 else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac # Account for fact that we put trailing slashes in our PATH walk. case $as_dir in #(( ./ | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test ${ac_cv_path_install+y}; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 printf "%s\n" "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 printf %s "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`printf "%s\n" "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 printf "%s\n" "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_STRIP+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 printf "%s\n" "$STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_STRIP+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 printf "%s\n" "$ac_ct_STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a race-free mkdir -p" >&5 printf %s "checking for a race-free mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if test ${ac_cv_path_mkdir+y} then : printf %s "(cached) " >&6 else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext" || continue case `"$as_dir$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir ('*'coreutils) '* | \ 'BusyBox '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test ${ac_cv_path_mkdir+y}; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 printf "%s\n" "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AWK+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 printf "%s\n" "$AWK" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$AWK" && break done { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval test \${ac_cv_prog_make_${ac_make}_set+y} then : printf %s "(cached) " >&6 else $as_nop cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } SET_MAKE= else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test ${enable_silent_rules+y} then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 printf %s "checking whether $am_make supports nested variables... " >&6; } if test ${am_cv_make_support_nested_variables+y} then : printf %s "(cached) " >&6 else $as_nop if printf "%s\n" 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='audit' VERSION='4.0.2' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h printf "%s\n" "#define VERSION \"$VERSION\"" >>confdefs.h # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # Variables for tags utilities; see am/tags.am if test -z "$CTAGS"; then CTAGS=ctags fi if test -z "$ETAGS"; then ETAGS=etags fi if test -z "$CSCOPE"; then CSCOPE=cscope fi # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi case `pwd` in *\ * | *\ *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 printf "%s\n" "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.7' macro_revision='2.4.7' ltmain=$ac_aux_dir/ltmain.sh # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 printf %s "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case $ECHO in printf*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: printf" >&5 printf "%s\n" "printf" >&6; } ;; print*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 printf "%s\n" "print -r" >&6; } ;; *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: cat" >&5 printf "%s\n" "cat" >&6; } ;; esac DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 printf %s "checking whether ${MAKE-make} supports the include directive... " >&6; } cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } case $?:`cat confinc.out 2>/dev/null` in #( '0:this is the am__doit target') : case $s in #( BSD) : am__include='.include' am__quote='"' ;; #( *) : am__include='include' am__quote='' ;; esac ;; #( *) : ;; esac if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 printf "%s\n" "${_am_result}" >&6; } # Check whether --enable-dependency-tracking was given. if test ${enable_dependency_tracking+y} then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. set dummy ${ac_tool_prefix}clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "clang", so it can be a program name with args. set dummy clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi fi test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion -version; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 printf %s "checking whether the C compiler works... " >&6; } ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else $as_nop ac_file='' fi if test -z "$ac_file" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 printf %s "checking for C compiler default output file name... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 printf "%s\n" "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 printf %s "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else $as_nop { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 printf "%s\n" "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 printf %s "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 printf "%s\n" "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 printf %s "checking for suffix of object files... " >&6; } if test ${ac_cv_objext+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 printf "%s\n" "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 printf %s "checking whether the compiler supports GNU C... " >&6; } if test ${ac_cv_c_compiler_gnu+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes else $as_nop ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } ac_compiler_gnu=$ac_cv_c_compiler_gnu if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 printf %s "checking whether $CC accepts -g... " >&6; } if test ${ac_cv_prog_cc_g+y} then : printf %s "(cached) " >&6 else $as_nop ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes else $as_nop CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else $as_nop ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 printf "%s\n" "$ac_cv_prog_cc_g" >&6; } if test $ac_test_CFLAGS; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi ac_prog_cc_stdc=no if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 printf %s "checking for $CC option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c11_program _ACEOF for ac_arg in '' -std=gnu11 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c11=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } CC="$CC $ac_cv_prog_cc_c11" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 ac_prog_cc_stdc=c11 fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 printf %s "checking for $CC option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c99_program _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c99=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } CC="$CC $ac_cv_prog_cc_c99" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 ac_prog_cc_stdc=c99 fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 printf %s "checking for $CC option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c89_program _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } CC="$CC $ac_cv_prog_cc_c89" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 ac_prog_cc_stdc=c89 fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 printf %s "checking whether $CC understands -c and -o together... " >&6; } if test ${am_cv_prog_cc_c_o+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 printf %s "checking dependency style of $depcc... " >&6; } if test ${am_cv_CC_dependencies_compiler_type+y} then : printf %s "(cached) " >&6 else $as_nop if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 printf %s "checking for a sed that does not truncate output... " >&6; } if test ${ac_cv_path_SED+y} then : printf %s "(cached) " >&6 else $as_nop ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in sed gsed do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 printf "%s\n" "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 printf %s "checking for grep that handles long lines and -e... " >&6; } if test ${ac_cv_path_GREP+y} then : printf %s "(cached) " >&6 else $as_nop 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" '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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 printf "%s\n" "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 printf %s "checking for egrep... " >&6; } if test ${ac_cv_path_EGREP+y} then : printf %s "(cached) " >&6 else $as_nop 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" '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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 printf "%s\n" "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 printf %s "checking for fgrep... " >&6; } if test ${ac_cv_path_FGREP+y} then : printf %s "(cached) " >&6 else $as_nop if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in fgrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 printf "%s\n" "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test ${with_gnu_ld+y} then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else $as_nop with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 printf %s "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 printf %s "checking for GNU ld... " >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 printf %s "checking for non-GNU ld... " >&6; } fi if test ${lt_cv_path_LD+y} then : printf %s "(cached) " >&6 else $as_nop if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 printf "%s\n" "$LD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 printf %s "checking if the linker ($LD) is GNU ld... " >&6; } if test ${lt_cv_prog_gnu_ld+y} then : printf %s "(cached) " >&6 else $as_nop # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 printf "%s\n" "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 printf %s "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if test ${lt_cv_path_NM+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 printf "%s\n" "$lt_cv_path_NM" >&6; } if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_DUMPBIN+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 printf "%s\n" "$DUMPBIN" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_DUMPBIN+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 printf "%s\n" "$ac_ct_DUMPBIN" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 printf %s "checking the name lister ($NM) interface... " >&6; } if test ${lt_cv_nm_interface+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 printf "%s\n" "$lt_cv_nm_interface" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 printf %s "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 printf "%s\n" "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 printf %s "checking the maximum length of command line arguments... " >&6; } if test ${lt_cv_sys_max_cmd_len+y} then : printf %s "(cached) " >&6 else $as_nop i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n "$lt_cv_sys_max_cmd_len"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 printf "%s\n" "$lt_cv_sys_max_cmd_len" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5 printf "%s\n" "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 printf %s "checking how to convert $build file names to $host format... " >&6; } if test ${lt_cv_to_host_file_cmd+y} then : printf %s "(cached) " >&6 else $as_nop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 printf "%s\n" "$lt_cv_to_host_file_cmd" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 printf %s "checking how to convert $build file names to toolchain format... " >&6; } if test ${lt_cv_to_tool_file_cmd+y} then : printf %s "(cached) " >&6 else $as_nop #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 printf "%s\n" "$lt_cv_to_tool_file_cmd" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 printf %s "checking for $LD option to reload object files... " >&6; } if test ${lt_cv_ld_reload_flag+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_ld_reload_flag='-r' fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 printf "%s\n" "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test yes != "$GCC"; then reload_cmds=false fi ;; darwin*) if test yes = "$GCC"; then reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}file", so it can be a program name with args. set dummy ${ac_tool_prefix}file; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_FILECMD+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$FILECMD"; then ac_cv_prog_FILECMD="$FILECMD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_FILECMD="${ac_tool_prefix}file" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi FILECMD=$ac_cv_prog_FILECMD if test -n "$FILECMD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FILECMD" >&5 printf "%s\n" "$FILECMD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_FILECMD"; then ac_ct_FILECMD=$FILECMD # Extract the first word of "file", so it can be a program name with args. set dummy file; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_FILECMD+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_FILECMD"; then ac_cv_prog_ac_ct_FILECMD="$ac_ct_FILECMD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_FILECMD="file" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_FILECMD=$ac_cv_prog_ac_ct_FILECMD if test -n "$ac_ct_FILECMD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_FILECMD" >&5 printf "%s\n" "$ac_ct_FILECMD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_FILECMD" = x; then FILECMD=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac FILECMD=$ac_ct_FILECMD fi else FILECMD="$ac_cv_prog_FILECMD" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OBJDUMP+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 printf "%s\n" "$OBJDUMP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OBJDUMP+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 printf "%s\n" "$ac_ct_OBJDUMP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 printf %s "checking how to recognize dependent libraries... " >&6; } if test ${lt_cv_deplibs_check_method+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure # whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='$FILECMD -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly* | midnightbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=$FILECMD case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 printf "%s\n" "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_DLLTOOL+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 printf "%s\n" "$DLLTOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_DLLTOOL+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 printf "%s\n" "$ac_ct_DLLTOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 printf %s "checking how to associate runtime and link libraries... " >&6; } if test ${lt_cv_sharedlib_from_linklib_cmd+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 printf "%s\n" "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AR+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 printf "%s\n" "$AR" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_AR+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 printf "%s\n" "$ac_ct_AR" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} # Use ARFLAGS variable as AR's operation code to sync the variable naming with # Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have # higher priority because thats what people were doing historically (setting # ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS # variable obsoleted/removed. test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} lt_ar_flags=$AR_FLAGS # Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override # by AR_FLAGS because that was never working and AR_FLAGS is about to die. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 printf %s "checking for archiver @FILE support... " >&6; } if test ${lt_cv_ar_at_file+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 printf "%s\n" "$lt_cv_ar_at_file" >&6; } if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_STRIP+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 printf "%s\n" "$STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_STRIP+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 printf "%s\n" "$ac_ct_STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_RANLIB+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 printf "%s\n" "$RANLIB" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_RANLIB+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 printf "%s\n" "$ac_ct_RANLIB" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 printf %s "checking command to parse $NM output from $compiler object... " >&6; } if test ${lt_cv_sys_global_symbol_pipe+y} then : printf %s "(cached) " >&6 else $as_nop # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="$SED -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++ or ICC, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: failed" >&5 printf "%s\n" "failed" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ok" >&5 printf "%s\n" "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 printf %s "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test ${with_sysroot+y} then : withval=$with_sysroot; else $as_nop with_sysroot=no fi lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 printf "%s\n" "$with_sysroot" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 printf "%s\n" "${lt_sysroot:-no}" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 printf %s "checking for a working dd... " >&6; } if test ${ac_cv_path_lt_DD+y} then : printf %s "(cached) " >&6 else $as_nop printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} if test -z "$lt_DD"; then ac_path_lt_DD_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in dd do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_lt_DD="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_lt_DD" || continue if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi $ac_path_lt_DD_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_lt_DD"; then : fi else ac_cv_path_lt_DD=$lt_DD fi rm -f conftest.i conftest2.i conftest.out fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 printf "%s\n" "$ac_cv_path_lt_DD" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 printf %s "checking how to truncate binary pipes... " >&6; } if test ${lt_cv_truncate_bin+y} then : printf %s "(cached) " >&6 else $as_nop printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 printf "%s\n" "$lt_cv_truncate_bin" >&6; } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # Check whether --enable-libtool-lock was given. if test ${enable_libtool_lock+y} then : enableval=$enable_libtool_lock; fi test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `$FILECMD conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test yes = "$lt_cv_prog_gnu_ld"; then case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then emul=elf case `$FILECMD conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `$FILECMD conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `$FILECMD conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `$FILECMD conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `$FILECMD conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 printf %s "checking whether the C compiler needs -belf... " >&6; } if test ${lt_cv_cc_needs_belf+y} then : printf %s "(cached) " >&6 else $as_nop ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_cv_cc_needs_belf=yes else $as_nop lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 printf "%s\n" "$lt_cv_cc_needs_belf" >&6; } if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `$FILECMD conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_MANIFEST_TOOL+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 printf "%s\n" "$MANIFEST_TOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_MANIFEST_TOOL+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 printf "%s\n" "$ac_ct_MANIFEST_TOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 printf %s "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if test ${lt_cv_path_mainfest_tool+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 printf "%s\n" "$lt_cv_path_mainfest_tool" >&6; } if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_DSYMUTIL+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 printf "%s\n" "$DSYMUTIL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_DSYMUTIL+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 printf "%s\n" "$ac_ct_DSYMUTIL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_NMEDIT+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 printf "%s\n" "$NMEDIT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_NMEDIT+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 printf "%s\n" "$ac_ct_NMEDIT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_LIPO+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 printf "%s\n" "$LIPO" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_LIPO+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 printf "%s\n" "$ac_ct_LIPO" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OTOOL+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 printf "%s\n" "$OTOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OTOOL+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 printf "%s\n" "$ac_ct_OTOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OTOOL64+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 printf "%s\n" "$OTOOL64" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OTOOL64+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 printf "%s\n" "$ac_ct_OTOOL64" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 printf %s "checking for -single_module linker flag... " >&6; } if test ${lt_cv_apple_cc_single_mod+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 printf "%s\n" "$lt_cv_apple_cc_single_mod" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 printf %s "checking for -exported_symbols_list linker flag... " >&6; } if test ${lt_cv_ld_exported_symbols_list+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_cv_ld_exported_symbols_list=yes else $as_nop lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 printf "%s\n" "$lt_cv_ld_exported_symbols_list" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 printf %s "checking for -force_load linker flag... " >&6; } if test ${lt_cv_ld_force_load+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR $AR_FLAGS libconftest.a conftest.o" >&5 $AR $AR_FLAGS libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 printf "%s\n" "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) case $MACOSX_DEPLOYMENT_TARGET,$host in 10.[012],*|,*powerpc*-darwin[5-8]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; *) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } ac_header= ac_cache= for ac_item in $ac_header_c_list do if test $ac_cache; then ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then printf "%s\n" "#define $ac_item 1" >> confdefs.h fi ac_header= ac_cache= elif test $ac_header; then ac_cache=$ac_item else ac_header=$ac_item fi done if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes then : printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes then : printf "%s\n" "#define HAVE_DLFCN_H 1" >>confdefs.h fi # Set options enable_dlopen=no enable_win32_dll=no # Check whether --enable-shared was given. if test ${enable_shared+y} then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS=$lt_save_ifs ;; esac else $as_nop enable_shared=yes fi # Check whether --enable-static was given. if test ${enable_static+y} then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS=$lt_save_ifs ;; esac else $as_nop enable_static=yes fi # Check whether --with-pic was given. if test ${with_pic+y} then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac else $as_nop pic_mode=default fi # Check whether --enable-fast-install was given. if test ${enable_fast_install+y} then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS=$lt_save_ifs ;; esac else $as_nop enable_fast_install=yes fi shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[5-9]*,yes) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 printf %s "checking which variant of shared library versioning to provide... " >&6; } # Check whether --with-aix-soname was given. if test ${with_aix_soname+y} then : withval=$with_aix_soname; case $withval in aix|svr4|both) ;; *) as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 ;; esac lt_cv_with_aix_soname=$with_aix_soname else $as_nop if test ${lt_cv_with_aix_soname+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_with_aix_soname=aix fi with_aix_soname=$lt_cv_with_aix_soname fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 printf "%s\n" "$with_aix_soname" >&6; } if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 printf %s "checking for objdir... " >&6; } if test ${lt_cv_objdir+y} then : printf %s "(cached) " >&6 else $as_nop rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 printf "%s\n" "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir printf "%s\n" "#define LT_OBJDIR \"$lt_cv_objdir/\"" >>confdefs.h case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC and # ICC, which need '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o func_cc_basename $compiler cc_basename=$func_cc_basename_result # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 printf %s "checking for ${ac_tool_prefix}file... " >&6; } if test ${lt_cv_path_MAGIC_CMD+y} then : printf %s "(cached) " >&6 else $as_nop case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/${ac_tool_prefix}file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 printf "%s\n" "$MAGIC_CMD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for file" >&5 printf %s "checking for file... " >&6; } if test ${lt_cv_path_MAGIC_CMD+y} then : printf %s "(cached) " >&6 else $as_nop case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 printf "%s\n" "$MAGIC_CMD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC=$CC ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test yes = "$GCC"; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 printf %s "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if test ${lt_cv_prog_compiler_rtti_exceptions+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 printf "%s\n" "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test yes = "$GCC"; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi lt_prog_compiler_pic='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; esac ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | $SED 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 printf %s "checking for $compiler option to produce PIC... " >&6; } if test ${lt_cv_prog_compiler_pic+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if test ${lt_cv_prog_compiler_pic_works+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic_works" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works"; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if test ${lt_cv_prog_compiler_static_works+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_prog_compiler_static_works=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 printf "%s\n" "$lt_cv_prog_compiler_static_works" >&6; } if test yes = "$lt_cv_prog_compiler_static_works"; then : else lt_prog_compiler_static= fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test ${lt_cv_prog_compiler_c_o+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test ${lt_cv_prog_compiler_c_o+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 printf %s "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 printf "%s\n" "$hard_links" >&6; } if test no = "$hard_links"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 printf "%s\n" "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ' (' and ')$', so one must not match beginning or # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', # as well as any symbol that contains 'd'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++ or Intel C++ Compiler. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' export_dynamic_flag_spec='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='$wl--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs=yes ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes file_list_spec='@' ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) export_dynamic_flag_spec='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test no = "$ld_shlibs"; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct=no hardcode_direct_absolute=no ;; esac if test yes = "$GCC"; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if test ${lt_cv_aix_libpath_+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if test ${lt_cv_aix_libpath_+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' $wl-bernotok' allow_undefined_flag=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++ or Intel C++ Compiler. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl* | icl*) # Native MSVC or ICC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC and ICC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test yes = "$lt_cv_ld_force_load"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" archive_expsym_cmds="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" module_expsym_cmds="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly* | midnightbsd*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test yes = "$GCC"; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 printf %s "checking if $CC understands -b... " >&6; } if test ${lt_cv_prog_compiler__b+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_prog_compiler__b=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 printf "%s\n" "$lt_cv_prog_compiler__b" >&6; } if test yes = "$lt_cv_prog_compiler__b"; then archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 printf %s "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if test ${lt_cv_irix_exported_symbol+y} then : printf %s "(cached) " >&6 else $as_nop save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_cv_irix_exported_symbol=yes else $as_nop lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; } if test yes = "$lt_cv_irix_exported_symbol"; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler ld_shlibs=yes archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' else archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='$wl-rpath,$libdir' fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes file_list_spec='@' ;; osf3*) if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test yes = "$GCC"; then wlarc='$wl' archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; then whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='$wl-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='$wl-z,text' allow_undefined_flag='$wl-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='$wl-Blargedynsym' ;; esac fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 printf "%s\n" "$ld_shlibs" >&6; } test no = "$ld_shlibs" && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 printf %s "checking whether -lc should be explicitly linked in... " >&6; } if test ${lt_cv_archive_cmds_need_lc+y} then : printf %s "(cached) " >&6 else $as_nop $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 printf "%s\n" "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 printf %s "checking dynamic linker characteristics... " >&6; } if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([A-Za-z]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl* | *,icl*) # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly* | midnightbsd*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. hardcode_libdir_flag_spec='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if test ${lt_cv_shlibpath_overrides_runpath+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Add ABI-specific directories to the system library path. sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 printf "%s\n" "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 printf %s "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test yes = "$hardcode_automatic"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && test no != "$hardcode_minus_L"; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 printf "%s\n" "$hardcode_action" >&6; } if test relink = "$hardcode_action" || test yes = "$inherit_rpath"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 printf %s "checking for dlopen in -ldl... " >&6; } if test ${ac_cv_lib_dl_dlopen+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char dlopen (); int main (void) { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dl_dlopen=yes else $as_nop ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else $as_nop lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes then : lt_cv_dlopen=shl_load else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 printf %s "checking for shl_load in -ldld... " >&6; } if test ${ac_cv_lib_dld_shl_load+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char shl_load (); int main (void) { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dld_shl_load=yes else $as_nop ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 printf "%s\n" "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes then : lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld else $as_nop ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes then : lt_cv_dlopen=dlopen else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 printf %s "checking for dlopen in -ldl... " >&6; } if test ${ac_cv_lib_dl_dlopen+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char dlopen (); int main (void) { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dl_dlopen=yes else $as_nop ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 printf %s "checking for dlopen in -lsvld... " >&6; } if test ${ac_cv_lib_svld_dlopen+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char dlopen (); int main (void) { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_svld_dlopen=yes else $as_nop ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 printf "%s\n" "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 printf %s "checking for dld_link in -ldld... " >&6; } if test ${ac_cv_lib_dld_dld_link+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char dld_link (); int main (void) { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dld_dld_link=yes else $as_nop ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 printf "%s\n" "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes then : lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld fi fi fi fi fi fi ;; esac if test no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 printf %s "checking whether a program can dlopen itself... " >&6; } if test ${lt_cv_dlopen_self+y} then : printf %s "(cached) " >&6 else $as_nop if test yes = "$cross_compiling"; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 printf "%s\n" "$lt_cv_dlopen_self" >&6; } if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 printf %s "checking whether a statically linked program can dlopen itself... " >&6; } if test ${lt_cv_dlopen_self_static+y} then : printf %s "(cached) " >&6 else $as_nop if test yes = "$cross_compiling"; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 printf "%s\n" "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 printf %s "checking whether stripping libraries is possible... " >&6; } if test -z "$STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } else if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then old_striplib="$STRIP --strip-debug" striplib="$STRIP --strip-unneeded" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else case $host_os in darwin*) # FIXME - insert some real tests, host_os isn't really good enough striplib="$STRIP -x" old_striplib="$STRIP -S" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } ;; freebsd*) if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then old_striplib="$STRIP --strip-debug" striplib="$STRIP --strip-unneeded" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi ;; *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } ;; esac fi fi # Report what library types will actually be built { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 printf %s "checking if libtool supports shared libraries... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 printf "%s\n" "$can_build_shared" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 printf %s "checking whether to build shared libraries... " >&6; } test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 printf "%s\n" "$enable_shared" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 printf %s "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 printf "%s\n" "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC=$lt_save_CC ac_config_commands="$ac_config_commands libtool" # Only expand once: OLDLIBS="$LIBS" ac_fn_c_check_header_compile "$LINENO" "sys/inotify.h" "ac_cv_header_sys_inotify_h" "$ac_includes_default" if test "x$ac_cv_header_sys_inotify_h" = xyes then : printf "%s\n" "#define HAVE_SYS_INOTIFY_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/epoll.h" "ac_cv_header_sys_epoll_h" "$ac_includes_default" if test "x$ac_cv_header_sys_epoll_h" = xyes then : printf "%s\n" "#define HAVE_SYS_EPOLL_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/event.h" "ac_cv_header_sys_event_h" "$ac_includes_default" if test "x$ac_cv_header_sys_event_h" = xyes then : printf "%s\n" "#define HAVE_SYS_EVENT_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "port.h" "ac_cv_header_port_h" "$ac_includes_default" if test "x$ac_cv_header_port_h" = xyes then : printf "%s\n" "#define HAVE_PORT_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "poll.h" "ac_cv_header_poll_h" "$ac_includes_default" if test "x$ac_cv_header_poll_h" = xyes then : printf "%s\n" "#define HAVE_POLL_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/timerfd.h" "ac_cv_header_sys_timerfd_h" "$ac_includes_default" if test "x$ac_cv_header_sys_timerfd_h" = xyes then : printf "%s\n" "#define HAVE_SYS_TIMERFD_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/select.h" "ac_cv_header_sys_select_h" "$ac_includes_default" if test "x$ac_cv_header_sys_select_h" = xyes then : printf "%s\n" "#define HAVE_SYS_SELECT_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/eventfd.h" "ac_cv_header_sys_eventfd_h" "$ac_includes_default" if test "x$ac_cv_header_sys_eventfd_h" = xyes then : printf "%s\n" "#define HAVE_SYS_EVENTFD_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/signalfd.h" "ac_cv_header_sys_signalfd_h" "$ac_includes_default" if test "x$ac_cv_header_sys_signalfd_h" = xyes then : printf "%s\n" "#define HAVE_SYS_SIGNALFD_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "linux/aio_abi.h" "ac_cv_header_linux_aio_abi_h" "$ac_includes_default" if test "x$ac_cv_header_linux_aio_abi_h" = xyes then : printf "%s\n" "#define HAVE_LINUX_AIO_ABI_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "linux/fs.h" "ac_cv_header_linux_fs_h" "$ac_includes_default" if test "x$ac_cv_header_linux_fs_h" = xyes then : printf "%s\n" "#define HAVE_LINUX_FS_H 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "inotify_init" "ac_cv_func_inotify_init" if test "x$ac_cv_func_inotify_init" = xyes then : printf "%s\n" "#define HAVE_INOTIFY_INIT 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "epoll_ctl" "ac_cv_func_epoll_ctl" if test "x$ac_cv_func_epoll_ctl" = xyes then : printf "%s\n" "#define HAVE_EPOLL_CTL 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "kqueue" "ac_cv_func_kqueue" if test "x$ac_cv_func_kqueue" = xyes then : printf "%s\n" "#define HAVE_KQUEUE 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "port_create" "ac_cv_func_port_create" if test "x$ac_cv_func_port_create" = xyes then : printf "%s\n" "#define HAVE_PORT_CREATE 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "poll" "ac_cv_func_poll" if test "x$ac_cv_func_poll" = xyes then : printf "%s\n" "#define HAVE_POLL 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "select" "ac_cv_func_select" if test "x$ac_cv_func_select" = xyes then : printf "%s\n" "#define HAVE_SELECT 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "eventfd" "ac_cv_func_eventfd" if test "x$ac_cv_func_eventfd" = xyes then : printf "%s\n" "#define HAVE_EVENTFD 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "signalfd" "ac_cv_func_signalfd" if test "x$ac_cv_func_signalfd" = xyes then : printf "%s\n" "#define HAVE_SIGNALFD 1" >>confdefs.h fi for ac_func in clock_gettime do : ac_fn_c_check_func "$LINENO" "clock_gettime" "ac_cv_func_clock_gettime" if test "x$ac_cv_func_clock_gettime" = xyes then : printf "%s\n" "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h else $as_nop if test $(uname) = Linux; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for clock_gettime syscall" >&5 printf %s "checking for clock_gettime syscall... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main (void) { struct timespec ts; int status = syscall (SYS_clock_gettime, CLOCK_REALTIME, &ts) ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_have_clock_syscall=1 printf "%s\n" "#define HAVE_CLOCK_SYSCALL 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi if test -z "$LIBEV_M4_AVOID_LIBRT" && test -z "$ac_have_clock_syscall"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5 printf %s "checking for clock_gettime in -lrt... " >&6; } if test ${ac_cv_lib_rt_clock_gettime+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lrt $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char clock_gettime (); int main (void) { return clock_gettime (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_rt_clock_gettime=yes else $as_nop ac_cv_lib_rt_clock_gettime=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5 printf "%s\n" "$ac_cv_lib_rt_clock_gettime" >&6; } if test "x$ac_cv_lib_rt_clock_gettime" = xyes then : printf "%s\n" "#define HAVE_LIBRT 1" >>confdefs.h LIBS="-lrt $LIBS" fi unset ac_cv_func_clock_gettime ac_fn_c_check_func "$LINENO" "clock_gettime" "ac_cv_func_clock_gettime" if test "x$ac_cv_func_clock_gettime" = xyes then : printf "%s\n" "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h fi fi fi done for ac_func in nanosleep do : ac_fn_c_check_func "$LINENO" "nanosleep" "ac_cv_func_nanosleep" if test "x$ac_cv_func_nanosleep" = xyes then : printf "%s\n" "#define HAVE_NANOSLEEP 1" >>confdefs.h else $as_nop if test -z "$LIBEV_M4_AVOID_LIBRT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for nanosleep in -lrt" >&5 printf %s "checking for nanosleep in -lrt... " >&6; } if test ${ac_cv_lib_rt_nanosleep+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lrt $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char nanosleep (); int main (void) { return nanosleep (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_rt_nanosleep=yes else $as_nop ac_cv_lib_rt_nanosleep=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_nanosleep" >&5 printf "%s\n" "$ac_cv_lib_rt_nanosleep" >&6; } if test "x$ac_cv_lib_rt_nanosleep" = xyes then : printf "%s\n" "#define HAVE_LIBRT 1" >>confdefs.h LIBS="-lrt $LIBS" fi unset ac_cv_func_nanosleep ac_fn_c_check_func "$LINENO" "nanosleep" "ac_cv_func_nanosleep" if test "x$ac_cv_func_nanosleep" = xyes then : printf "%s\n" "#define HAVE_NANOSLEEP 1" >>confdefs.h fi fi fi done ac_fn_c_check_type "$LINENO" "__kernel_rwf_t" "ac_cv_type___kernel_rwf_t" "#include " if test "x$ac_cv_type___kernel_rwf_t" = xyes then : printf "%s\n" "#define HAVE_KERNEL_RWF_T 1" >>confdefs.h fi if test -z "$LIBEV_M4_AVOID_LIBM"; then LIBM=m fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing floor" >&5 printf %s "checking for library containing floor... " >&6; } if test ${ac_cv_search_floor+y} then : printf %s "(cached) " >&6 else $as_nop ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char floor (); int main (void) { return floor (); ; return 0; } _ACEOF for ac_lib in '' $LIBM 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_floor=$ac_res fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext if test ${ac_cv_search_floor+y} then : break fi done if test ${ac_cv_search_floor+y} then : else $as_nop ac_cv_search_floor=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_floor" >&5 printf "%s\n" "$ac_cv_search_floor" >&6; } ac_res=$ac_cv_search_floor if test "$ac_res" != no then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" printf "%s\n" "#define HAVE_FLOOR 1" >>confdefs.h fi libev_LIBS="$LIBS" LIBS="$OLDLIBS" echo . echo Checking for programs ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. set dummy ${ac_tool_prefix}clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "clang", so it can be a program name with args. set dummy clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi fi test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion -version; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 printf %s "checking whether the compiler supports GNU C... " >&6; } if test ${ac_cv_c_compiler_gnu+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes else $as_nop ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } ac_compiler_gnu=$ac_cv_c_compiler_gnu if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 printf %s "checking whether $CC accepts -g... " >&6; } if test ${ac_cv_prog_cc_g+y} then : printf %s "(cached) " >&6 else $as_nop ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes else $as_nop CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else $as_nop ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 printf "%s\n" "$ac_cv_prog_cc_g" >&6; } if test $ac_test_CFLAGS; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi ac_prog_cc_stdc=no if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 printf %s "checking for $CC option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c11_program _ACEOF for ac_arg in '' -std=gnu11 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c11=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } CC="$CC $ac_cv_prog_cc_c11" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 ac_prog_cc_stdc=c11 fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 printf %s "checking for $CC option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c99_program _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c99=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } CC="$CC $ac_cv_prog_cc_c99" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 ac_prog_cc_stdc=c99 fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 printf %s "checking for $CC option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c89_program _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } CC="$CC $ac_cv_prog_cc_c89" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 ac_prog_cc_stdc=c89 fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 printf %s "checking whether $CC understands -c and -o together... " >&6; } if test ${am_cv_prog_cc_c_o+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 printf %s "checking dependency style of $depcc... " >&6; } if test ${am_cv_CC_dependencies_compiler_type+y} then : printf %s "(cached) " >&6 else $as_nop if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AWK+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 printf "%s\n" "$AWK" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$AWK" && break done ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 printf %s "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 test ${ac_cv_prog_CPP+y} then : printf %s "(cached) " >&6 else $as_nop # Double quotes because $CC needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" 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. # 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. */ #include Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO" then : else $as_nop # 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 $as_nop # 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 printf "%s\n" "$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. # 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. */ #include Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO" then : else $as_nop # 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 $as_nop # 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_nop { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "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 save_cross_compiling=$cross_compiling save_ac_tool_prefix=$ac_tool_prefix cross_compiling=no ac_tool_prefix= ac_ext=c ac_build_cpp='$CPP_FOR_BUILD $CPPFLAGS_FOR_BUILD' ac_build_compile='$CC_FOR_BUILD -c $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' ac_build_link='$CC_FOR_BUILD -o conftest$ac_build_exeext $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC_FOR_BUILD+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC_FOR_BUILD"; then ac_cv_prog_CC_FOR_BUILD="$CC_FOR_BUILD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC_FOR_BUILD="${ac_tool_prefix}gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC_FOR_BUILD=$ac_cv_prog_CC_FOR_BUILD if test -n "$CC_FOR_BUILD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC_FOR_BUILD" >&5 printf "%s\n" "$CC_FOR_BUILD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC_FOR_BUILD"; then ac_ct_CC_FOR_BUILD=$CC_FOR_BUILD # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC_FOR_BUILD+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_CC_FOR_BUILD"; then ac_cv_prog_ac_ct_CC_FOR_BUILD="$ac_ct_CC_FOR_BUILD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC_FOR_BUILD="gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC_FOR_BUILD=$ac_cv_prog_ac_ct_CC_FOR_BUILD if test -n "$ac_ct_CC_FOR_BUILD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC_FOR_BUILD" >&5 printf "%s\n" "$ac_ct_CC_FOR_BUILD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC_FOR_BUILD" = x; then CC_FOR_BUILD="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with build triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with build triplet" >&2;} ac_tool_warned=yes ;; esac CC_FOR_BUILD=$ac_ct_CC_FOR_BUILD fi else CC_FOR_BUILD="$ac_cv_prog_CC_FOR_BUILD" fi if test -z "$CC_FOR_BUILD"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC_FOR_BUILD+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC_FOR_BUILD"; then ac_cv_prog_CC_FOR_BUILD="$CC_FOR_BUILD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC_FOR_BUILD="${ac_tool_prefix}cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC_FOR_BUILD=$ac_cv_prog_CC_FOR_BUILD if test -n "$CC_FOR_BUILD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC_FOR_BUILD" >&5 printf "%s\n" "$CC_FOR_BUILD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi fi if test -z "$CC_FOR_BUILD"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC_FOR_BUILD+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC_FOR_BUILD"; then ac_cv_prog_CC_FOR_BUILD="$CC_FOR_BUILD" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC_FOR_BUILD="cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC_FOR_BUILD 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_FOR_BUILD to just the basename; use the full file name. shift ac_cv_prog_CC_FOR_BUILD="$as_dir$ac_word${1+' '}$@" fi fi fi fi CC_FOR_BUILD=$ac_cv_prog_CC_FOR_BUILD if test -n "$CC_FOR_BUILD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC_FOR_BUILD" >&5 printf "%s\n" "$CC_FOR_BUILD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$CC_FOR_BUILD"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC_FOR_BUILD+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC_FOR_BUILD"; then ac_cv_prog_CC_FOR_BUILD="$CC_FOR_BUILD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC_FOR_BUILD="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC_FOR_BUILD=$ac_cv_prog_CC_FOR_BUILD if test -n "$CC_FOR_BUILD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC_FOR_BUILD" >&5 printf "%s\n" "$CC_FOR_BUILD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$CC_FOR_BUILD" && break done fi if test -z "$CC_FOR_BUILD"; then ac_ct_CC_FOR_BUILD=$CC_FOR_BUILD for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC_FOR_BUILD+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_CC_FOR_BUILD"; then ac_cv_prog_ac_ct_CC_FOR_BUILD="$ac_ct_CC_FOR_BUILD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC_FOR_BUILD="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC_FOR_BUILD=$ac_cv_prog_ac_ct_CC_FOR_BUILD if test -n "$ac_ct_CC_FOR_BUILD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC_FOR_BUILD" >&5 printf "%s\n" "$ac_ct_CC_FOR_BUILD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_CC_FOR_BUILD" && break done if test "x$ac_ct_CC_FOR_BUILD" = x; then CC_FOR_BUILD="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with build triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with build triplet" >&2;} ac_tool_warned=yes ;; esac CC_FOR_BUILD=$ac_ct_CC_FOR_BUILD fi fi fi if test -z "$CC_FOR_BUILD"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. set dummy ${ac_tool_prefix}clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC_FOR_BUILD+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC_FOR_BUILD"; then ac_cv_prog_CC_FOR_BUILD="$CC_FOR_BUILD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC_FOR_BUILD="${ac_tool_prefix}clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC_FOR_BUILD=$ac_cv_prog_CC_FOR_BUILD if test -n "$CC_FOR_BUILD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC_FOR_BUILD" >&5 printf "%s\n" "$CC_FOR_BUILD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC_FOR_BUILD"; then ac_ct_CC_FOR_BUILD=$CC_FOR_BUILD # Extract the first word of "clang", so it can be a program name with args. set dummy clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC_FOR_BUILD+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_CC_FOR_BUILD"; then ac_cv_prog_ac_ct_CC_FOR_BUILD="$ac_ct_CC_FOR_BUILD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC_FOR_BUILD="clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC_FOR_BUILD=$ac_cv_prog_ac_ct_CC_FOR_BUILD if test -n "$ac_ct_CC_FOR_BUILD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC_FOR_BUILD" >&5 printf "%s\n" "$ac_ct_CC_FOR_BUILD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC_FOR_BUILD" = x; then CC_FOR_BUILD="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with build triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with build triplet" >&2;} ac_tool_warned=yes ;; esac CC_FOR_BUILD=$ac_ct_CC_FOR_BUILD fi else CC_FOR_BUILD="$ac_cv_prog_CC_FOR_BUILD" fi fi test -z "$CC_FOR_BUILD" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_build_compile ac_compiler=$2 for ac_option in --version -v -V -qversion -version; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 printf %s "checking whether the compiler supports GNU C... " >&6; } if test ${ac_cv_c_compiler_gnu+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes else $as_nop ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_build_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } ac_compiler_gnu=$ac_cv_c_compiler_gnu if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS_FOR_BUILD+y} ac_save_CFLAGS=$CFLAGS_FOR_BUILD { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD accepts -g" >&5 printf %s "checking whether $CC_FOR_BUILD accepts -g... " >&6; } if test ${ac_cv_build_prog_cc_g+y} then : printf %s "(cached) " >&6 else $as_nop ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_build_prog_cc_g=no CFLAGS_FOR_BUILD="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_build_prog_cc_g=yes else $as_nop CFLAGS_FOR_BUILD="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else $as_nop ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS_FOR_BUILD="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_build_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_build_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_build_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_build_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build_prog_cc_g" >&5 printf "%s\n" "$ac_cv_build_prog_cc_g" >&6; } if test $ac_test_CFLAGS; then CFLAGS_FOR_BUILD=$ac_save_CFLAGS elif test $ac_cv_build_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS_FOR_BUILD="-g -O2" else CFLAGS_FOR_BUILD="-g" fi else if test "$GCC" = yes; then CFLAGS_FOR_BUILD="-O2" else CFLAGS_FOR_BUILD= fi fi ac_prog_cc_stdc=no if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC_FOR_BUILD option to enable C11 features" >&5 printf %s "checking for $CC_FOR_BUILD option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c11=no ac_save_CC=$CC_FOR_BUILD cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c11_program _ACEOF for ac_arg in '' -std=gnu11 do CC_FOR_BUILD="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c11=$ac_arg fi rm -f core conftest.err conftest.$ac_build_objext conftest.beam test "x$ac_cv_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext CC_FOR_BUILD=$ac_save_CC fi if test "x$ac_cv_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } CC_FOR_BUILD="$CC_FOR_BUILD $ac_cv_prog_cc_c11" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 ac_prog_cc_stdc=c11 fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC_FOR_BUILD option to enable C99 features" >&5 printf %s "checking for $CC_FOR_BUILD option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c99=no ac_save_CC=$CC_FOR_BUILD cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c99_program _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= do CC_FOR_BUILD="$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_build_objext conftest.beam test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC_FOR_BUILD=$ac_save_CC fi if test "x$ac_cv_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } CC_FOR_BUILD="$CC_FOR_BUILD $ac_cv_prog_cc_c99" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 ac_prog_cc_stdc=c99 fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC_FOR_BUILD option to enable C89 features" >&5 printf %s "checking for $CC_FOR_BUILD option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c89=no ac_save_CC=$CC_FOR_BUILD cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c89_program _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC_FOR_BUILD="$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_build_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC_FOR_BUILD=$ac_save_CC fi if test "x$ac_cv_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } CC_FOR_BUILD="$CC_FOR_BUILD $ac_cv_prog_cc_c89" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 ac_prog_cc_stdc=c89 fi fi ac_ext=c ac_build_cpp='$CPP_FOR_BUILD $CPPFLAGS_FOR_BUILD' ac_build_compile='$CC_FOR_BUILD -c $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' ac_build_link='$CC_FOR_BUILD -o conftest$ac_build_exeext $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_build_cpp='$CPP_FOR_BUILD $CPPFLAGS_FOR_BUILD' ac_build_compile='$CC_FOR_BUILD -c $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' ac_build_link='$CC_FOR_BUILD -o conftest$ac_build_exeext $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD understands -c and -o together" >&5 printf %s "checking whether $CC_FOR_BUILD understands -c and -o together... " >&6; } if test ${am_cv_prog_cc_c_o+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC_FOR_BUILD -c conftest.$ac_ext -o conftest2.$ac_build_objext" >&5 ($CC_FOR_BUILD -c conftest.$ac_ext -o conftest2.$ac_build_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_build_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC_FOR_BUILD="$am_aux_dir/compile $CC_FOR_BUILD" fi ac_ext=c ac_build_cpp='$CPP_FOR_BUILD $CPPFLAGS_FOR_BUILD' ac_build_compile='$CC_FOR_BUILD -c $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' ac_build_link='$CC_FOR_BUILD -o conftest$ac_build_exeext $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC_FOR_BUILD" am_compiler_list= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 printf %s "checking dependency style of $depcc... " >&6; } if test ${am_cv_CC_dependencies_compiler_type+y} then : printf %s "(cached) " >&6 else $as_nop if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_ext=c ac_build_cpp='$CPP_FOR_BUILD $CPPFLAGS_FOR_BUILD' ac_build_compile='$CC_FOR_BUILD -c $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' ac_build_link='$CC_FOR_BUILD -o conftest$ac_build_exeext $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 printf %s "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP_FOR_BUILD" && test -d "$CPP_FOR_BUILD"; then CPP_FOR_BUILD= fi if test -z "$CPP_FOR_BUILD"; then if test ${ac_cv_build_prog_CPP+y} then : printf %s "(cached) " >&6 else $as_nop # Double quotes because $CC needs to be expanded for CPP_FOR_BUILD in "$CC_FOR_BUILD -E" "$CC_FOR_BUILD -E -traditional-cpp" 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. # 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. */ #include Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO" then : else $as_nop # 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 $as_nop # 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_build_prog_CPP=$CPP_FOR_BUILD fi CPP_FOR_BUILD=$ac_cv_build_prog_CPP else ac_cv_build_prog_CPP=$CPP_FOR_BUILD fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP_FOR_BUILD" >&5 printf "%s\n" "$CPP_FOR_BUILD" >&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. # 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. */ #include Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO" then : else $as_nop # 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 $as_nop # 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_nop { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP_FOR_BUILD\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_build_cpp='$CPP_FOR_BUILD $CPPFLAGS_FOR_BUILD' ac_build_compile='$CC_FOR_BUILD -c $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' ac_build_link='$CC_FOR_BUILD -o conftest$ac_build_exeext $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_tool_prefix=$save_ac_tool_prefix cross_compiling=$save_cross_compiling BUILD_EXEEXT=$ac_build_exeext BUILD_OBJEXT=$ac_build_objext echo . echo Checking for header files # 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. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of unsigned int" >&5 printf %s "checking size of unsigned int... " >&6; } if test ${ac_cv_sizeof_unsigned_int+y} then : printf %s "(cached) " >&6 else $as_nop if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned int))" "ac_cv_sizeof_unsigned_int" "$ac_includes_default" then : else $as_nop if test "$ac_cv_type_unsigned_int" = yes; then { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (unsigned int) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_unsigned_int=0 fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_int" >&5 printf "%s\n" "$ac_cv_sizeof_unsigned_int" >&6; } printf "%s\n" "#define SIZEOF_UNSIGNED_INT $ac_cv_sizeof_unsigned_int" >>confdefs.h # 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. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of unsigned long" >&5 printf %s "checking size of unsigned long... " >&6; } if test ${ac_cv_sizeof_unsigned_long+y} then : printf %s "(cached) " >&6 else $as_nop if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned long))" "ac_cv_sizeof_unsigned_long" "$ac_includes_default" then : else $as_nop if test "$ac_cv_type_unsigned_long" = yes; then { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (unsigned long) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_unsigned_long=0 fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_long" >&5 printf "%s\n" "$ac_cv_sizeof_unsigned_long" >&6; } printf "%s\n" "#define SIZEOF_UNSIGNED_LONG $ac_cv_sizeof_unsigned_long" >>confdefs.h # 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. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 printf %s "checking size of long... " >&6; } if test ${ac_cv_sizeof_long+y} then : printf %s "(cached) " >&6 else $as_nop if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default" then : else $as_nop if test "$ac_cv_type_long" = yes; then { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long=0 fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 printf "%s\n" "$ac_cv_sizeof_long" >&6; } printf "%s\n" "#define SIZEOF_LONG $ac_cv_sizeof_long" >>confdefs.h # 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. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of time_t" >&5 printf %s "checking size of time_t... " >&6; } if test ${ac_cv_sizeof_time_t+y} then : printf %s "(cached) " >&6 else $as_nop if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (time_t))" "ac_cv_sizeof_time_t" "$ac_includes_default" then : else $as_nop if test "$ac_cv_type_time_t" = yes; then { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (time_t) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_time_t=0 fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_time_t" >&5 printf "%s\n" "$ac_cv_sizeof_time_t" >&6; } printf "%s\n" "#define SIZEOF_TIME_T $ac_cv_sizeof_time_t" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC options needed to detect all undeclared functions" >&5 printf %s "checking for $CC options needed to detect all undeclared functions... " >&6; } if test ${ac_cv_c_undeclared_builtin_options+y} then : printf %s "(cached) " >&6 else $as_nop ac_save_CFLAGS=$CFLAGS ac_cv_c_undeclared_builtin_options='cannot detect' for ac_arg in '' -fno-builtin; do CFLAGS="$ac_save_CFLAGS $ac_arg" # This test program should *not* compile successfully. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { (void) strchr; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else $as_nop # This test program should compile successfully. # No library function is consistently available on # freestanding implementations, so test against a dummy # declaration. Include always-available headers on the # off chance that they somehow elicit warnings. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include extern void ac_decl (int, char *); int main (void) { (void) ac_decl (0, (char *) 0); (void) ac_decl; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : if test x"$ac_arg" = x then : ac_cv_c_undeclared_builtin_options='none needed' else $as_nop ac_cv_c_undeclared_builtin_options=$ac_arg fi break fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done CFLAGS=$ac_save_CFLAGS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_undeclared_builtin_options" >&5 printf "%s\n" "$ac_cv_c_undeclared_builtin_options" >&6; } case $ac_cv_c_undeclared_builtin_options in #( 'cannot detect') : { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot make $CC report undeclared builtins See \`config.log' for more details" "$LINENO" 5; } ;; #( 'none needed') : ac_c_undeclared_builtin_options='' ;; #( *) : ac_c_undeclared_builtin_options=$ac_cv_c_undeclared_builtin_options ;; esac ac_fn_check_decl "$LINENO" "AUDIT_FEATURE_VERSION" "ac_cv_have_decl_AUDIT_FEATURE_VERSION" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_AUDIT_FEATURE_VERSION" = xyes then : ac_have_decl=1 else $as_nop ac_have_decl=0 fi printf "%s\n" "#define HAVE_DECL_AUDIT_FEATURE_VERSION $ac_have_decl" >>confdefs.h ac_fn_c_check_member "$LINENO" "struct audit_status" "feature_bitmap" "ac_cv_member_struct_audit_status_feature_bitmap" "#include " if test "x$ac_cv_member_struct_audit_status_feature_bitmap" = xyes then : printf "%s\n" "#define HAVE_STRUCT_AUDIT_STATUS_FEATURE_BITMAP 1" >>confdefs.h fi ac_fn_check_decl "$LINENO" "AUDIT_VERSION_BACKLOG_WAIT_TIME" "ac_cv_have_decl_AUDIT_VERSION_BACKLOG_WAIT_TIME" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_AUDIT_VERSION_BACKLOG_WAIT_TIME" = xyes then : ac_have_decl=1 else $as_nop ac_have_decl=0 fi printf "%s\n" "#define HAVE_DECL_AUDIT_VERSION_BACKLOG_WAIT_TIME $ac_have_decl" >>confdefs.h ac_fn_check_decl "$LINENO" "AUDIT_STATUS_BACKLOG_WAIT_TIME" "ac_cv_have_decl_AUDIT_STATUS_BACKLOG_WAIT_TIME" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_AUDIT_STATUS_BACKLOG_WAIT_TIME" = xyes then : ac_have_decl=1 else $as_nop ac_have_decl=0 fi printf "%s\n" "#define HAVE_DECL_AUDIT_STATUS_BACKLOG_WAIT_TIME $ac_have_decl" >>confdefs.h ac_fn_check_decl "$LINENO" "AUDIT_STATUS_BACKLOG_WAIT_TIME_ACTUAL" "ac_cv_have_decl_AUDIT_STATUS_BACKLOG_WAIT_TIME_ACTUAL" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_AUDIT_STATUS_BACKLOG_WAIT_TIME_ACTUAL" = xyes then : ac_have_decl=1 else $as_nop ac_have_decl=0 fi printf "%s\n" "#define HAVE_DECL_AUDIT_STATUS_BACKLOG_WAIT_TIME_ACTUAL $ac_have_decl" >>confdefs.h ac_fn_check_decl "$LINENO" "ADDR_NO_RANDOMIZE" "ac_cv_have_decl_ADDR_NO_RANDOMIZE" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_ADDR_NO_RANDOMIZE" = xyes then : ac_have_decl=1 else $as_nop ac_have_decl=0 fi printf "%s\n" "#define HAVE_DECL_ADDR_NO_RANDOMIZE $ac_have_decl" >>confdefs.h ac_fn_c_check_func "$LINENO" "posix_fallocate" "ac_cv_func_posix_fallocate" if test "x$ac_cv_func_posix_fallocate" = xyes then : printf "%s\n" "#define HAVE_POSIX_FALLOCATE 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "signalfd" "ac_cv_func_signalfd" if test "x$ac_cv_func_signalfd" = xyes then : else $as_nop as_fn_error $? "The signalfd system call is necessary for auditd" "$LINENO" 5 fi ac_fn_c_check_func "$LINENO" "rawmemchr" "ac_cv_func_rawmemchr" if test "x$ac_cv_func_rawmemchr" = xyes then : printf "%s\n" "#define HAVE_RAWMEMCHR 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "faccessat" "ac_cv_func_faccessat" if test "x$ac_cv_func_faccessat" = xyes then : printf "%s\n" "#define HAVE_FACCESSAT 1" >>confdefs.h fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _GNU_SOURCE #include int main() { (void) strndupa("test", 10); return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : printf "%s\n" "#define HAVE_STRNDUPA 1" >>confdefs.h fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext for ac_header in stdatomic.h do : ac_fn_c_check_header_compile "$LINENO" "stdatomic.h" "ac_cv_header_stdatomic_h" "$ac_includes_default" if test "x$ac_cv_header_stdatomic_h" = xyes then : printf "%s\n" "#define HAVE_STDATOMIC_H 1" >>confdefs.h printf "%s\n" "#define HAVE_ATOMIC 1" >>confdefs.h printf "%s\n" "#define ATOMIC_INT atomic_int" >>confdefs.h printf "%s\n" "#define ATOMIC_UNSIGNED atomic_uint" >>confdefs.h else $as_nop printf "%s\n" "#define ATOMIC_INT int" >>confdefs.h printf "%s\n" "#define ATOMIC_UNSIGNED unsigned" >>confdefs.h fi done { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking __attr_access support" >&5 printf %s "checking __attr_access support... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int audit_fgets(char *buf, size_t blen, int fd) __attr_access ((__write_only__, 1, 2)); int main(void) { return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ACCESS="yes" else $as_nop ACCESS="no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ACCESS" >&5 printf "%s\n" "$ACCESS" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking __attr_dealloc_free support" >&5 printf %s "checking __attr_dealloc_free support... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include extern char *audit_encode_nv_string(const char *name, const char *value, unsigned int vlen) __attr_dealloc_free; int main(void) { return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : DEALLOC="yes" else $as_nop DEALLOC="no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DEALLOC" >&5 printf "%s\n" "$DEALLOC" >&6; } OLDLIBS="$LIBS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_yield" >&5 printf %s "checking for library containing pthread_yield... " >&6; } if test ${ac_cv_search_pthread_yield+y} then : printf %s "(cached) " >&6 else $as_nop ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char pthread_yield (); int main (void) { return pthread_yield (); ; return 0; } _ACEOF for ac_lib in '' pthread 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_pthread_yield=$ac_res fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext if test ${ac_cv_search_pthread_yield+y} then : break fi done if test ${ac_cv_search_pthread_yield+y} then : else $as_nop ac_cv_search_pthread_yield=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pthread_yield" >&5 printf "%s\n" "$ac_cv_search_pthread_yield" >&6; } ac_res=$ac_cv_search_pthread_yield if test "$ac_res" != no then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" printf "%s\n" "#define HAVE_PTHREAD_YIELD 1" >>confdefs.h fi LIBS="$OLDLIBS" withval="" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to create python3 bindings" >&5 printf %s "checking whether to create python3 bindings... " >&6; } # Check whether --with-python3 was given. if test ${with_python3+y} then : withval=$with_python3; use_python3=$withval else $as_nop use_python3=auto fi if test "x$use_python3" = xno ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: investigating" >&5 printf "%s\n" "investigating" >&6; } # Extract the first word of "python3-config", so it can be a program name with args. set dummy python3-config; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_use_python3+y} then : printf %s "(cached) " >&6 else $as_nop case $use_python3 in [\\/]* | ?:[\\/]*) ac_cv_path_use_python3="$use_python3" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_use_python3="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_use_python3" && ac_cv_path_use_python3="no" ;; esac fi use_python3=$ac_cv_path_use_python3 if test -n "$use_python3"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $use_python3" >&5 printf "%s\n" "$use_python3" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$use_python3" = xno ; then if test "x$withval" = xyes ; then echo "Python3 bindings were selected but python3-config was not found." echo "Please ensure that it's installed or pass --without-python3 to ./configure" exit 1 fi echo "Python3 bindings will NOT be built" else echo "Python3 bindings WILL be built" use_python3=yes if test -n "$PYTHON"; then # If the user set $PYTHON, use it and don't search something else. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $PYTHON version is >= 3.1" >&5 printf %s "checking whether $PYTHON version is >= 3.1... " >&6; } prog="import sys # split strings by '.' and convert to numeric. Append some zeros # because we need at least 4 digits for the hex conversion. # map returns an iterator in Python 3.0 and a list in 2.x minver = list(map(int, '3.1'.split('.'))) + [0, 0, 0] minverhex = 0 # xrange is not present in Python 3.0 and range returns an iterator for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[i] sys.exit(sys.hexversion < minverhex)" if { echo "$as_me:$LINENO: $PYTHON -c "$prog"" >&5 ($PYTHON -c "$prog") >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } as_fn_error $? "Python interpreter is too old" "$LINENO" 5 fi am_display_PYTHON=$PYTHON else # Otherwise, try each interpreter until we find one that satisfies # VERSION. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a Python interpreter with version >= 3.1" >&5 printf %s "checking for a Python interpreter with version >= 3.1... " >&6; } if test ${am_cv_pathless_PYTHON+y} then : printf %s "(cached) " >&6 else $as_nop for am_cv_pathless_PYTHON in python python2 python3 python3.9 python3.8 python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0 python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 none; do test "$am_cv_pathless_PYTHON" = none && break prog="import sys # split strings by '.' and convert to numeric. Append some zeros # because we need at least 4 digits for the hex conversion. # map returns an iterator in Python 3.0 and a list in 2.x minver = list(map(int, '3.1'.split('.'))) + [0, 0, 0] minverhex = 0 # xrange is not present in Python 3.0 and range returns an iterator for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[i] sys.exit(sys.hexversion < minverhex)" if { echo "$as_me:$LINENO: $am_cv_pathless_PYTHON -c "$prog"" >&5 ($am_cv_pathless_PYTHON -c "$prog") >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then : break fi done fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_pathless_PYTHON" >&5 printf "%s\n" "$am_cv_pathless_PYTHON" >&6; } # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON. if test "$am_cv_pathless_PYTHON" = none; then PYTHON=: else # Extract the first word of "$am_cv_pathless_PYTHON", so it can be a program name with args. set dummy $am_cv_pathless_PYTHON; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_PYTHON+y} then : printf %s "(cached) " >&6 else $as_nop case $PYTHON in [\\/]* | ?:[\\/]*) ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_PYTHON="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PYTHON=$ac_cv_path_PYTHON if test -n "$PYTHON"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 printf "%s\n" "$PYTHON" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi am_display_PYTHON=$am_cv_pathless_PYTHON fi if test "$PYTHON" = :; then : else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON version" >&5 printf %s "checking for $am_display_PYTHON version... " >&6; } if test ${am_cv_python_version+y} then : printf %s "(cached) " >&6 else $as_nop am_cv_python_version=`$PYTHON -c "import sys; print ('%u.%u' % sys.version_info[:2])"` fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_version" >&5 printf "%s\n" "$am_cv_python_version" >&6; } PYTHON_VERSION=$am_cv_python_version { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON platform" >&5 printf %s "checking for $am_display_PYTHON platform... " >&6; } if test ${am_cv_python_platform+y} then : printf %s "(cached) " >&6 else $as_nop am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"` fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_platform" >&5 printf "%s\n" "$am_cv_python_platform" >&6; } PYTHON_PLATFORM=$am_cv_python_platform if test "x$prefix" = xNONE; then am__usable_prefix=$ac_default_prefix else am__usable_prefix=$prefix fi # Allow user to request using sys.* values from Python, # instead of the GNU $prefix values. # Check whether --with-python-sys-prefix was given. if test ${with_python_sys_prefix+y} then : withval=$with_python_sys_prefix; am_use_python_sys=: else $as_nop am_use_python_sys=false fi # Allow user to override whatever the default Python prefix is. # Check whether --with-python_prefix was given. if test ${with_python_prefix+y} then : withval=$with_python_prefix; am_python_prefix_subst=$withval am_cv_python_prefix=$withval { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for explicit $am_display_PYTHON prefix" >&5 printf %s "checking for explicit $am_display_PYTHON prefix... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_prefix" >&5 printf "%s\n" "$am_cv_python_prefix" >&6; } else $as_nop if $am_use_python_sys; then # using python sys.prefix value, not GNU { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for python default $am_display_PYTHON prefix" >&5 printf %s "checking for python default $am_display_PYTHON prefix... " >&6; } if test ${am_cv_python_prefix+y} then : printf %s "(cached) " >&6 else $as_nop am_cv_python_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.prefix)"` fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_prefix" >&5 printf "%s\n" "$am_cv_python_prefix" >&6; } case $am_cv_python_prefix in $am__usable_prefix*) am__strip_prefix=`echo "$am__usable_prefix" | sed 's|.|.|g'` am_python_prefix_subst=`echo "$am_cv_python_prefix" | sed "s,^$am__strip_prefix,\\${prefix},"` ;; *) am_python_prefix_subst=$am_cv_python_prefix ;; esac else # using GNU prefix value, not python sys.prefix am_python_prefix_subst='${prefix}' am_python_prefix=$am_python_prefix_subst { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU default $am_display_PYTHON prefix" >&5 printf %s "checking for GNU default $am_display_PYTHON prefix... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_python_prefix" >&5 printf "%s\n" "$am_python_prefix" >&6; } fi fi # Substituting python_prefix_subst value. PYTHON_PREFIX=$am_python_prefix_subst # emacs-page Now do it all over again for Python exec_prefix, but with yet # another conditional: fall back to regular prefix if that was specified. # Check whether --with-python_exec_prefix was given. if test ${with_python_exec_prefix+y} then : withval=$with_python_exec_prefix; am_python_exec_prefix_subst=$withval am_cv_python_exec_prefix=$withval { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for explicit $am_display_PYTHON exec_prefix" >&5 printf %s "checking for explicit $am_display_PYTHON exec_prefix... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_exec_prefix" >&5 printf "%s\n" "$am_cv_python_exec_prefix" >&6; } else $as_nop # no explicit --with-python_exec_prefix, but if # --with-python_prefix was given, use its value for python_exec_prefix too. if test -n "$with_python_prefix" then : am_python_exec_prefix_subst=$with_python_prefix am_cv_python_exec_prefix=$with_python_prefix { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for python_prefix-given $am_display_PYTHON exec_prefix" >&5 printf %s "checking for python_prefix-given $am_display_PYTHON exec_prefix... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_exec_prefix" >&5 printf "%s\n" "$am_cv_python_exec_prefix" >&6; } else $as_nop # Set am__usable_exec_prefix whether using GNU or Python values, # since we use that variable for pyexecdir. if test "x$exec_prefix" = xNONE; then am__usable_exec_prefix=$am__usable_prefix else am__usable_exec_prefix=$exec_prefix fi # if $am_use_python_sys; then # using python sys.exec_prefix, not GNU { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for python default $am_display_PYTHON exec_prefix" >&5 printf %s "checking for python default $am_display_PYTHON exec_prefix... " >&6; } if test ${am_cv_python_exec_prefix+y} then : printf %s "(cached) " >&6 else $as_nop am_cv_python_exec_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.exec_prefix)"` fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_exec_prefix" >&5 printf "%s\n" "$am_cv_python_exec_prefix" >&6; } case $am_cv_python_exec_prefix in $am__usable_exec_prefix*) am__strip_prefix=`echo "$am__usable_exec_prefix" | sed 's|.|.|g'` am_python_exec_prefix_subst=`echo "$am_cv_python_exec_prefix" | sed "s,^$am__strip_prefix,\\${exec_prefix},"` ;; *) am_python_exec_prefix_subst=$am_cv_python_exec_prefix ;; esac else # using GNU $exec_prefix, not python sys.exec_prefix am_python_exec_prefix_subst='${exec_prefix}' am_python_exec_prefix=$am_python_exec_prefix_subst { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU default $am_display_PYTHON exec_prefix" >&5 printf %s "checking for GNU default $am_display_PYTHON exec_prefix... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_python_exec_prefix" >&5 printf "%s\n" "$am_python_exec_prefix" >&6; } fi fi fi # Substituting python_exec_prefix_subst. PYTHON_EXEC_PREFIX=$am_python_exec_prefix_subst # Factor out some code duplication into this shell variable. am_python_setup_sysconfig="\ import sys # Prefer sysconfig over distutils.sysconfig, for better compatibility # with python 3.x. See automake bug#10227. try: import sysconfig except ImportError: can_use_sysconfig = 0 else: can_use_sysconfig = 1 # Can't use sysconfig in CPython 2.7, since it's broken in virtualenvs: # try: from platform import python_implementation if python_implementation() == 'CPython' and sys.version[:3] == '2.7': can_use_sysconfig = 0 except ImportError: pass" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON script directory (pythondir)" >&5 printf %s "checking for $am_display_PYTHON script directory (pythondir)... " >&6; } if test ${am_cv_python_pythondir+y} then : printf %s "(cached) " >&6 else $as_nop if test "x$am_cv_python_prefix" = x; then am_py_prefix=$am__usable_prefix else am_py_prefix=$am_cv_python_prefix fi am_cv_python_pythondir=`$PYTHON -c " $am_python_setup_sysconfig if can_use_sysconfig: sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'}) else: from distutils import sysconfig sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix') sys.stdout.write(sitedir)"` # case $am_cv_python_pythondir in $am_py_prefix*) am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,\\${PYTHON_PREFIX},"` ;; *) case $am_py_prefix in /usr|/System*) ;; *) am_cv_python_pythondir="\${PYTHON_PREFIX}/lib/python$PYTHON_VERSION/site-packages" ;; esac ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pythondir" >&5 printf "%s\n" "$am_cv_python_pythondir" >&6; } pythondir=$am_cv_python_pythondir pkgpythondir=\${pythondir}/$PACKAGE { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON extension module directory (pyexecdir)" >&5 printf %s "checking for $am_display_PYTHON extension module directory (pyexecdir)... " >&6; } if test ${am_cv_python_pyexecdir+y} then : printf %s "(cached) " >&6 else $as_nop if test "x$am_cv_python_exec_prefix" = x; then am_py_exec_prefix=$am__usable_exec_prefix else am_py_exec_prefix=$am_cv_python_exec_prefix fi am_cv_python_pyexecdir=`$PYTHON -c " $am_python_setup_sysconfig if can_use_sysconfig: sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_exec_prefix'}) else: from distutils import sysconfig sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_exec_prefix') sys.stdout.write(sitedir)"` # case $am_cv_python_pyexecdir in $am_py_exec_prefix*) am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,\\${PYTHON_EXEC_PREFIX},"` ;; *) case $am_py_exec_prefix in /usr|/System*) ;; *) am_cv_python_pyexecdir="\${PYTHON_EXEC_PREFIX}/lib/python$PYTHON_VERSION/site-packages" ;; esac ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pyexecdir" >&5 printf "%s\n" "$am_cv_python_pyexecdir" >&6; } pyexecdir=$am_cv_python_pyexecdir pkgpyexecdir=\${pyexecdir}/$PACKAGE fi PYTHON3_CFLAGS=`python3-config --cflags 2> /dev/null` PYTHON3_LIBS=`python3-config --libs 2> /dev/null` PYTHON3_INCLUDES=`python3-config --includes 2> /dev/null` fi fi if test ${use_python3} = "yes"; then USE_PYTHON3_TRUE= USE_PYTHON3_FALSE='#' else USE_PYTHON3_TRUE='#' USE_PYTHON3_FALSE= fi if test "x$use_python" = "xyes" || test "x$use_python3" = "xyes" ; then # Extract the first word of "swig", so it can be a program name with args. set dummy swig; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_SWIG+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$SWIG"; then ac_cv_prog_SWIG="$SWIG" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_SWIG="swig" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_SWIG" && ac_cv_prog_SWIG="no" fi fi SWIG=$ac_cv_prog_SWIG if test -n "$SWIG"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $SWIG" >&5 printf "%s\n" "$SWIG" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test x"$SWIG" == x"no" then : as_fn_error $? "Please install swig before configuring (required by python/python3)." "$LINENO" 5 fi fi withval="" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to create Go language bindings" >&5 printf %s "checking whether to create Go language bindings... " >&6; } # Check whether --with-golang was given. if test ${with_golang+y} then : withval=$with_golang; use_golang=$withval else $as_nop use_golang=auto fi if test "x$use_golang" = xno ; then golang_found="no" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: testing" >&5 printf "%s\n" "testing" >&6; } # Extract the first word of "go", so it can be a program name with args. set dummy go; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_GOLANG+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$GOLANG"; then ac_cv_prog_GOLANG="$GOLANG" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_GOLANG="go" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_GOLANG" && ac_cv_prog_GOLANG="no" fi fi GOLANG=$ac_cv_prog_GOLANG if test -n "$GOLANG"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GOLANG" >&5 printf "%s\n" "$GOLANG" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$GOLANG" != "xno" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Go bindings will be built" >&5 printf "%s\n" "$as_me: Go bindings will be built" >&6;} golang_found="yes" # Substitute some golang environment. GOROOT=`$GOLANG env GOROOT` else $as_nop if test "x$use_golang" = xyes ; then as_fn_error $? "Go language explicitly requested and program not found" "$LINENO" 5 else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Go not found - go bindings will not be made" >&5 printf "%s\n" "$as_me: WARNING: Go not found - go bindings will not be made" >&2;} fi fi fi if test "x${golang_found}" = "xyes"; then HAVE_GOLANG_TRUE= HAVE_GOLANG_FALSE='#' else HAVE_GOLANG_TRUE='#' HAVE_GOLANG_FALSE= fi #auditd listener { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to include auditd network listener support" >&5 printf %s "checking whether to include auditd network listener support... " >&6; } # Check whether --enable-listener was given. if test ${enable_listener+y} then : enableval=$enable_listener; enable_listener=$enableval else $as_nop enable_listener=yes fi if test "x$enable_listener" != "xno"; then printf "%s\n" "#define USE_LISTENER 1" >>confdefs.h fi if test "x$enable_listener" != "xno"; then ENABLE_LISTENER_TRUE= ENABLE_LISTENER_FALSE='#' else ENABLE_LISTENER_TRUE='#' ENABLE_LISTENER_FALSE= fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_listener" >&5 printf "%s\n" "$enable_listener" >&6; } #audisp zos-remote plugin # Check whether --enable-zos-remote was given. if test ${enable_zos_remote+y} then : enableval=$enable_zos_remote; enable_zos_remote=$enableval else $as_nop enable_zos_remote=yes fi if test $enable_zos_remote = yes; then ac_fn_c_check_header_compile "$LINENO" "lber.h" "ac_cv_header_lber_h" "$ac_includes_default" if test "x$ac_cv_header_lber_h" = xyes then : ldap_headers=yes else $as_nop ldap_headers=no fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ber_free in -llber" >&5 printf %s "checking for ber_free in -llber... " >&6; } if test ${ac_cv_lib_lber_ber_free+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-llber $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char ber_free (); int main (void) { return ber_free (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_lber_ber_free=yes else $as_nop ac_cv_lib_lber_ber_free=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lber_ber_free" >&5 printf "%s\n" "$ac_cv_lib_lber_ber_free" >&6; } if test "x$ac_cv_lib_lber_ber_free" = xyes then : LDAP_LDADD=-llber fi if test x$LDAP_LDADD = x ; then as_fn_error $? "zos remote support was requested but the openldap library was not found" "$LINENO" 5 fi if test $ldap_headers = no ; then as_fn_error $? "openldap libraries found but headers are missing" "$LINENO" 5 fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to include audisp ZOS remote plugin" >&5 printf %s "checking whether to include audisp ZOS remote plugin... " >&6; } if test "x$enable_zos_remote" != "xno"; then ENABLE_ZOS_REMOTE_TRUE= ENABLE_ZOS_REMOTE_FALSE='#' else ENABLE_ZOS_REMOTE_TRUE='#' ENABLE_ZOS_REMOTE_FALSE= fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_zos_remote" >&5 printf "%s\n" "$enable_zos_remote" >&6; } #gssapi # Check whether --enable-gssapi_krb5 was given. if test ${enable_gssapi_krb5+y} then : enableval=$enable_gssapi_krb5; case "${enableval}" in yes) want_gssapi_krb5="yes" ;; no) want_gssapi_krb5="no" ;; *) as_fn_error $? "bad value ${enableval} for --enable-gssapi-krb5" "$LINENO" 5 ;; esac else $as_nop want_gssapi_krb5="no" fi if test $want_gssapi_krb5 = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gss_acquire_cred in -lgssapi_krb5" >&5 printf %s "checking for gss_acquire_cred in -lgssapi_krb5... " >&6; } if test ${ac_cv_lib_gssapi_krb5_gss_acquire_cred+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lgssapi_krb5 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char gss_acquire_cred (); int main (void) { return gss_acquire_cred (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_gssapi_krb5_gss_acquire_cred=yes else $as_nop ac_cv_lib_gssapi_krb5_gss_acquire_cred=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gssapi_krb5_gss_acquire_cred" >&5 printf "%s\n" "$ac_cv_lib_gssapi_krb5_gss_acquire_cred" >&6; } if test "x$ac_cv_lib_gssapi_krb5_gss_acquire_cred" = xyes then : ac_fn_c_check_header_compile "$LINENO" "gssapi/gssapi.h" "ac_cv_header_gssapi_gssapi_h" "$ac_includes_default" if test "x$ac_cv_header_gssapi_gssapi_h" = xyes then : printf "%s\n" "#define USE_GSSAPI /**/" >>confdefs.h gss_libs="-lgssapi_krb5 -lkrb5" fi fi fi if test x$want_gssapi_krb5 = xyes; then ENABLE_GSSAPI_TRUE= ENABLE_GSSAPI_FALSE='#' else ENABLE_GSSAPI_TRUE='#' ENABLE_GSSAPI_FALSE= fi # ids { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable experimental options" >&5 printf %s "checking whether to enable experimental options... " >&6; } # Check whether --enable-experimental was given. if test ${enable_experimental+y} then : enableval=$enable_experimental; case "${enableval}" in yes) want_exper="yes" ;; no) want_exper="no" ;; *) as_fn_error $? "bad value ${enableval} for --enable-experimental" "$LINENO" 5 ;; esac else $as_nop want_exper="no" fi if test x$want_exper = xyes; then ENABLE_EXPERIMENTAL_TRUE= ENABLE_EXPERIMENTAL_FALSE='#' else ENABLE_EXPERIMENTAL_TRUE='#' ENABLE_EXPERIMENTAL_FALSE= fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $want_exper" >&5 printf "%s\n" "$want_exper" >&6; } # linux/fanotify.h ac_fn_c_check_header_compile "$LINENO" "linux/fanotify.h" "ac_cv_header_linux_fanotify_h" "$ac_includes_default" if test "x$ac_cv_header_linux_fanotify_h" = xyes then : printf "%s\n" "#define USE_FANOTIFY /**/" >>confdefs.h fi withval="" ALLDEBUG="-g" # Check whether --with-debug was given. if test ${with_debug+y} then : withval=$with_debug; if test "x${withval}" = xyes; then DEBUG="$ALLDEBUG" OPT="-O" if true; then DEBUG_TRUE= DEBUG_FALSE='#' else DEBUG_TRUE='#' DEBUG_FALSE= fi else DEBUG="-DNDEBUG" if false; then DEBUG_TRUE= DEBUG_FALSE='#' else DEBUG_TRUE='#' DEBUG_FALSE= fi fi else $as_nop DEBUG="-DNDEBUG"; if false; then DEBUG_TRUE= DEBUG_FALSE='#' else DEBUG_TRUE='#' DEBUG_FALSE= fi fi WFLAGS="" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -Wformat-truncation" >&5 printf %s "checking for -Wformat-truncation... " >&6; } TMPCFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} -Wformat-truncation" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : WFLAGS="-Wno-format-truncation" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS="${TMPCFLAGS}" CFLAGS="${CFLAGS} -Wunused-but-set-variable" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : WFLAGS="${WFLAGS} -Wno-unused-but-set-variable" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS="${TMPCFLAGS}" withval="" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to include arm eabi processor support" >&5 printf %s "checking whether to include arm eabi processor support... " >&6; } # Check whether --with-arm was given. if test ${with_arm+y} then : withval=$with_arm; use_arm=$withval else $as_nop use_arm=no fi if test x$use_arm != xno ; then printf "%s\n" "#define WITH_ARM 1" >>confdefs.h fi if test x$use_arm = xyes; then USE_ARM_TRUE= USE_ARM_FALSE='#' else USE_ARM_TRUE='#' USE_ARM_FALSE= fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $use_arm" >&5 printf "%s\n" "$use_arm" >&6; } withval="" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to include aarch64 processor support" >&5 printf %s "checking whether to include aarch64 processor support... " >&6; } # Check whether --with-aarch64 was given. if test ${with_aarch64+y} then : withval=$with_aarch64; use_aarch64=$withval else $as_nop use_aarch64=no fi if test x$use_aarch64 != xno ; then printf "%s\n" "#define WITH_AARCH64 1" >>confdefs.h fi if test x$use_aarch64 = xyes; then USE_AARCH64_TRUE= USE_AARCH64_FALSE='#' else USE_AARCH64_TRUE='#' USE_AARCH64_FALSE= fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $use_aarch64" >&5 printf "%s\n" "$use_aarch64" >&6; } withval="" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use apparmor" >&5 printf %s "checking whether to use apparmor... " >&6; } # Check whether --with-apparmor was given. if test ${with_apparmor+y} then : withval=$with_apparmor; use_apparmor=$withval else $as_nop use_apparmor=no fi if test x$use_apparmor != xno ; then printf "%s\n" "#define WITH_APPARMOR 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $use_apparmor" >&5 printf "%s\n" "$use_apparmor" >&6; } withval="" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use libwrap" >&5 printf %s "checking whether to use libwrap... " >&6; } # Check whether --with-libwrap was given. if test ${with_libwrap+y} then : withval=$with_libwrap; case "$withval" in no) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } ;; yes) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } ac_fn_c_check_header_compile "$LINENO" "tcpd.h" "ac_cv_header_tcpd_h" "$ac_includes_default" if test "x$ac_cv_header_tcpd_h" = xyes then : else $as_nop as_fn_error $? "Could not find libwrap headers" "$LINENO" 5 fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for request_init in -lwrap" >&5 printf %s "checking for request_init in -lwrap... " >&6; } if test ${ac_cv_lib_wrap_request_init+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lwrap $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char request_init (); int main (void) { return request_init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_wrap_request_init=yes else $as_nop ac_cv_lib_wrap_request_init=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_wrap_request_init" >&5 printf "%s\n" "$ac_cv_lib_wrap_request_init" >&6; } if test "x$ac_cv_lib_wrap_request_init" = xyes then : LIBWRAP_LIBS="-lwrap" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for yp_get_default_domain in -lnsl" >&5 printf %s "checking for yp_get_default_domain in -lnsl... " >&6; } if test ${ac_cv_lib_nsl_yp_get_default_domain+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char yp_get_default_domain (); int main (void) { return yp_get_default_domain (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_nsl_yp_get_default_domain=yes else $as_nop ac_cv_lib_nsl_yp_get_default_domain=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_yp_get_default_domain" >&5 printf "%s\n" "$ac_cv_lib_nsl_yp_get_default_domain" >&6; } if test "x$ac_cv_lib_nsl_yp_get_default_domain" = xyes then : LIBWRAP_LIBS="$LIBWRAP_LIBS -lnsl" fi ;; *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } if test -d "$withval"; then LIBWRAP_LIBS="-L$withval -lwrap" else LIBWRAP_LIBS="$withval" fi ac_fn_c_check_header_compile "$LINENO" "tcpd.h" "ac_cv_header_tcpd_h" "$ac_includes_default" if test "x$ac_cv_header_tcpd_h" = xyes then : else $as_nop as_fn_error $? "Could not find libwrap headers" "$LINENO" 5 fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for request_init in -lwrap" >&5 printf %s "checking for request_init in -lwrap... " >&6; } if test ${ac_cv_lib_wrap_request_init+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lwrap $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char request_init (); int main (void) { return request_init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_wrap_request_init=yes else $as_nop ac_cv_lib_wrap_request_init=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_wrap_request_init" >&5 printf "%s\n" "$ac_cv_lib_wrap_request_init" >&6; } if test "x$ac_cv_lib_wrap_request_init" = xyes then : printf "%s\n" "#define HAVE_LIBWRAP 1" >>confdefs.h LIBS="-lwrap $LIBS" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for yp_get_default_domain in -lnsl" >&5 printf %s "checking for yp_get_default_domain in -lnsl... " >&6; } if test ${ac_cv_lib_nsl_yp_get_default_domain+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char yp_get_default_domain (); int main (void) { return yp_get_default_domain (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_nsl_yp_get_default_domain=yes else $as_nop ac_cv_lib_nsl_yp_get_default_domain=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_yp_get_default_domain" >&5 printf "%s\n" "$ac_cv_lib_nsl_yp_get_default_domain" >&6; } if test "x$ac_cv_lib_nsl_yp_get_default_domain" = xyes then : LIBWRAP_LIBS="$LIBWRAP_LIBS -lnsl" fi OLDLIBS="$LIBS" LIBS="$LIBWRAP_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int allow_severity; int deny_severity; int main (void) { hosts_access(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : else $as_nop as_fn_error $? "Could not find the $withval library. You must first install tcp_wrappers." "$LINENO" 5 fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS="$OLDLIBS" ;; esac else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test x"$LIBWRAP_LIBS" != "x"; then printf "%s\n" "#define HAVE_LIBWRAP /**/" >>confdefs.h fi withval="" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to include io_uring support" >&5 printf %s "checking whether to include io_uring support... " >&6; } # Check whether --with-io_uring was given. if test ${with_io_uring+y} then : withval=$with_io_uring; use_io_uring=$withval else $as_nop use_io_uring=no fi if test x$use_io_uring != xno ; then printf "%s\n" "#define WITH_IO_URING 1" >>confdefs.h fi # AM_CONDITIONAL(USE_IO_URING, test x$use_io_uring = xyes) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $use_io_uring" >&5 printf "%s\n" "$use_io_uring" >&6; } # linux/ipx.h - deprecated in 2018 ac_fn_c_check_header_compile "$LINENO" "linux/ipx.h" "ac_cv_header_linux_ipx_h" "$ac_includes_default" if test "x$ac_cv_header_linux_ipx_h" = xyes then : ipx_headers=yes else $as_nop ipx_headers=no fi if test $ipx_headers = yes ; then printf "%s\n" "#define HAVE_IPX_HEADERS 1" >>confdefs.h fi # See if we want to support lower capabilities for plugins # Check whether --with-libcap-ng was given. if test ${with_libcap_ng+y} then : withval=$with_libcap_ng; else $as_nop with_libcap_ng=auto fi # Check for Libcap-ng API # # libcap-ng detection if test x$with_libcap_ng = xno ; then have_libcap_ng=no; else # Start by checking for header file ac_fn_c_check_header_compile "$LINENO" "cap-ng.h" "ac_cv_header_cap_ng_h" "$ac_includes_default" if test "x$ac_cv_header_cap_ng_h" = xyes then : capng_headers=yes else $as_nop capng_headers=no fi # See if we have libcap-ng library { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for capng_clear in -lcap-ng" >&5 printf %s "checking for capng_clear in -lcap-ng... " >&6; } if test ${ac_cv_lib_cap_ng_capng_clear+y} then : printf %s "(cached) " >&6 else $as_nop 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. */ char capng_clear (); int main (void) { return capng_clear (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_cap_ng_capng_clear=yes else $as_nop ac_cv_lib_cap_ng_capng_clear=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cap_ng_capng_clear" >&5 printf "%s\n" "$ac_cv_lib_cap_ng_capng_clear" >&6; } if test "x$ac_cv_lib_cap_ng_capng_clear" = xyes then : CAPNG_LDADD=-lcap-ng fi # Check results are usable if test x$with_libcap_ng = xyes -a x$CAPNG_LDADD = x ; then as_fn_error $? "libcap-ng support was requested and the library was not found" "$LINENO" 5 fi if test x$CAPNG_LDADD != x -a $capng_headers = no ; then as_fn_error $? "libcap-ng libraries found but headers are missing" "$LINENO" 5 fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use libcap-ng" >&5 printf %s "checking whether to use libcap-ng... " >&6; } if test x$CAPNG_LDADD != x ; then printf "%s\n" "#define HAVE_LIBCAP_NG 1" >>confdefs.h CAPNG_PKG="libcap-ng" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi #AC_SUBST(libev_LIBS) ac_config_files="$ac_config_files Makefile common/Makefile lib/Makefile lib/audit.pc lib/test/Makefile auparse/Makefile auparse/test/Makefile auparse/auparse.pc src/Makefile src/libev/Makefile src/test/Makefile docs/Makefile rules/Makefile init.d/Makefile audisp/Makefile audisp/plugins/Makefile audisp/plugins/af_unix/Makefile audisp/plugins/remote/Makefile audisp/plugins/zos-remote/Makefile audisp/plugins/syslog/Makefile audisp/plugins/filter/Makefile audisp/plugins/ids/Makefile audisp/plugins/ids/rules/Makefile audisp/plugins/statsd/Makefile bindings/Makefile bindings/python/Makefile bindings/python/python3/Makefile bindings/golang/Makefile bindings/swig/Makefile bindings/swig/src/Makefile bindings/swig/python3/Makefile tools/Makefile tools/aulast/Makefile tools/aulastlog/Makefile tools/ausyscall/Makefile m4/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 printf "%s\n" "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 printf %s "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5 printf "%s\n" "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_PYTHON3_TRUE}" && test -z "${USE_PYTHON3_FALSE}"; then as_fn_error $? "conditional \"USE_PYTHON3\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_GOLANG_TRUE}" && test -z "${HAVE_GOLANG_FALSE}"; then as_fn_error $? "conditional \"HAVE_GOLANG\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_LISTENER_TRUE}" && test -z "${ENABLE_LISTENER_FALSE}"; then as_fn_error $? "conditional \"ENABLE_LISTENER\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_ZOS_REMOTE_TRUE}" && test -z "${ENABLE_ZOS_REMOTE_FALSE}"; then as_fn_error $? "conditional \"ENABLE_ZOS_REMOTE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_GSSAPI_TRUE}" && test -z "${ENABLE_GSSAPI_FALSE}"; then as_fn_error $? "conditional \"ENABLE_GSSAPI\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_EXPERIMENTAL_TRUE}" && test -z "${ENABLE_EXPERIMENTAL_FALSE}"; then as_fn_error $? "conditional \"ENABLE_EXPERIMENTAL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DEBUG_TRUE}" && test -z "${DEBUG_FALSE}"; then as_fn_error $? "conditional \"DEBUG\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DEBUG_TRUE}" && test -z "${DEBUG_FALSE}"; then as_fn_error $? "conditional \"DEBUG\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DEBUG_TRUE}" && test -z "${DEBUG_FALSE}"; then as_fn_error $? "conditional \"DEBUG\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_ARM_TRUE}" && test -z "${USE_ARM_FALSE}"; then as_fn_error $? "conditional \"USE_ARM\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_AARCH64_TRUE}" && test -z "${USE_AARCH64_FALSE}"; then as_fn_error $? "conditional \"USE_AARCH64\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi # Reset variables that may have inherited troublesome values from # the environment. # IFS needs to be set, to space, tab, and newline, in precisely that order. # (If _AS_PATH_WALK were called with IFS unset, it would have the # side effect of setting IFS to empty, thus disabling word splitting.) # Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl IFS=" "" $as_nl" PS1='$ ' PS2='> ' PS4='+ ' # Ensure predictable behavior from utilities with locale-dependent output. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # We cannot yet rely on "unset" to work, but we need these variables # to be unset--not just set to an empty or harmless value--now, to # avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct # also avoids known problems related to "unset" and subshell syntax # in other old shells (e.g. bash 2.01 and pdksh 5.2.14). for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH do eval test \${$as_var+y} \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done # Ensure that fds 0, 1, and 2 are open. if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null then : eval 'as_fn_append () { eval $1+=\$2 }' else $as_nop as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null then : eval 'as_fn_arith () { as_val=$(( $* )) }' else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # Determine whether it's possible to make 'echo' print without a newline. # These variables are no longer used directly by Autoconf, but are AC_SUBSTed # for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac # For backward compatibility with old third-party macros, we provide # the shell variables $as_echo and $as_echo_n. New code should use # AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. as_echo='printf %s\n' as_echo_n='printf %s' rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by audit $as_me 4.0.2, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to the package provider." _ACEOF ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ audit config.status 4.0.2 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" Copyright (C) 2021 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) printf "%s\n" "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) printf "%s\n" "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX printf "%s\n" "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' FILECMD='`$ECHO "$FILECMD" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' lt_ar_flags='`$ECHO "$lt_ar_flags" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ FILECMD \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_import \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ lt_cv_nm_interface \ nm_file_list_spec \ lt_cv_truncate_bin \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ configure_time_dlsearch_path \ configure_time_lt_sys_library_path; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "common/Makefile") CONFIG_FILES="$CONFIG_FILES common/Makefile" ;; "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; "lib/audit.pc") CONFIG_FILES="$CONFIG_FILES lib/audit.pc" ;; "lib/test/Makefile") CONFIG_FILES="$CONFIG_FILES lib/test/Makefile" ;; "auparse/Makefile") CONFIG_FILES="$CONFIG_FILES auparse/Makefile" ;; "auparse/test/Makefile") CONFIG_FILES="$CONFIG_FILES auparse/test/Makefile" ;; "auparse/auparse.pc") CONFIG_FILES="$CONFIG_FILES auparse/auparse.pc" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "src/libev/Makefile") CONFIG_FILES="$CONFIG_FILES src/libev/Makefile" ;; "src/test/Makefile") CONFIG_FILES="$CONFIG_FILES src/test/Makefile" ;; "docs/Makefile") CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;; "rules/Makefile") CONFIG_FILES="$CONFIG_FILES rules/Makefile" ;; "init.d/Makefile") CONFIG_FILES="$CONFIG_FILES init.d/Makefile" ;; "audisp/Makefile") CONFIG_FILES="$CONFIG_FILES audisp/Makefile" ;; "audisp/plugins/Makefile") CONFIG_FILES="$CONFIG_FILES audisp/plugins/Makefile" ;; "audisp/plugins/af_unix/Makefile") CONFIG_FILES="$CONFIG_FILES audisp/plugins/af_unix/Makefile" ;; "audisp/plugins/remote/Makefile") CONFIG_FILES="$CONFIG_FILES audisp/plugins/remote/Makefile" ;; "audisp/plugins/zos-remote/Makefile") CONFIG_FILES="$CONFIG_FILES audisp/plugins/zos-remote/Makefile" ;; "audisp/plugins/syslog/Makefile") CONFIG_FILES="$CONFIG_FILES audisp/plugins/syslog/Makefile" ;; "audisp/plugins/filter/Makefile") CONFIG_FILES="$CONFIG_FILES audisp/plugins/filter/Makefile" ;; "audisp/plugins/ids/Makefile") CONFIG_FILES="$CONFIG_FILES audisp/plugins/ids/Makefile" ;; "audisp/plugins/ids/rules/Makefile") CONFIG_FILES="$CONFIG_FILES audisp/plugins/ids/rules/Makefile" ;; "audisp/plugins/statsd/Makefile") CONFIG_FILES="$CONFIG_FILES audisp/plugins/statsd/Makefile" ;; "bindings/Makefile") CONFIG_FILES="$CONFIG_FILES bindings/Makefile" ;; "bindings/python/Makefile") CONFIG_FILES="$CONFIG_FILES bindings/python/Makefile" ;; "bindings/python/python3/Makefile") CONFIG_FILES="$CONFIG_FILES bindings/python/python3/Makefile" ;; "bindings/golang/Makefile") CONFIG_FILES="$CONFIG_FILES bindings/golang/Makefile" ;; "bindings/swig/Makefile") CONFIG_FILES="$CONFIG_FILES bindings/swig/Makefile" ;; "bindings/swig/src/Makefile") CONFIG_FILES="$CONFIG_FILES bindings/swig/src/Makefile" ;; "bindings/swig/python3/Makefile") CONFIG_FILES="$CONFIG_FILES bindings/swig/python3/Makefile" ;; "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;; "tools/aulast/Makefile") CONFIG_FILES="$CONFIG_FILES tools/aulast/Makefile" ;; "tools/aulastlog/Makefile") CONFIG_FILES="$CONFIG_FILES tools/aulastlog/Makefile" ;; "tools/ausyscall/Makefile") CONFIG_FILES="$CONFIG_FILES tools/ausyscall/Makefile" ;; "m4/Makefile") CONFIG_FILES="$CONFIG_FILES m4/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 printf "%s\n" "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`printf "%s\n" "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 printf "%s\n" "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. case $CONFIG_FILES in #( *\'*) : eval set x "$CONFIG_FILES" ;; #( *) : set x $CONFIG_FILES ;; #( *) : ;; esac shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`printf "%s\n" "$am_mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`$as_dirname -- "$am_mf" || $as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$am_mf" : 'X\(//\)[^/]' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` am_filepart=`$as_basename -- "$am_mf" || $as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$am_mf" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` { echo "$as_me:$LINENO: cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles" >&5 (cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } || am_rc=$? done if test $am_rc -ne 0; then { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "Something went wrong bootstrapping makefile fragments for automatic dependency tracking. If GNU make was not used, consider re-running the configure script with MAKE=\"gmake\" (or whatever is necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking). See \`config.log' for more details" "$LINENO" 5; } fi { am_dirpart=; unset am_dirpart;} { am_filepart=; unset am_filepart;} { am_mf=; unset am_mf;} { am_rc=; unset am_rc;} rm -f conftest-deps.mk } ;; "libtool":C) # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 # Copyright (C) 2014 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. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program or library that is built # using GNU Libtool, you may include this file under the same # distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # The names of the tagged configurations supported by this script. available_tags='' # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shared archive member basename,for filename based shared library versioning on AIX. shared_archive_member_spec=$shared_archive_member_spec # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # A file(cmd) program that detects file types. FILECMD=$lt_FILECMD # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # DLL creation program. DLLTOOL=$lt_DLLTOOL # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive (by configure). lt_ar_flags=$lt_ar_flags # Flags to create an archive. AR_FLAGS=\${ARFLAGS-"\$lt_ar_flags"} # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm into a list of symbols to manually relocate. global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # The name lister interface. nm_interface=$lt_lt_cv_nm_interface # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and where our libraries should be installed. lt_sysroot=$lt_sysroot # Command to truncate a binary pipe. lt_truncate_bin=$lt_lt_cv_truncate_bin # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Detected run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path # Explicit LT_SYS_LIBRARY_PATH set during ./configure time. configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # ### END FUNCTIONS SHARED WITH CONFIGURE _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain=$ac_aux_dir/ltmain.sh # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? $SED '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi echo . echo " Auditd Version: $VERSION Target: $target Installation prefix: $prefix Compiler: $CC Compiler flags: `echo $CFLAGS | fmt -w 50 | sed 's,^, ,'` __attr_access support: $ACCESS __attr_dealloc_free support: $DEALLOC " audit-4.0.2/docs/0000755001034500103450000000000014655201460007317 5audit-4.0.2/docs/auparse_init.30000644001034500103450000000321214655201403012001 .TH "AUPARSE_INIT" "3" "Jan 2023" "Red Hat" "Linux Audit API" .SH NAME auparse_init \- initialize an instance of the audit parsing library .SH "SYNOPSIS" .B #include .sp auparse_state_t *auparse_init(ausource_t source, const void *b); .SH "DESCRIPTION" auparse_init initializes an instance of the audit parsing library. The function returns an opaque pointer to the parser's internal state. It is used in subsequent calls to the library so. The source variable determines where the library looks for data. Legal values can be: .nf AUSOURCE_LOGS - use audit logs AUSOURCE_FILE - use a file AUSOURCE_FILE_ARRAY - use several files AUSOURCE_BUFFER - use a buffer AUSOURCE_BUFFER_ARRAY - use an array of buffers AUSOURCE_DESCRIPTOR - use a particular descriptor AUSOURCE_FILE_POINTER - use a stdio FILE pointer AUSOURCE_FEED - feed data to parser with auparse_feed() .fi The pointer 'b' is used to set the file name, array of filenames, the buffer address, or an array of pointers to buffers, or the descriptor number based on what source is given. When the data source is an array of files or buffers, you would create an array of pointers with the last one being a NULL pointer. Buffers should be NUL terminated. The data structure returned by auparse_init is not thread-safe. If you need to use it in a multithreaded program, you will need to add locking around any use of the data structure. .SH "RETURN VALUE" Returns a NULL pointer if an error occurs; otherwise, the return value is an opaque pointer to the parser's internal state. .SH "SEE ALSO" .BR auparse_reset (3), .BR auparse_destroy (3). .BR auparse_feed (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/ausearch_set_stop.30000644001034500103450000000200114655201403013024 .TH "AUSEARCH_SET_STOP" "3" "Feb 2007" "Red Hat" "Linux Audit API" .SH NAME ausearch_set_stop \- set the cursor position .SH "SYNOPSIS" .B #include .sp int ausearch_set_stop(auparse_state_t *au, austop_t where); .SH "DESCRIPTION" ausearch_set_stop determines where the internal cursor will stop when a search condition is met. The possible values are: .RS .TP .I AUSEARCH_STOP_EVENT This one repositions the cursors to the first field of the first record of the event containing the items searched for. .TP .I AUSEARCH_STOP_RECORD This one repositions the cursors to the first field of the record containing the items searched for. .TP .I AUSEARCH_STOP_FIELD This one simply stops on the current field when the evaluation of the rules becomes true. .RE .SH "RETURN VALUE" Returns \-1 if an error occurs; otherwise, 0 for success. .SH "SEE ALSO" .BR ausearch_add_item (3), .BR ausearch_add_regex (3), .BR ausearch_clear (3), .BR ausearch_cur_event (3), .BR ausearch_next_event (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/audit_set_backlog_wait_time.30000644001034500103450000000153714655201403015033 .TH "AUDIT_SET_BACKLOG_WAIT_TIME" "3" "Oct 2014" "Linux Audit API" .SH NAME audit_set_backlog_wait_time \- Set the audit backlog wait time .SH "SYNOPSIS" .B #include .sp int audit_set_backlog_wait_time(int fd, uint32_t bwt); .SH "DESCRIPTION" audit_set_backlog_wait_time sets the time that the kernel will wait before attempting to send more audit events to be transferred to the audit daemon when the backlog_limit is reached. This gives the audit daemon a chance to drain the kernel queue. The default value is 60000 or 60 * HZ setting in the kernel. .SH "RETURN VALUE" The return value is <= 0 on error, otherwise it is the netlink sequence id number. This function can have any error that sendto would encounter. .SH "SEE ALSO" .BR audit_set_backlog_limit (3), .BR audit_open (3), .BR auditd (8), .BR auditctl (8). .SH AUTHOR Steve Grubb audit-4.0.2/docs/auparse_get_field_type.30000644001034500103450000000141314655201403014022 .TH "AUPARSE_GET_FIELD_TYPE" "3" "Sept 2008" "Red Hat" "Linux Audit API" .SH NAME auparse_get_field_type \- get current field's data type .SH "SYNOPSIS" .B #include .sp int auparse_get_field_type(const auparse_state_t *au); .SH "DESCRIPTION" auparse_get_field_type returns a value from the auparse_type_t enum that describes the kind of data in the current field of the current record in the current event. .SH "RETURN VALUE" Returns AUPARSE_TYPE_UNCLASSIFIED if the field's data type has no known description or is an integer. Otherwise it returns another enum. Fields with the type AUPARSE_TYPE_ESCAPED must be interpreted to access their value since those field's raw value is encoded. .SH "SEE ALSO" .BR auparse_get_field_name (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/auparse_get_field_str.30000644001034500103450000000117014655201403013651 .TH "AUPARSE_GET_FIELD_STR" "3" "Feb 2007" "Red Hat" "Linux Audit API" .SH NAME auparse_get_field_str \- get current field's value .SH "SYNOPSIS" .B #include .sp const char *auparse_get_field_str(const auparse_state_t *au); .SH "DESCRIPTION" auparse_get_field_str allows access to the value in the current field of the current record in the current event. .SH "RETURN VALUE" Returns NULL if an error occurs; otherwise, a pointer to the field's value. .SH "SEE ALSO" .BR auparse_get_field_name (3), .BR auparse_get_field_int (3), .BR auparse_interpret_field (3), .BR auparse_next_field (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/audit_request_signal_info.30000644001034500103450000000161214655201403014546 .TH "AUDIT_REQUEST_SIGNAL_INFO" "3" "Feb 2007" "Red Hat" "Linux Audit API" .SH NAME audit_request_signal_info \- Request signal info for the audit system .SH "SYNOPSIS" .B #include .sp int audit_request_signal_info(int fd); .SH "DESCRIPTION" audit_request_signal_info requests that the kernel send information about the sender of a signal to the audit daemon. The signal info structure is as follows: .nf struct audit_sig_info { uid_t uid; pid_t pid; char ctx[0]; }; .fi This function is likely to be used only by audit daemons and shouldn't be called by any other kind of program. .SH "RETURN VALUE" The return value is <= 0 on error, otherwise it is the netlink sequence id number. This function can have any error that sendto would encounter. .SH "SEE ALSO" .BR audit_open (3), .BR audit_get_reply (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/ausearch_next_event.30000644001034500103450000000120014655201403013343 .TH "AUSEARCH_NEXT_EVENT" "3" "Feb 2007" "Red Hat" "Linux Audit API" .SH NAME ausearch_next_event \- find the next event that meets search criteria .SH "SYNOPSIS" .B #include .sp int ausearch_next_event(auparse_state_t *au); .SH "DESCRIPTION" ausearch_next_event will scan the input source and evaluate whether any record in an event contains the data being searched for. Evaluation is done at the record level. .SH "RETURN VALUE" Returns \-1 if an error occurs, 0 if no matches, and 1 for success. .SH "SEE ALSO" .BR ausearch_add_item (3), .BR ausearch_add_regex (3), .BR ausearch_set_stop (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/audit_log_acct_message.30000644001034500103450000000341514655201403013770 .TH "AUDIT_LOG_ACCT_MESSAGE" "3" "Nov 2015" "Red Hat" "Linux Audit API" .SH NAME audit_log_acct_message \- log a user account message .SH SYNOPSIS .B #include .sp int audit_log_acct_message(int audit_fd, int type, const char *pgname, const char *op, const char *name, unsigned int id, const char *host, const char *addr, const char *tty, int result) .SH DESCRIPTION This function will log a message to the audit system using a predefined message format. It should be used for all account manipulation operations. The function parameters are as follows: .RS .TP audit_fd - The fd returned by audit_open .TP type - type of message: AUDIT_USER_CHAUTHTOK for changing any account attributes. .TP pgname - program's name, if NULL will attempt to figure out .TP op - operation. Ex: "adding-user", "changing-finger-info", "deleting-group". This value should have a dash or underscore between the words so that report parsers group them together. .TP name - user's account or group name. If not available use NULL. .TP id - uid or gid that the operation is being performed on. If the user is unknown, pass a \-1 and fill in the name parameter. This is used only when user is NULL. .TP host - The hostname if known. If not available pass a NULL. .TP addr - The network address of the user. If not available pass a NULL. .TP tty - The tty of the user, if NULL will attempt to figure out .TP result - 1 is "success" and 0 is "failed" .RE .SH "RETURN VALUE" It returns the sequence number which is > 0 on success or <= 0 on error. .SH "ERRORS" This function returns \-1 on failure. Examine errno for more info. .SH "SEE ALSO" .BR audit_log_user_message (3), .BR audit_log_user_comm_message (3), .BR audit_log_user_avc_message (3), .BR audit_log_semanage_message (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/audit_name_to_action.30000644001034500103450000000201314655201403013461 .TH "AUDIT_NAME_TO_ACTION" "3" "Mar 2022" "Red Hat" "Linux Audit API" .SH NAME audit_name_to_action, audit_action_to_name \- Convert the action name to the numeric action value to each other .SH "SYNOPSIS" .nf .B #include .PP .BI "int audit_name_to_action(const char " *action ); .PP .BI "const char *audit_action_to_name(int " action ); .fi .SH "DESCRIPTION" .BR audit_name_to_action () converts the action name ("never", "possible", "always") to the numeric action value (AUDIT_NEVER, AUDIT_POSSIBLE, AUDIT_ALWAYS). .I action is the action name. .PP .BR audit_action_to_name () converts the numeric action value (AUDIT_NEVER, AUDIT_POSSIBLE, AUDIT_ALWAYS) to the action name ("never", "possible", "always"). .I action is the numeric action value .SH "RETURN VALUE" .BR audit_name_to_action () returns -1 if an error occurs; otherwise, the return value is the numeric action value. .PP .BR audit_action_to_name () returns NULL if an error occurs; otherwise, the return value is the action name. .SH AUTHOR Steve Grubb audit-4.0.2/docs/auparse_get_field_name.30000644001034500103450000000112214655201403013756 .TH "AUPARSE_GET_FIELD_NAME" "3" "Feb 2007" "Red Hat" "Linux Audit API" .SH NAME auparse_get_field_name \- get current field's name .SH "SYNOPSIS" .B #include .sp const char *auparse_get_field_name(const auparse_state_t *au); .SH "DESCRIPTION" auparse_get_field_name allows access to the current field name of the current record in the current event. .SH "RETURN VALUE" Returns NULL if an error occurs; otherwise, a pointer to the field's name. .SH "SEE ALSO" .BR auparse_get_field_str (3), .BR auparse_interpret_field (3), .BR auparse_next_field (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/auparse_next_field.30000644001034500103450000000076514655201403013171 .TH "AUPARSE_NEXT_FIELD" "3" "Feb 2007" "Red Hat" "Linux Audit API" .SH NAME auparse_next_field \- move field cursor .SH "SYNOPSIS" .B #include .sp int auparse_next_field(const auparse_state_t *au); .SH "DESCRIPTION" auparse_next_field moves the library's internal cursor to point to the next field in the current record of the current event. .SH "RETURN VALUE" Returns 0 if no more fields exist and 1 for success. .SH "SEE ALSO" .BR auparse_next_record (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/auditd.80000644001034500103450000001022714655201403010601 .TH "AUDITD" "8" "Sept 2021" "Red Hat" "System Administration Utilities" .SH NAME auditd \- The Linux Audit daemon .SH SYNOPSIS .B auditd .RB [ \-f ]\ [ \-l ]\ [ \-n ]\ [ \-s\ disable|enable|nochange ]\ [ \-c\ ] .SH DESCRIPTION \fBauditd\fP is the userspace component to the Linux Auditing System. It's responsible for writing audit records to the disk. Viewing the logs is done with the .B ausearch or .B aureport utilities. Configuring the audit system or loading rules is done with the .B auditctl utility. During startup, the rules in \fI/etc/audit/audit.rules\fP are read by \fBauditctl\fP and loaded into the kernel. Alternately, there is also an .B augenrules program that reads rules located in \fI/etc/audit/rules.d/\fP and compiles them into an audit.rules file. The audit daemon itself has some configuration options that the admin may wish to customize. They are found in the .B auditd.conf file. .SH OPTIONS .TP .B \-f leave the audit daemon in the foreground for debugging. Messages also go to stderr rather than the audit log. .TP .B \-l allow the audit daemon to follow symlinks for config files. .TP .B \-n no fork. This is useful for running off of inittab or systemd. .TP .B \-s=\fIENABLE_STATE\fR specify when starting if auditd should change the current value for the kernel enabled flag. Valid values for ENABLE_STATE are "disable", "enable" or "nochange". The default is to enable (and disable when auditd terminates). The value of the enabled flag may be changed during the lifetime of auditd using 'auditctl \-e'. .TP .B \-c Specify alternate config file directory. Note that this same directory will be passed to the dispatcher. (default: /etc/audit/) .SH SIGNALS .TP .B SIGHUP causes auditd to reconfigure. This means that auditd re-reads the configuration file. If there are no syntax errors, it will proceed to implement the requested changes. If the reconfigure is successful, a DAEMON_CONFIG event is recorded in the logs. If not successful, error handling is controlled by space_left_action, admin_space_left_action, disk_full_action, and disk_error_action parameters in auditd.conf. .TP .B SIGTERM caused auditd to discontinue processing audit events, write a shutdown audit event, and exit. .TP .B SIGUSR1 causes auditd to immediately rotate the logs. It will consult the max_log_file_action to see if it should keep the logs or not. .TP .B SIGUSR2 causes auditd to attempt to resume logging and passing events to plugins. This is usually needed after logging has been suspended or the internal queue is overflowed. Either of these conditions depends on the applicable configuration settings. .TP .B SIGCONT causes auditd to dump a report of internal state to /var/run/auditd.state. .SH EXIT CODES .TP .B 1 Cannot adjust priority, daemonize, open audit netlink, write the pid file, start up plugins, resolve the machine name, set audit pid, or other initialization tasks. .TP .B 2 Invalid or excessive command line arguments .TP .B 4 The audit daemon doesn't have sufficient privilege .TP .B 6 There is an error in the configuration file .SH FILES .B /etc/audit/auditd.conf - configuration file for audit daemon .P .B /etc/audit/audit.rules - audit rules to be loaded at startup .P .B /etc/audit/rules.d/ - directory holding individual sets of rules to be compiled into one file by augenrules. .P .B /etc/audit/plugins.d/ - directory holding individual plugin configuration files. .P .B /etc/audit/audit-stop.rules - These rules are loaded when the audit daemon stops. .P .B /var/run/auditd.state - report about internal state. .SH NOTES A boot param of audit=1 should be added to ensure that all processes that run before the audit daemon starts is marked as auditable by the kernel. Not doing that will make a few processes impossible to properly audit. The audit daemon can receive audit events from other audit daemons via the audisp\-remote plugin. The audit daemon may be linked with tcp_wrappers to control which machines can connect. If this is the case, you can add an entry to hosts.allow and deny. .SH "SEE ALSO" .BR auditd.conf (5), .BR auditd\-plugins (5), .BR ausearch (8), .BR aureport (8), .BR auditctl (8), .BR augenrules (8), .BR audit.rules (7). .SH AUTHOR Steve Grubb audit-4.0.2/docs/auparse_node_compare.30000644001034500103450000000114414655201403013473 .TH "AUPARSE_NODE_COMPARE" "3" "Sept 2007" "Red Hat" "Linux Audit API" .SH NAME auparse_node_compare \- compares node name values .SH "SYNOPSIS" .B #include .sp int auparse_node_compare(const au_event_t *e1, const au_event_t *e2); .SH "DESCRIPTION" auparse_node_compare compares the node name values of 2 events. .SH "RETURN VALUE" Returns \-1, 0, or 1 respectively depending on whether e2 is less than, equal to, or greater than e1. Since this is a string compare, it probably only matter that they are equal or not equal. .SH "SEE ALSO" .BR auparse_get_timestamp (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/audit_request_rules_list_data.30000644001034500103450000000133714655201403015440 .TH "AUDIT_REQUEST_RULES_LIST_DATA" "3" "Oct 2006" "Red Hat" "Linux Audit API" .SH NAME audit_request_rules_list_data \- Request list of current audit rules .SH "SYNOPSIS" .B #include .sp int audit_request_rules_list_data(int fd); .SH "DESCRIPTION" audit_request_rules_list_data sends a request to the kernel to list the current audit rules. The rules are sent back one after another after this request is issued. .SH "RETURN VALUE" The return value is <= 0 on error, otherwise it is the netlink sequence id number. This function can have any error that sendto would encounter. .SH "SEE ALSO" .BR audit_add_rule_data (3), .BR audit_delete_rule_data (3), .BR audit_open (3), .BR auditctl (8). .SH AUTHOR Steve Grubb audit-4.0.2/docs/ausearch_clear.30000644001034500103450000000070714655201403012265 .TH "AUSEARCH_CLEAR" "3" "Feb 2007" "Red Hat" "Linux Audit API" .SH NAME ausearch_clear \- clear search parameters .SH "SYNOPSIS" .B #include .sp void ausearch_clear(auparse_state_t *au); .SH "DESCRIPTION" ausearch_clear clears any search parameters stored in the parser instance and frees memory associated with it. .SH "RETURN VALUE" None. .SH "SEE ALSO" .BR ausearch_add_item (3), .BR ausearch_add_regex (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/auparse_get_timestamp.30000644001034500103450000000166014655201403013705 .TH "AUPARSE_GET_TIMESTAMP" "3" "Sept 2007" "Red Hat" "Linux Audit API" .SH NAME auparse_get_timestamp \- access timestamp of the event .SH "SYNOPSIS" .B #include .sp const au_event_t *auparse_get_timestamp(const auparse_state_t *au); .SH "DESCRIPTION" auparse_get_timestamp provides an accessor function for the event's timestamp data structure. The data structure is as follows: .nf typedef struct { time_t sec; // Event seconds unsigned int milli; // millisecond of the timestamp unsigned long serial; // Serial number of the event const char *host; // Machine's node name } au_event_t; .fi .SH "RETURN VALUE" Returns NULL if an error occurs; otherwise, a valid pointer to the data. .SH "SEE ALSO" .BR auparse_get_time (3), .BR auparse_get_milli (3), .BR auparse_get_serial (3), .BR auparse_get_node (3), .BR auparse_timestamp_compare (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/audit_set_failure.30000644001034500103450000000203214655201403013005 .TH "AUDIT_SET_FAILURE" "3" "June 2015" "Red Hat" "Linux Audit API" .SH NAME audit_set_failure \- Set audit failure flag .SH "SYNOPSIS" .B #include .sp int audit_set_failure(int fd, uint32_t failure); .SH "DESCRIPTION" audit_set_failure sets the action that the kernel will perform when the backlog limit is reached or when it encounters an error and cannot proceed. Possible values are: .TP 0 - AUDIT_FAIL_SILENT Do nothing, report nothing, skip logging the record and continue. .TP 1 - AUDIT_FAIL_PRINTK [default] Log the audit record using printk which will cause subsequent events to get written to syslog. .TP 2 - AUDIT_FAIL_PANIC Call the panic function. This would be used to prevent use of the machine upon loss of audit events. .SH "RETURN VALUE" The return value is <= 0 on error, otherwise it is the netlink sequence id number. This function can have any error that sendto would encounter. .SH "SEE ALSO" .BR audit_set_backlog_limit (3), .BR audit_open (3), .BR auditd (8), .BR auditctl (8). .SH AUTHOR Steve Grubb audit-4.0.2/docs/audit_encode_value.30000644001034500103450000000141514655201403013140 .TH "AUDIT_ENCODE_VALUE" "3" "May 2021" "Red Hat" "Linux Audit API" .SH NAME audit_encode_value \- encode input string to ASCII code string .SH "SYNOPSIS" .nf .B #include .PP .BI "char *audit_encode_value(char *" final ", const char *" buf ", unsigned int " size "); .fi .SH "DESCRIPTION" .BR audit_encode_value () encodes a string given by .I buf to a ASCII code string. .I final is the hexadecimal string encoded to ASCII code. .I size is the length of the string given by .IR buf . e.g.: "foo bar" is encoded as "666F6F20626172". "\\1\\2\\3\\4" is encoded as "01020304". .SH "RETURN VALUE" Returns a encoded string same as .I final or, NULL on error. .SH "SEE ALSO" .BR audit_encode_nv_string (3), .BR audit_value_needs_encoding (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/audit_set_rate_limit.30000644001034500103450000000135514655201403013516 .TH "AUDIT_SET_RATE_LIMIT" "3" "Oct 2006" "Red Hat" "Linux Audit API" .SH NAME audit_set_rate_limit \- Set audit rate limit .SH "SYNOPSIS" .B #include .sp int audit_set_rate_limit(int fd, uint32_t limit); .SH "DESCRIPTION" audit_set_rate_limit will set the maximum number of messages that the kernel will send per second. This can be used to throttle the rate if systems become unresponsive. Of course the trade off is that events will be dropped. The default value is 0, meaning no limit. .SH "RETURN VALUE" The return value is <= 0 on error, otherwise it is the netlink sequence id number. This function can have any error that sendto would encounter. .SH "SEE ALSO" .BR audit_open (3), .BR auditd (8). .SH AUTHOR Steve Grubb audit-4.0.2/docs/audit_encode_nv_string.30000644001034500103450000000311614655201403014035 .TH "AUDIT_ENCODE_NV_STRING" "3" "Oct 2010" "Red Hat" "Linux Audit API" .SH NAME audit_encode_nv_string \- encode a name/value pair in a string .SH SYNOPSIS .B #include .sp .B char *audit_encode_nv_string(const char *name, const char *value, unsigned int vlen) .SH DESCRIPTION This function is used to encode a name/value pair. This should be used on any field being logged that potentially contains a space, a double-quote, or a control character. Any value containing those have to be specially encoded for the auparse library to correctly handle the value. The encoding method is designed to prevent log injection attacks where malicious values could cause parsing errors. To use this function, pass the name string and value strings on their respective arguments. If the value is likely to have a NUL value embedded within it, you will need to pass a value length that tells in bytes how big the value is. Otherwise, you can pass a 0 for vlen and the function will simply use strlen against the value pointer. Also be aware that the name of the field will cause auparse to do certain things when interpreting the value. If the name is uid, a user id value in decimal is expected. Make sure that well known names are used for their intended purpose or that there is no chance of name collision with something new. .SH "RETURN VALUE" Returns a freshly malloc'ed string that the caller must free or NULL on error. .SH "SEE ALSO" .BR audit_log_user_message (3), .BR audit_log_user_comm_message (3), .BR audit_log_user_avc_message (3), .BR audit_log_semanage_message (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/auparse_normalize.30000644001034500103450000000164514655201403013046 .TH "AUPARSE_NORMALIZE" "3" "Feb 2017" "Red Hat" "Linux Audit API" .SH NAME auparse_normalize \- normalize the current event .SH "SYNOPSIS" .B #include .sp .B int auparse_normalize(auparse_state_t *au, normalize_option_t opt); .SH "DESCRIPTION" .B auparse_normalize analyzes the current event so that the important information about the event can be accessed through a normalized API which positions to internal field cursor to the exact record and field when asked about specific information. The auparse_normalize function takes an opt argument to tell it how much information to gather. Legal values are: .nf NORM_OPT_ALL - gather maximum information NORM_OPT_NO_ATTRS - do not gather subject/object attribute information .fi .SH "RETURN VALUE" Returns 0 on success and 1 on error. .SH "SEE ALSO" .BR auparse_normalize_subject_primary (3) , .BR auparse_normalize_object_primary (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/auparse_get_num_fields.30000644001034500103450000000077214655201403014032 .TH "AUPARSE_GET_NUM_FIELDS" "3" "Feb 2007" "Red Hat" "Linux Audit API" .SH NAME auparse_get_num_fields \- get the number of fields .SH "SYNOPSIS" .B #include .sp unsigned int auparse_get_num_fields(const auparse_state_t *au); .SH "DESCRIPTION" auparse_get_num_fields gets the number of fields in the current record of the current event. .SH "RETURN VALUE" Returns 0 if an error occurs; otherwise, the number of fields. .SH "SEE ALSO" .BR auparse_next_record (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/auparse_next_event.30000644001034500103450000000110614655201403013215 .TH "AUPARSE_NEXT_EVENT" "3" "Feb 2007" "Red Hat" "Linux Audit API" .SH NAME auparse_next_event \- get the next event .SH "SYNOPSIS" .B #include .sp int auparse_next_event(auparse_state_t *au); .SH "DESCRIPTION" auparse_next_event will position the cursors at the first field of the first record of the next event in a file or buffer. It does not skip events or honor any search criteria that may be stored. .SH "RETURN VALUE" Returns \-1 if an error occurs, 0 if there's no data, 1 for success. .SH "SEE ALSO" .BR auparse_next_record (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/audit_setloginuid.30000644001034500103450000000163214655201403013036 .TH "AUDIT_SETLOGINUID" "3" "Oct 2006" "Red Hat" "Linux Audit API" .SH NAME audit_setloginuid \- Set a program's loginuid value .SH SYNOPSIS .B #include .sp int audit_setloginuid(uid_t uid); .SH "DESCRIPTION" This function sets the task attribute loginuid with the value of uid. The loginuid value may only be set by programs with the CAP_AUDIT_CONTROL capability. This normally means the root account. .sp The loginuid value is part of the task structure and is inherited by child processes. It is used to track what account a user gained system access with. All system entry point programs should set this value right before changing to the uid of the user granted access so that audit events are properly attributed to the that user. .SH "RETURN VALUE" This function returns 0 on success and non-zero otherwise. .SH "SEE ALSO" .BR audit_getloginuid (3), .BR pam_loginuid (8). .SH AUTHOR Steve Grubb audit-4.0.2/docs/auparse_get_serial.30000644001034500103450000000113214655201403013153 .TH "AUPARSE_GET_SERIAL" "3" "Sept 2007" "Red Hat" "Linux Audit API" .SH NAME auparse_get_serial \- get the event's serial number .SH "SYNOPSIS" .B #include .sp unsigned long auparse_get_serial(const auparse_state_t *au); .SH "DESCRIPTION" auparse_get_serial gets the serial number value from the current event's timestamp data structure. .SH "RETURN VALUE" Returns 0 if an error occurs; otherwise, the serial number for the event. .SH "SEE ALSO" .BR auparse_get_timestamp (3), .BR auparse_get_time (3), .BR auparse_get_milli (3). .BR auparse_get_node (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/audit_getloginuid.30000644001034500103450000000133514655201403013022 .TH "AUDIT_GETLOGINUID" "3" "Oct 2006" "Red Hat" "Linux Audit API" .SH NAME audit_getloginuid \- Get a program's loginuid value .SH SYNOPSIS .B #include .sp uid_t audit_getloginuid(void); .SH DESCRIPTION This function returns the task attribute loginuid. .SH "RETURN VALUE" This function returns the loginuid value if it was set. It will return a \-1 if loginuid was unset. However, since uid_t is an unsigned type, you will see the converted value instead of \-1. .SH "ERRORS" This function returns \-1 on failure. However, in the event of a real error, errno would be set. The function can set errno based on failures of open, read, or strtoul. .SH "SEE ALSO" .BR audit_setloginuid (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/audit_flag_to_name.30000644001034500103450000000142614655201403013124 .TH "AUDIT_FLAG_TO_NAME" "3" "Mar 2022" "Red Hat" "Linux Audit API" .SH NAME audit_flag_to_name \- Convert the numeric rule-matching filter value to the rule-matching filter name .SH "SYNOPSIS" .nf .B #include .PP .BI "const char *audit_flag_to_name(int " flag ); .fi .SH "DESCRIPTION" .BR audit_flag_to_name () converts the numeric rule-matching filter value (AUDIT_FILTER_TASK, AUDIT_FILTER_EXIT, AUDIT_FILTER_USER, AUDIT_FILTER_EXCLUDE, AUDIT_FILTER_FS) to the rule-matching filter name ("task", "exit", "user", "exclude", "filesystem"). .I flag is the numeric rule-matching filter value. .SH "RETURN VALUE" Returns NULL if an error occurs; otherwise, the return value is the rule-matching filter name. .SH "SEE ALSO" .BR audit_name_to_flag (3), .SH AUTHOR Steve Grubb audit-4.0.2/docs/audit_log_user_avc_message.30000644001034500103450000000240214655201403014660 .TH "AUDIT_LOG_USER_AVC_MESSAGE" "3" "Oct 2006" "Red Hat" "Linux Audit API" .SH NAME audit_log_user_avc_message \- log a user avc message .SH SYNOPSIS .B #include .sp .B int audit_log_user_avc_message(int audit_fd, int type, const char *message, const char *hostname, const char *addr, const char *tty, uid_t auid) .SH DESCRIPTION This function will log a message to the audit system using a predefined message format. This function should be used by all apps that are SE Linux object managers. The function parameters are as follows: .nf audit_fd - The fd returned by audit_open type - type of message, ex: AUDIT_USER_AVC message - the message being sent hostname - the hostname if known addr - The network address of the user tty - The tty of the user, if NULL will attempt to figure out auid - The auid of the person related to the avc message .fi These values should correspond to who the message is about. .SH "RETURN VALUE" It returns the sequence number which is > 0 on success or <= 0 on error. .SH "ERRORS" This function returns \-1 on failure. Examine errno for more info. .SH "SEE ALSO" .BR audit_log_user_message (3), .BR audit_log_acct_message (3), .BR audit_log_user_comm_message (3), .BR audit_log_semanage_message (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/auditctl.80000644001034500103450000005062014655201403011141 .TH AUDITCTL "8" "Sep 2023" "Red Hat" "System Administration Utilities" .SH NAME auditctl \- a utility to assist controlling the kernel's audit system .SH SYNOPSIS \fBauditctl\fP [\fIoptions\fP] .SH DESCRIPTION The \fBauditctl\fP program is used to configure kernel options related to auditing, to see status of the configuration, and to load discretionary audit rules. .SH CONFIGURATION OPTIONS .TP .BI \-b\ backlog Set max number (limit) of outstanding audit buffers allowed (Kernel Default=64) If all buffers are full, the failure flag is consulted by the kernel for action. .TP .BI \-\-backlog_wait_time \ \fIwait_time\fP Set the time for the kernel to wait (Kernel Default 60*HZ) when the backlog limit is reached before queuing more audit events to be transferred to auditd. The number must be greater than or equal to zero and less than 10 times the default value. .TP .BI \-\-reset_backlog_wait_time_actual Reset the actual backlog wait time counter shown by the status command. .TP .B \-c Continue loading rules in spite of an error. This summarizes the results of loading the rules. The exit code will not be success if any rule fails to load. .TP .B \-D Delete all rules and watches. This can take a key option (\-k), too. .TP \fB\-e\fP [\fB0\fP..\fB2\fP] Set enabled flag. When \fB0\fP is passed, this can be used to temporarily disable auditing. When \fB1\fP is passed as an argument, it will enable auditing. To lock the audit configuration so that it can't be changed, pass a \fB2\fP as the argument. Locking the configuration is intended to be the last command in audit.rules for anyone wishing this feature to be active. Any attempt to change the configuration in this mode will be audited and denied. The configuration can only be changed by rebooting the machine. .TP \fB\-f\fP [\fB0\fP..\fB2\fP] Set failure mode \fB0\fP=silent \fB1\fP=printk \fB2\fP=panic. This option lets you determine how you want the kernel to handle critical errors. Example conditions where this mode may have an effect includes: transmission errors to userspace audit daemon, backlog limit exceeded, out of kernel memory, and rate limit exceeded. The default value is \fB1\fP. Secure environments will probably want to set this to \fB2\fP. .TP .B \-h Help .TP .B \-i When given by itself, ignore errors when reading rules from a file. This causes auditctl to always return a success exit code. If passed as an argument to .B \-s then it gives an interpretation of the numbers to human readable words if possible. .TP .BI \-\-loginuid-immutable This option tells the kernel to make loginuids unchangeable once they are set. Changing loginuids requires CAP_AUDIT_CONTROL. So, its not something that can be done by unprivileged users. Setting this makes loginuid tamper-proof, but can cause some problems in certain kinds of containers. .TP .BI \-q\ mount-point,subtree If you have an existing directory watch and bind or move mount another subtree in the watched subtree, you need to tell the kernel to make the subtree being mounted equivalent to the directory being watched. If the subtree is already mounted at the time the directory watch is issued, the subtree is automatically tagged for watching. Please note the comma separating the two values. Omitting it will cause errors. .TP .BI \-r\ rate Set limit in messages/sec (\fB0\fP=none). If this \fIrate\fP is non-zero and is exceeded, the failure flag is consulted by the kernel for action. The default value is \fB0\fP. .TP .BI \-\-reset-lost Reset the lost record counter shown by the status command. .TP .BI \-R\ file Read and execute auditctl commands from a \fIfile\fP. The commands are executed line-by-line, in the order that they appear in the file. The file must be owned by root and not readable by other users, or else it will be rejected. Empty lines are skipped. Lines starting with the '#' character are treated as comment lines. Each line is executed as if it was provided to auditctl as command line arguments. Since auditctl is the one reading the file and not a shell such as bash, do not escape special shell characters. See the EXAMPLES section for an example. .TP .BI \-\-signal\ signal Send a signal to the audit daemon. You must have privileges to do this. Supported signals are .I TERM, HUP, USR1, USR2, CONT and user friendly versions .I stop, reload, rotate, resume, state. .TP .BI \-t Trim the subtrees after a mount command. .SH STATUS OPTIONS .TP .B \-l List all rules 1 per line. Two more options may be given to this command. You can give either a key option (\-k) to list rules that match a key or a (\-i) to have a0 through a3 interpreted to help determine the syscall argument values are correct . .TP .BI \-m\ text Send a user space message into the audit system. This can only be done if you have CAP_AUDIT_WRITE capability (normally the root user has this). The resulting event will be the USER type. .TP .B \-s Report the kernel's audit subsystem status. It will tell you the in-kernel values that can be set by \fB-e\fP, \fB-f\fP, \fB-r\fP, and \fB-b\fP options. The pid value is the process number of the audit daemon. Note that a pid of 0 indicates that the audit daemon is not running. The lost entry will tell you how many event records that have been discarded due to the kernel audit queue overflowing. The backlog field tells how many event records are currently queued waiting for auditd to read them. This option can be followed by the \fB-i\fP to get a couple fields interpreted. .TP .BI \-v Print the version of auditctl. .SH RULE OPTIONS .TP .BI \-a\ [ list,action | action,list ] Append rule to the end of \fIlist\fP with \fIaction\fP. Please note the comma separating the two values. Omitting it will cause errors. The fields may be in either order. It could be list,action or action,list. The following describes the valid \fIlist\fP names: .RS .TP 12 .B task Add a rule to the per task list. This rule list is used only at the time a task is created -- when fork() or clone() are called by the parent task. When using this list, you should only use fields that are known at task creation time, such as the uid, gid, etc. .TP .B exit Add a rule to the syscall exit list. This list is used upon exit from a system call to determine if an audit event should be created. .TP .B user Add a rule to the user message filter list. This list is used by the kernel to filter events originating in user space before relaying them to the audit daemon. It should be noted that the only fields that are valid are: uid, auid, gid, pid, subj_user, subj_role, subj_type, subj_sen, subj_clr, msgtype, and executable name. All other fields will be treated as non-matching. It should be understood that any event originating from user space from a process that has CAP_AUDIT_WRITE will be recorded into the audit trail. This means that the most likely use for this filter is with rules that have an action of never since nothing has to be done to allow events to be recorded. .TP .B exclude Add a rule to the event type exclusion filter list. This list is used to filter events that you do not want to see. For example, if you do not want to see any avc messages, you would using this list to record that. Events can be excluded by process ID, user ID, group ID, login user ID, message type, subject context, or executable name. The action is ignored and uses its default of "never". .TP .B filesystem Add a rule that will be applied to a whole filesystem. The filesystem must be identified with a fstype field. Normally this filter is used to exclude any events for a whole filesystem such as tracefs or debugfs. .TP .B io_uring Add a rule to the io_uring syscall filter. Rules against this filter specify the syscall operation using the -S syscall notion explained below. You can add a key field to the rule so that it may be grouped with other rules watching the same underlying syscall. .RE The following describes the valid \fIactions\fP for the rule: .RS .TP 12 .B never No audit records will be generated. This can be used to suppress event generation. In general, you want suppressions at the top of the list instead of the bottom. This is because the event triggers on the first matching rule. .TP .B always Allocate an audit context, always fill it in at syscall entry time, and always write out a record at syscall exit time. .RE .TP .BI \-A\ list , action Add rule to the beginning \fIlist\fP with \fIaction\fP. .TP \fB\-C\fP [\fIf\fP\fB=\fP\fIf\fP | \fIf\fP\fB!=\fP\fIf\fP] Build an inter-field comparison rule: field, operation, field. You may pass multiple comparisons on a single command line. Each one must start with \fB\-C\fP. Each inter-field equation is anded with each other as well as equations starting with \fB\-F\fP to trigger an audit record. There are 2 operators supported - equal, and not equal. Valid fields are: .RS .TP 12 .B auid, uid, euid, suid, fsuid, obj_uid; and gid, egid, sgid, fsgid, obj_gid .RE .RS The two groups of uid and gid cannot be mixed. But any comparison within the group can be made. The obj_uid/gid fields are collected from the object of the event such as a file or directory. .RE .TP .BI \-d\ list , action Delete rule from \fIlist\fP with \fIaction\fP. The rule is deleted only if it exactly matches syscall name(s) and every field name and value. .TP \fB\-F\fP [\fIn\fP\fB=\fP\fIv\fP | \fIn\fP\fB!=\fP\fIv\fP | \fIn\fP\fB<\fP\fIv\fP | \fIn\fP\fB>\fP\fIv\fP | \fIn\fP\fB<=\fP\fIv\fP | \fIn\fP\fB>=\fP\fIv\fP | \fIn\fP\fB&\fP\fIv\fP | \fIn\fP\fB&=\fP\fIv\fP] Build a rule field: name, operation, value. You may have up to 64 fields passed on a single command line. Each one must start with \fB\-F\fP. Each field equation is anded with each other (as well as equations starting with \fB\-C\fP) to trigger an audit record. There are 8 operators supported - equal, not equal, less than, greater than, less than or equal, and greater than or equal, bit mask, and bit test respectively. Bit test will "and" the values and check that they are equal, bit mask just "ands" the values. Fields that take a user ID may instead have the user's name; the program will convert the name to user ID. The same is true of group names. Valid fields are: .RS .TP 12 .B a0, a1, a2, a3 Respectively, the first 4 arguments to a syscall. Note that string arguments are not supported. This is because the kernel is passed a pointer to the string. Triggering on a pointer address value is not likely to work. So, when using this, you should only use on numeric values. This is most likely to be used on platforms that multiplex socket or IPC operations. .TP .B arch The CPU architecture of the syscall. The arch can be found doing 'uname \-m'. If you do not know the arch of your machine but you want to use the 32 bit syscall table and your machine supports 32 bit, you can also use .B b32 for the arch. The same applies to the 64 bit syscall table, you can use .B b64. In this way, you can write rules that are somewhat arch independent because the family type will be auto detected. However, syscalls can be arch specific and what is available on x86_64, may not be available on ppc. The arch directive should precede the \-S option so that auditctl knows which internal table to use to look up the syscall numbers. .TP .B auid The original ID the user logged in with. Its an abbreviation of audit uid. Sometimes its referred to as loginuid. Either the user account text or number may be used. .TP .B devmajor Device Major Number .TP .B devminor Device Minor Number .TP .B dir Full Path of Directory to watch. This will place a recursive watch on the directory and its whole subtree. It can only be used on exit list. See "\fB\-w\fP". .TP .B egid Effective Group ID. May be numeric or the groups name. .TP .B euid Effective User ID. May be numeric or the user account name. .TP .B exe Absolute path to application that while executing this rule will apply to. It supports = and != operators. Note that you can only use this once for each rule. .TP .B exit Exit value from a syscall. If the exit code is an errno, you may use the text representation, too. .TP .B fsgid Filesystem Group ID. May be numeric or the groups name. .TP .B fstype File system type. This is used with the filesystem rule list. The only values supported are debugfs and tracefs. .TP .B fsuid Filesystem User ID. May be numeric or the user account name. .TP .B filetype The target file's type. Can be either file, dir, socket, link, character, block, or fifo. .TP .B gid Group ID. May be numeric or the groups name. .TP .B inode Inode Number .TP .B key Set a filter key on an audit rule. The filter key is an arbitrary string of text that can be up to 31 bytes long. It can uniquely identify the audit records produced by a rule. Typical use is for when you have several rules that together satisfy a security requirement. The key value can be searched on with ausearch so that no matter which rule triggered the event, you can find its results. The key can also be used on delete all (\-D) and list rules (\-l) to select rules with a specific key. You may have more than one key on a rule if you want to be able to search logged events in multiple ways or if you have an auditd plugin that uses a key to aid its analysis. .TP .B msgtype This is used to match the event's record type. It should only be used on the exclude or user filter lists. .TP .B obj_uid Object's UID .TP .B obj_gid Object's GID .TP .B obj_user Resource's SE Linux User .TP .B obj_role Resource's SE Linux Role .TP .B obj_type Resource's SE Linux Type .TP .B obj_lev_low Resource's SE Linux Low Level .TP .B obj_lev_high Resource's SE Linux High Level .TP .B path Insert a watch for the file system object at \fIpath\fP. You cannot insert a watch to the top level directory. This is prohibited by the kernel. Wildcards are not supported either and will generate a warning. The way that watches work is by tracking the inode internally. This can only be used on exit list. .TP .B perm Permission filter for file operations. Supply the access type that a file system watch will trigger on. \fBr\fP=read, \fBw\fP=write, \fBx\fP=execute, \fBa\fP=attribute change. These permissions are not the standard file permissions, but rather the kind of syscall that would do this kind of thing. The read & write syscalls are omitted from this set since they would overwhelm the logs. But rather for reads or writes, the open flags are looked at to see what permission was requested. The perm field can only be used on exit list. You can use this without specifying a syscall and the kernel will select the syscalls that satisfy the access permissions being requested. This also requires supplying an arch parameter before the perm field. This way the kernel can better determine what syscalls are needed. Not supplying an arch will result in .B all system calls being subject to audit. This will lower system performance. .TP .B pers OS Personality Number .TP .B pid Process ID .TP .B ppid Parent's Process ID .TP .B saddr_fam Address family number as found in /usr/include/bits/socket.h. For example, IPv4 would be 2 and IPv6 would be 10. .TP .B sessionid User's login session ID .TP .B subj_user Program's SE Linux User .TP .B subj_role Program's SE Linux Role .TP .B subj_type Program's SE Linux Type .TP .B subj_sen Program's SE Linux Sensitivity .TP .B subj_clr Program's SE Linux Clearance .TP .B sgid Saved Group ID. See getresgid(2) man page. .TP .B success If the exit value is >= 0 this is true/yes otherwise its false/no. When writing a rule, use a 1 for true/yes and a 0 for false/no .TP .B suid Saved User ID. See getresuid(2) man page. .TP .B uid User ID. May be numeric or the user account name. .RE .TP .BI \-k\ key Set a filter key on an audit rule. This is deprecated when used with watches. Convert any watches to the syscall form of rules. It is still valid for use with deleting or listing rules. .TP \fB\-p\fP [\fBr\fP|\fBw\fP|\fBx\fP|\fBa\fP] Describe the permission access type that a file system watch will trigger on. This is deprecated. Convert watches to the syscall form. .TP \fB\-S\fP [\fISyscall name or number\fP|\fBall\fP] Any \fIsyscall name\fP or \fInumber\fP may be used. The word '\fBall\fP' may also be used. If the given syscall is made by a program, then start an audit record. If a field rule is given and no syscall is specified, it will default to all syscalls. You may also specify multiple syscalls in the same rule by using multiple \-S options in the same rule. Doing so improves performance since fewer rules need to be evaluated. Alternatively, you may pass a comma separated list of syscall names. If you are on a bi-arch system, like x86_64, you should be aware that auditctl simply takes the text, looks it up for the native arch (in this case b64) and sends that rule to the kernel. If there are no additional arch directives, IT WILL APPLY TO BOTH 32 & 64 BIT SYSCALLS. This can have undesirable effects since there is no guarantee that any syscall has the same number on both 32 and 64 bit interfaces. You will likely want to control this and write 2 rules, one with arch equal to b32 and one with b64 to make sure the kernel finds the events that you intend. See the arch field discussion for more info. .TP .BI \-w\ path Place a watch on path. If the path is a file, it's almost the same as using the \-F path option on a syscall rule. If the watch is on a directory, it's almost the same as using the \-F dir option on a syscall rule. The \-w form of writing watches is for backwards compatibility and is .B deprecated due to poor system performance. Convert watches of this form to the syscall based form. The only valid options when using a watch are the \-p and \-k. .TP .BI \-W\ path Remove a watch for the file system object at \fIpath\fP. The rule must match exactly. See \fB-d\fP discussion for more info. .SH "PERFORMANCE TIPS" Syscall rules get evaluated for each syscall for every program. If you have 10 syscall rules, every program on your system will delay during a syscall while the audit system evaluates each rule. Too many syscall rules will hurt performance. Try to combine as many as you can whenever the filter, action, key, and fields are identical. For example: .nf .B auditctl \-a always,exit \-F arch=b64 \-S openat \-F success=0 .fi .nf .B auditctl \-a always,exit \-F arch=b64 \-S truncate \-F success=0 .fi could be re-written as one rule: .nf .B auditctl \-a always,exit \-F arch=b64 \-S openat \-S truncate \-F success=0 .fi Also, try to use file system auditing wherever practical. This improves performance. For example, if you were wanting to capture all failed opens & truncates like above, but were only concerned about files in /etc and didn't care about /usr or /sbin, its possible to use this rule: .nf .B auditctl \-a always,exit \-F arch=b64 \-S openat,truncate \-F dir=/etc \-F success=0 .fi This will be higher performance since the kernel will not evaluate it each and every syscall. It will be handled by the filesystem auditing code and only checked on filesystem related syscalls. .SH "EXAMPLES" To see all syscalls made by a specific program: .nf # By pid: .B auditctl \-a always,exit \-S all \-F pid=1005 # By executable path .B auditctl \-a always,exit \-S all \-F exe=/usr/bin/ls .fi To see files opened by a specific user: .nf .B auditctl \-a always,exit \-S openat \-F auid=510 .fi To see unsuccessful openat calls: .nf .B auditctl \-a always,exit \-S openat \-F success=0 .fi To watch a file for changes (2 ways to express): .nf .B auditctl \-w /etc/shadow \-p wa # Note this slows the system .B auditctl \-a always,exit \-F arch=b64 \-F path=/etc/shadow \-F perm=wa .fi To recursively watch a directory for changes (2 ways to express): .nf .B auditctl \-w /etc/ \-p wa # Note this slows the system .B auditctl \-a always,exit \-F arch=b64 \-F dir=/etc/ \-F perm=wa .fi To see if an admin is accessing other user's files: .nf .B auditctl \-a always,exit \-F dir=/home/ \-F uid=0 \-C auid!=obj_uid .fi This is an example rules file: .nf # Remove all existing rules \-D # Never record sudo invocations \-A exclude,always \-F exe=/usr/bin/sudo .fi .SH DISABLED BY DEFAULT On many systems auditd is configured to install an .B -a never,task rule by default. This rule causes every new process to skip all audit rule processing. This is usually done to avoid a small performance overhead imposed by syscall auditing. If you want to use auditd, you need to remove that rule by deleting 10-no-audit.rules and adding 10-base-config.rules to the audit rules directory. If you have defined audit rules that are not matching when they should, check auditctl -l to make sure there is no never,task rule there. .SH FILES .TP .I /etc/audit/audit.rules /etc/audit/audit-stop.rules .SH "SEE ALSO" .BR audit.rules (7), .BR ausearch(8), .BR aureport(8), .BR auditd (8). .SH AUTHOR Steve Grubb audit-4.0.2/docs/augenrules.80000644001034500103450000000304514655201403011501 .TH AUGENRULES "8" "Apr 2013" "Red Hat" "System Administration Utilities" .SH NAME augenrules \- a script that merges component audit rule files .SH SYNOPSIS .B augenrules .RI [ \-\-check ]\ [ \-\-load ] .SH DESCRIPTION \fBaugenrules\fP is a script that merges all component audit rules files, found in the audit rules directory, \fI/etc/audit/rules.d\fP, placing the merged file in \fI/etc/audit/audit.rules\fP. Component audit rule files, must end in \fI.rules\fP in order to be processed. All other files in \fI/etc/audit/rules.d\fP are ignored. .P The files are concatenated in order, based on their natural sort (see -v option of ls(1)) and stripped of empty and comment (#) lines. .P The last processed -\fID\fP directive without an option, if present, is always emitted as the first line in the resultant file. Those with an option are replicated in place. The last processed -\fIb\fP directive, if present, is always emitted as the second line in the resultant file. The last processed -\fIf\fP directive, if present, is always emitted as the third line in the resultant file. The last processed -\fIe\fP directive, if present, is always emitted as the last line in the resultant file. .P The generated file is only copied to \fI/etc/audit/audit.rules\fP, if it differs. .SH OPTIONS .TP .B \-\-check test if rules have changed and need updating without overwriting audit.rules. .TP .B \-\-load load old or newly built rules into the kernel. .SH FILES /etc/audit/rules.d/ /etc/audit/audit.rules .SH "SEE ALSO" .BR audit.rules (7), .BR auditctl (8), .BR auditd (8). audit-4.0.2/docs/audit_add_watch.30000644001034500103450000000120014655201403012415 .TH "AUDIT_ADD_WATCH" "3" "Feb 2007" "Red Hat" "Linux Audit API" .SH NAME audit_add_watch \- create a rule layout for a watch .SH "SYNOPSIS" .B #include .sp int audit_add_watch(struct audit_rule_data **rulep, const char *path); .SH "DESCRIPTION" audit_add_watch will create a watch rule in the pointer to a pointer rulep. All that you need to pass it is the full path to a file and it will initialize the audit_rule_data structure for a watch. .SH "RETURN VALUE" Returns \-1 if an error occurs; otherwise, 0 for success. .SH "SEE ALSO" .BR audit_add_rule_data (3), .BR audit_delete_rule_data (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/auparse_get_type_name.30000644001034500103450000000107714655201403013665 .TH "AUPARSE_GET_TYPE_NAME" "3" "Mar 2016" "Red Hat" "Linux Audit API" .SH NAME auparse_get_type_name \- get record's type translation .SH "SYNOPSIS" .B #include .sp const char *auparse_get_type_name(const auparse_state_t *au); .SH "DESCRIPTION" The auparse_get_type_name function will return the text representation of the name of the current record type. .SH "RETURN VALUE" The auparse_get_type_name function returns NULL on error; otherwise a pointer to a string. .SH "SEE ALSO" .BR auparse_get_type (3), auparse_next_record (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/auparse_get_filename.30000644001034500103450000000120714655201403013457 .TH "AUPARSE_GET_FILENAME" "3" "Feb 2007" "Red Hat" "Linux Audit API" .SH NAME auparse_get_filename \- get the filename where record was found .SH "SYNOPSIS" .B #include .sp const char *auparse_get_filename(const auparse_state_t *au); .SH "DESCRIPTION" auparse_get_filename will return the name of the source file where the record was found if the source type is AUSOURCE_FILE or AUSOURCE_FILE_ARRAY. For other source types the return value will be NULL. .SH "RETURN VALUE" Returns pointer to a filename or NULL if unavailable. .SH "SEE ALSO" .BR auparse_get_line_number (3). .BR auparse_next_record (3). .SH AUTHOR John Dennis audit-4.0.2/docs/auparse_get_time.30000644001034500103450000000113414655201403012634 .TH "AUPARSE_GET_TIME" "3" "Sept 2007" "Red Hat" "Linux Audit API" .SH NAME auparse_get_time \- get event's time .SH "SYNOPSIS" .B #include .sp time_t auparse_get_time(const auparse_state_t *au); .SH "DESCRIPTION" auparse_get_time will access just the time portion of the timestamp data structure for the current event. .SH "RETURN VALUE" Returns 0 if an error occurs; otherwise, the valid time value in time_t format. .SH "SEE ALSO" .BR time (3), .BR auparse_get_timestamp (3), .BR auparse_get_milli (3). .BR auparse_get_serial (3). .BR auparse_get_node (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/audit_update_watch_perms.30000644001034500103450000000123314655201403014363 .TH "AUDIT_UPDATE_WATCH_PERMS" "3" "Feb 2007" "Red Hat" "Linux Audit API" .SH NAME audit_update_watch_perms \- update permissions field of watch command .SH "SYNOPSIS" .B #include .sp int audit_update_watch_perms(struct audit_rule_data *rule, int perms); .SH "DESCRIPTION" audit_update_watch_perms adds the permission checks to a watch command that is being built. The perms are a bitwise or'ing of: AUDIT_PERM_EXEC, AUDIT_PERM_WRITE, AUDIT_PERM_READ, AUDIT_PERM_ATTR. .SH "RETURN VALUE" Returns a number < 0 if an error occurs; otherwise, 0 for success. .SH "SEE ALSO" .BR audit_add_rule_data (3), .BR audit_add_watch (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/auparse_get_field_num.30000644001034500103450000000131214655201403013636 .TH "AUPARSE_GET_FIELD_NUM" "3" "Dec 2016" "Red Hat" "Linux Audit API" .SH NAME auparse_get_field_num \- get current field cursor location .SH "SYNOPSIS" .B #include .sp unsigned int auparse_get_field_num(const auparse_state_t *au); .SH "DESCRIPTION" auparse_get_field_num will retrieve the internal library cursors current field location in the current record. Fields within the same record are numbered starting from 0. This is generally not needed but there are some cases where one may want to know the exact field being looked at. .SH "RETURN VALUE" Returns the current field cursor location. .SH "SEE ALSO" .BR auparse_goto_field_num (3), auparse_get_record_num (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/audit_request_status.30000644001034500103450000000221714655201403013603 .TH "AUDIT_REQUEST_STATUS" "3" "Oct 2006" "Red Hat" "Linux Audit API" .SH NAME audit_request_status \- Request status of the audit system .SH "SYNOPSIS" .B #include .sp int audit_request_status(int fd); .SH "DESCRIPTION" .PP audit_request_status requests that the kernel send status structure describing various settings. The audit_status structure is as follows: .RS .ta 4n 10n 24n .nf struct audit_status { __u32 mask; /* Bit mask for valid entries */ __u32 enabled; /* 1 = enabled, 0 = disabled */ __u32 failure; /* Failure-to-log action */ __u32 pid; /* pid of auditd process */ __u32 rate_limit; /* messages rate limit (per second) */ __u32 backlog_limit; /* waiting messages limit */ __u32 lost; /* messages lost */ __u32 backlog; /* messages waiting in queue */ }; .fi .ta .RE .SH "RETURN VALUE" The return value is <= 0 on error, otherwise it is the netlink sequence id number. This function can have any error that sendto would encounter. .SH "SEE ALSO" .BR audit_open (3), .BR audit_get_reply (3), .BR auditd (8). .SH AUTHOR Steve Grubb audit-4.0.2/docs/audit_is_enabled.30000644001034500103450000000104114655201403012567 .TH "AUDIT_IS_ENABLED" "3" "May 2021" "Red Hat" "Linux Audit API" .SH NAME audit_is_enabled \- judge whether auditing is enabled or not .SH "SYNOPSIS" .nf .B #include .PP .BI "int audit_is_enabled(int " fd "); .fi .SH "DESCRIPTION" .BR audit_is_enabled () judges whether auditing is enabled or not. .I fd must have been returned by .BR audit_open (3). .SH "RETURN VALUE" This function will return 0 if auditing is NOT enabled and 1 if enabled, and -1 on error. .SH "SEE ALSO" .BR audit_set_enabled (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/audit_delete_rule_data.30000644001034500103450000000136514655201403013775 .TH "AUDIT_DELETE_RULE_DATA" "3" "Oct 2006" "Red Hat" "Linux Audit API" .SH NAME audit_delete_rule_data \- Delete audit rule .SH "SYNOPSIS" .B #include .sp int audit_delete_rule_data(int fd, struct audit_rule_data *rule, int flags, int action); .SH "DESCRIPTION" audit_delete_rule_data is used to delete rules that are currently loaded in the kernel. To delete a rule, you must set up the rules identical to the one being deleted. See audit_add_rule_data for flag and action definitions. .SH "RETURN VALUE" The return value is <= 0 on error, otherwise it is the netlink sequence id number. This function can have any error that sendto would encounter. .SH "SEE ALSO" .BR audit_add_rule_data (3), .BR auditctl (8). .SH AUTHOR Steve Grubb audit-4.0.2/docs/auparse_timestamp_compare.30000644001034500103450000000102714655201403014551 .TH "AUPARSE_TIMESTAMP_COMPARE" "3" "Feb 2007" "Red Hat" "Linux Audit API" .SH NAME auparse_timestamp_compare \- compares timestamp values .SH "SYNOPSIS" .B #include .sp int auparse_timestamp_compare(const au_event_t *e1, const au_event_t *e2); .SH "DESCRIPTION" auparse_timestamp_compare compares the values of 2 timestamps. .SH "RETURN VALUE" Returns \-1, 0, or 1 respectively depending on whether e2 is less than, equal to, or greater than e1. .SH "SEE ALSO" .BR auparse_get_timestamp (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/aureport.80000644001034500103450000001657414655201403011203 .TH AUREPORT "8" "February 2023" "Red Hat" "System Administration Utilities" .SH NAME aureport \- a tool that produces summary reports of audit daemon logs .SH SYNOPSIS .B aureport .RI [ options ] .SH DESCRIPTION \fBaureport\fP is a tool that produces summary reports of the audit system logs. The aureport utility can also take input from stdin as long as the input is the raw log data. The reports have a column label at the top to help with interpretation of the various fields. Except for the main summary report, all reports have the audit event number. You can subsequently lookup the full event with ausearch \fB\-a\fP \fIevent number\fP. You may need to specify start & stop times if you get multiple hits. The reports produced by aureport can be used as building blocks for more complicated analysis. .SH OPTIONS .TP .BR \-au ,\ \-\-auth Report about authentication attempts .TP .BR \-a ,\ \-\-avc Report about avc messages .TP .BR \-\-comm Report about commands run .TP .BR \-c ,\ \-\-config Report about config changes .TP .BR \-cr ,\ \-\-crypto Report about crypto events .TP .BR \-\-debug Write malformed events that are skipped to stderr. .TP .BR \-\-eoe\-timeout \ \fIseconds\fP Set the end of event parsing timeout. See \fBend_of_event_timeout\fP in \fIauditd.conf(5)\fP for details. Note that setting this value will override any configured value found in /etc/auditd/auditd.conf. .TP .BR \-e ,\ \-\-event Report about events .TP .BR \-\-escape \ \fIoption\fP This option determines if the output is escaped to make the content safer for certain uses. The options are \fIraw\fP , \fItty\fP , \fIshell\fP , and \fIshell_quote\fP. Each mode includes the characters of the preceding mode and escapes more characters. That is to say \fIshell\fP includes all characters escaped by \fItty\fP and adds more. \fItty\fP is the default. .TP .BR \-f ,\ \-\-file Report about files and af_unix sockets .TP .B \-\-failed Only select failed events for processing in the reports. The default is both success and failed events. .TP .BR \-h ,\ \-\-host Report about hosts .TP .BR \-\-help Print brief command summary .TP .BR \-i ,\ \-\-interpret Interpret numeric entities into text. For example, uid is converted to account name. The conversion is done using the current resources of the machine where the search is being run. If you have renamed the accounts, or don't have the same accounts on your machine, you could get misleading results. .TP .BR \-if ,\ \-\-input \ \fIfile\fP\ |\ \fIdirectory\fP Use the given \fIfile\fP or \fIdirectory\fP instead of the logs. This is to aid analysis where the logs have been moved to another machine or only part of a log was saved. The path length is limited to 4064 bytes. .TP .B \-\-input\-logs Use the log file location from auditd.conf as input for analysis. This is needed if you are using aureport from a cron job. .TP .BR \-\-integrity Report about integrity events .TP .BR \-k ,\ \-\-key Report about audit rule keys .TP .BR \-l ,\ \-\-login Report about logins .TP .BR \-m ,\ \-\-mods Report about account modifications .TP .BR \-ma ,\ \-\-mac Report about Mandatory Access Control (MAC) events .TP .BR \-n ,\ \-\-anomaly Report about anomaly events. These events include NIC going into promiscuous mode and programs segfaulting. .TP .BR \-\-node \ \fInode-name\fP Only select events originating from \fInode name\fP string for processing in the reports. The default is to include all nodes. Multiple nodes are allowed. .TP .BR \-nc ,\ \-\-no-config Do not include the CONFIG_CHANGE event. This is particularly useful for the key report because audit rules have key labels in many cases. Using this option gets rid of these false positives. .TP .BR \-p ,\ \-\-pid Report about processes .TP .BR \-r ,\ \-\-response Report about responses to anomaly events .TP .BR \-s ,\ \-\-syscall Report about syscalls .TP .B \-\-success Only select successful events for processing in the reports. The default is both success and failed events. .TP .B \-\-summary Run the summary report that gives a total of the elements of the main report. Not all reports have a summary. .TP .BR \-t ,\ \-\-log This option will output a report of the start and end times for each log. .TP .BR \-\-tty Report about tty keystrokes .TP .BR \-te ,\ \-\-end \ [\fIend-date\fP]\ [\fIend-time\fP] Search for events with time stamps equal to or before the given end time. The format of end time depends on your locale. If the date is omitted, .B today is assumed. If the time is omitted, .B now is assumed. Use 24 hour clock time rather than AM or PM to specify time. An example date using the en_US.utf8 locale is 09/03/2009. An example of time is 18:00:00. The date format accepted is influenced by the LC_TIME environmental variable. You may also use the word: \fBnow\fP, \fBrecent\fP, \fBthis-hour\fP, \fBboot\fP, \fBtoday\fP, \fByesterday\fP, \fBthis\-week\fP, \fBweek\-ago\fP, \fBthis\-month\fP, \fBthis\-year\fP. \fBNow\fP means starting now. \fBRecent\fP is 10 minutes ago. \fBBoot\fP means the time of day to the second when the system last booted. \fBToday\fP means now. \fBYesterday\fP is 1 second after midnight the previous day. \fBThis\-week\fP means starting 1 second after midnight on day 0 of the week determined by your locale (see \fBlocaltime\fP). \fBWeek\-ago\fP means 1 second after midnight exactly 7 days ago. \fBThis\-month\fP means 1 second after midnight on day 1 of the month. \fBThis\-year\fP means the 1 second after midnight on the first day of the first month. .TP .BR \-tm ,\ \-\-terminal Report about terminals .TP .BR \-ts ,\ \-\-start \ [\fIstart-date\fP]\ [\fIstart-time\fP] Search for events with time stamps equal to or after the given end time. The format of end time depends on your locale. If the date is omitted, .B today is assumed. If the time is omitted, .B midnight is assumed. Use 24 hour clock time rather than AM or PM to specify time. An example date using the en_US.utf8 locale is 09/03/2009. An example of time is 18:00:00. The date format accepted is influenced by the LC_TIME environmental variable. You may also use the word: \fBnow\fP, \fBrecent\fP, \fBthis-hour\fP, \fBboot\fP, \fBtoday\fP, \fByesterday\fP, \fBthis\-week\fP, \fBweek\-ago\fP, \fBthis\-month\fP, \fBthis\-year\fP. \fBBoot\fP means the time of day to the second when the system last booted. \fBToday\fP means starting at 1 second after midnight. \fBRecent\fP is 10 minutes ago. \fBYesterday\fP is 1 second after midnight the previous day. \fBThis\-week\fP means starting 1 second after midnight on day 0 of the week determined by your locale (see \fBlocaltime\fP). \fBWeek\-ago\fP means starting 1 second after midnight exactly 7 days ago. \fBThis\-month\fP means 1 second after midnight on day 1 of the month. \fBThis\-year\fP means the 1 second after midnight on the first day of the first month. .TP .BR \-u ,\ \-\-user Report about users .TP .BR \-v ,\ \-\-version Print the version and exit .TP .BR \-\-virt Report about Virtualization events .TP .BR \-x ,\ \-\-executable Report about executables .SH NOTE The boot time option is a convenience function and has limitations. The time it calculates is based on time now minus /proc/uptime. If after boot the system clock has been adjusted, perhaps by ntp, then the calculation may be wrong. In that case you'll need to fully specify the time. You can check the time it would use by running: date -d "`cut \-f1 \-d. /proc/uptime` seconds ago" .SH "SEE ALSO" .BR ausearch (8), .BR auditd (8), .BR auditd.conf (5). audit-4.0.2/docs/auparse_metrics.30000644001034500103450000000136614655201403012514 .TH "AUPARSE_METRICS" "3" "Sept 2023" "Red Hat" "Linux Audit API" .SH NAME auparse_metrics \- get some metrics about auparse .SH "SYNOPSIS" .B #include .sp char *auparse_metrics(const auparse_state_t *au); .SH "DESCRIPTION" auparse_metrics gets some basic information about auparse's internal state. It returns a character string ready to print. It returns the current limit for storing building events, the maximum events building or ready, and the number of ready events for processing. This information is only useful when the feed api is being used. .SH "RETURN VALUE" Returns a memory buffer of current metrics on success and NULL on error. The caller must free the string. .SH "SEE ALSO" .BR auparse_feed (3) .SH AUTHOR Steve Grubb audit-4.0.2/docs/auparse_get_type.30000644001034500103450000000100014655201403012647 .TH "AUPARSE_GET_TYPE" "3" "Mar 2016" "Red Hat" "Linux Audit API" .SH NAME auparse_get_type \- get record's type .SH "SYNOPSIS" .B #include .sp int auparse_get_type(const auparse_state_t *au); .SH "DESCRIPTION" auparse_get_type will return the integer value for the current record of the current event. .SH "RETURN VALUE" auparse_get_type returns 0 if an error occurs; otherwise, the record's type. .SH "SEE ALSO" .BR auparse_get_type_name (3), auparse_next_record (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/auparse_destroy.30000644001034500103450000000126514655201403012535 .TH "AUPARSE_DESTROY" "3" "Feb 2007" "Red Hat" "Linux Audit API" .SH NAME auparse_destroy \- release instance of parser .SH "SYNOPSIS" .B #include .sp .B void auparse_destroy(auparse_state_t *au); .B void auparse_destroy_ext(auparse_state_t *au, auparse_destroy_what_t what); .SH "DESCRIPTION" .B auparse_destroy frees all data structures and closes file descriptors. .B auparse_destroy_ext frees data structures based on what. What can be AUPARSE_DESTROY_ALL to release everything or AUPARSE_DESTROY_COMMON to release everything but the uid and gid lookup cache. .SH "RETURN VALUE" None. .SH "SEE ALSO" .BR auparse_init (3), .BR auparse_reset (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/audit_set_pid.30000644001034500103450000000172614655201403012143 .TH "AUDIT_SET_PID" "3" "Oct 2006" "Red Hat" "Linux Audit API" .SH NAME audit_set_pid \- Set audit daemon process ID .SH "SYNOPSIS" .B #include .sp int audit_set_pid(int fd, uint32_t pid, rep_wait_t wmode); .SH "DESCRIPTION" audit_set_pid tells the kernel what the pid is of the audit daemon. When the pid is set to 0, the kernel will log all events to syslog. Otherwise it will try to send events to the netlink connection that has the same pid given by this function. If for some reason the process goes away, the kernel will automatically set the value to 0 itself. Usually this function is called by the audit daemon and not an external program. If wmode is WAIT_YES, the function will wait for an ACK from the kernel. .SH "RETURN VALUE" The return value is <= 0 on error, otherwise it is the netlink sequence id number. This function can have any error that sendto would encounter. .SH "SEE ALSO" .BR audit_open (3), .BR auditd (8). .SH AUTHOR Steve Grubb audit-4.0.2/docs/audit_log_user_comm_message.30000644001034500103450000000267414655201403015055 .TH "AUDIT_LOG_USER_COMM_MESSAGE" "3" "July 2016" "Red Hat" "Linux Audit API" .SH NAME audit_log_user_comm_message \- log a user message from a console app .SH SYNOPSIS .B #include .sp int audit_log_user_comm_message(int audit_fd, int type, const char *message, const char *comm, const char *hostname, const char *addr, const char *tty, int result) .SH DESCRIPTION This function will log a message to the audit system using a predefined message format. This function should be used by all non-ELF console apps that do not manipulate accounts, groups, or need to log execution of a script. An example would be a Python script recording an event. The function parameters are as follows: .nf audit_fd - The fd returned by audit_open type - type of message, ex: AUDIT_USYS_CONFIG, AUDIT_USER_LOGIN message - the message text being sent comm - the program command line name, NULL if unknown hostname - the hostname if known, NULL if unknown addr - The network address of the user, NULL if unknown tty - The tty of the user, if NULL will attempt to figure out result - 1 is "success" and 0 is "failed" .fi .SH "RETURN VALUE" It returns the sequence number which is > 0 on success or <= 0 on error. .SH "ERRORS" This function returns \-1 on failure. Examine errno for more info. .SH "SEE ALSO" .BR audit_log_user_message (3), .BR audit_log_acct_message (3), .BR audit_log_user_avc_message (3), .BR audit_log_semanage_message (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/audit_log_user_command.30000644001034500103450000000226114655201403014024 .TH "AUDIT_LOG_USER_COMMAND" "3" "Feb 2007" "Red Hat" "Linux Audit API" .SH NAME audit_log_user_command \- log a user command .SH SYNOPSIS .B #include .sp .B int audit_log_user_command(int audit_fd, int type, const char *command, const char *tty, int result); .SH DESCRIPTION This function will log a command to the audit system using a predefined message format. It encodes the command as the audit system expects for untrusted strings. This function should be used by all apps need to record commands. The function parameters are as follows: .nf audit_fd - The fd returned by audit_open type - type of message, ex: AUDIT_USYS_CONFIG, AUDIT_USER_LOGIN command - the command being logged tty - The tty of the user, if NULL will attempt to figure out result - 1 is "success" and 0 is "failed" .fi .SH "RETURN VALUE" It returns the sequence number which is > 0 on success or <= 0 on error. .SH "ERRORS" This function returns \-1 on failure. Examine errno for more info. .SH "SEE ALSO" .BR audit_log_user_message (3), .BR audit_log_user_comm_message (3), .BR audit_log_acct_message (3), .BR audit_log_user_avc_message (3), .BR audit_log_semanage_message (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/Makefile.in0000644001034500103450000006042014655201422011304 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am -- # Copyright 2004-09,2012,2014-18 Red Hat Inc. # All Rights Reserved. # # 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; see the file COPYING. If not, write to the # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor # Boston, MA 02110-1335, USA. # # Authors: # Steve Grubb # 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@ subdir = docs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prog_cc_for_build.m4 \ $(top_srcdir)/m4/cap-ng.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/src/libev/libev.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man3dir = $(mandir)/man3 am__installdirs = "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(man5dir)" \ "$(DESTDIR)$(man7dir)" "$(DESTDIR)$(man8dir)" man5dir = $(mandir)/man5 man7dir = $(mandir)/man7 man8dir = $(mandir)/man8 NROFF = nroff MANS = $(man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILD_EXEEXT = @BUILD_EXEEXT@ BUILD_OBJEXT = @BUILD_OBJEXT@ CAPNG_LDADD = @CAPNG_LDADD@ CAPNG_PKG = @CAPNG_PKG@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_FOR_BUILD = @CC_FOR_BUILD@ CFLAGS = @CFLAGS@ CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ CPP_FOR_BUILD = @CPP_FOR_BUILD@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG = @DEBUG@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GOLANG = @GOLANG@ GOROOT = @GOROOT@ 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@ LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBWRAP_LIBS = @LIBWRAP_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PYTHON = @PYTHON@ PYTHON3_CFLAGS = @PYTHON3_CFLAGS@ PYTHON3_INCLUDES = @PYTHON3_INCLUDES@ PYTHON3_LIBS = @PYTHON3_LIBS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ VERSION = @VERSION@ WFLAGS = @WFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CC_FOR_BUILD = @ac_ct_CC_FOR_BUILD@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gss_libs = @gss_libs@ 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@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ use_python3 = @use_python3@ CONFIG_CLEAN_FILES = *.rej *.orig EXTRA_DIST = $(man_MANS) man_MANS = audit_add_rule_data.3 audit_add_watch.3 auditctl.8 auditd.8 \ auditd.conf.5 auditd-plugins.5 \ audit_delete_rule_data.3 audit_detect_machine.3 \ audit_encode_nv_string.3 audit_getloginuid.3 \ audit_get_reply.3 audit_get_session.3 \ audit_log_acct_message.3 audit_log_user_avc_message.3 \ audit_log_user_command.3 audit_log_user_comm_message.3 \ audit_log_user_message.3 audit_log_semanage_message.3 \ auparse_new_buffer.3 audit_open.3 audit_close.3 \ audit_is_enabled.3 audit_request_rules_list_data.3 \ audit_request_signal_info.3 audit_request_status.3 audit.rules.7 \ audit_set_backlog_limit.3 audit_set_enabled.3 audit_set_failure.3 \ audit_setloginuid.3 audit_set_pid.3 audit_set_rate_limit.3 \ audit_update_watch_perms.3 audit_value_needs_encoding.3 \ audit_encode_value.3 auparse_add_callback.3 audit_name_to_syscall.3 \ audit_syscall_to_name.3 audit_name_to_errno.3\ audit_fstype_to_name.3 audit_name_to_fstype.3 \ audit_name_to_action.3 \ audit_flag_to_name.3 audit_name_to_flag.3 \ auparse_destroy.3 auparse_feed.3 auparse_feed_age_events.3 \ auparse_feed_has_data.3 auparse_find_field.3 \ auparse_find_field_next.3 auparse_first_field.3 auparse_first_record.3 \ auparse_flush_feed.3 auparse_get_field_int.3 auparse_get_field_name.3 \ auparse_get_field_str.3 auparse_get_field_type.3 auparse_get_filename.3 \ auparse_get_line_number.3 auparse_get_milli.3 \ auparse_get_node.3 auparse_get_num_fields.3 \ auparse_get_num_records.3 auparse_get_record_text.3 \ auparse_get_serial.3 auparse_get_time.3 auparse_get_timestamp.3 \ auparse_get_type.3 auparse_get_type_name.3 \ auparse_get_field_num.3 auparse_get_record_num.3 \ auparse_goto_field_num.3 auparse_goto_record_num.3 \ auparse_init.3 auparse_interpret_field.3 auparse_metrics.3 \ auparse_next_event.3 auparse_next_field.3 auparse_next_record.3 \ auparse_node_compare.3 auparse_reset.3 auparse_set_escape_mode.3 \ auparse_normalize.3 auparse_normalize_functions.3 \ auparse_timestamp_compare.3 auparse_set_eoe_timeout.3 ausearch-expression.5 \ aureport.8 ausearch.8 ausearch_add_item.3 ausearch_add_interpreted_item.3 \ ausearch_add_expression.3 ausearch_add_timestamp_item.3 ausearch_add_regex.3 \ ausearch_add_timestamp_item_ex.3 ausearch_clear.3 \ ausearch_next_event.3 ausearch_cur_event.3 ausearch_set_stop.3 \ get_auditfail_action.3 set_aumessage_mode.3 \ audispd-zos-remote.8 libaudit.conf.5 \ augenrules.8 audit_set_backlog_wait_time.3 \ zos-remote.conf.5 all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu docs/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu docs/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man3: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man3dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man3dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man3dir)" || 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 '/\.3[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,^[^3][0-9a-z]*$$,3,;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)$(man3dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$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)$(man3dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man3dir)" || exit $$?; }; \ done; } uninstall-man3: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man3dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.3[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man3dir)'; $(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) install-man7: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man7dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man7dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man7dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.7[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^7][0-9a-z]*$$,7,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man7dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man7dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man7dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man7dir)" || exit $$?; }; \ done; } uninstall-man7: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man7dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.7[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^7][0-9a-z]*$$,7,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man7dir)'; $(am__uninstall_files_from_dir) install-man8: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man8dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man8dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man8dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.8[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \ done; } uninstall-man8: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man8dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.8[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man8dir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(MANS) installdirs: for dir in "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man7dir)" "$(DESTDIR)$(man8dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man3 install-man5 install-man7 install-man8 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-man uninstall-man: uninstall-man3 uninstall-man5 uninstall-man7 \ uninstall-man8 .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-man3 install-man5 install-man7 install-man8 \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am uninstall-man uninstall-man3 \ uninstall-man5 uninstall-man7 uninstall-man8 .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: audit-4.0.2/docs/audit_get_reply.30000644001034500103450000000155514655201403012506 .TH "AUDIT_GET_REPLY" "3" "Oct 2006" "Red Hat" "Linux Audit API" .SH NAME audit_get_reply \- Get the audit system's reply .SH SYNOPSIS .B #include .sp int audit_get_reply(int fd, struct audit_reply *rep, reply_t block, int peek); .SH "DESCRIPTION" This function gets the next data packet sent on the audit netlink socket. This function is usually called after sending a command to the audit system. fd should be an open file descriptor returned by audit_open. rep should be a data structure to put the reply in. block is of type reply_t which is either: GET_REPLY_BLOCKING and GET_REPLY_NONBLOCKING. peek, if non-zero, gets the data without dequeueing it from the netlink socket. .SH "RETURN VALUE" This function returns \-errno on error, 0 if error response received, and positive value on success. .SH "SEE ALSO" .BR audit_open (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/auparse_find_field_next.30000644001034500103450000000131714655201403014163 .TH "AUPARSE_FIND_FIELD_NEXT" "3" "Feb 2007" "Red Hat" "Linux Audit API" .SH NAME auparse_find_field_next \- find next occurrence of field name .SH "SYNOPSIS" .B #include .sp const char *auparse_find_field_next(const auparse_state_t *au); .SH "DESCRIPTION" auparse_find_field_next finds the next occurrence of the previously stored field name. It will scan until it reaches the last record of the current event. .SH "RETURN VALUE" Returns NULL field not found. If an error occurs errno will be set. Otherwise, it returns a pointer to the text value associated with the field. .SH "SEE ALSO" .BR auparse_first_record (3), .BR auparse_next_event (3), .BR auparse_find_field (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/audit_close.30000644001034500103450000000077514655201403011624 .TH "AUDIT_CLOSE" "3" "Apr 2021" "Red Hat" "Linux Audit API" .SH NAME audit_close \- Close the audit netlink socket connection .SH "SYNOPSIS" .nf .B #include .PP .BI "void audit_close(int " fd ); .fi .SH "DESCRIPTION" .BR audit_close () closes the NETLINK_AUDIT socket that communicates with the kernel part of the Linux Audit Subsystem. .I fd must have been returned by .BR audit_open (3). .SH "RETURN VALUE" None. .SH "SEE ALSO" .BR audit_open (3), .BR netlink (7). .SH AUTHOR Steve Grubb audit-4.0.2/docs/ausearch_add_timestamp_item_ex.30000644001034500103450000000370714655201403015527 .TH "AUSEARCH_ADD_TIMESTAMP_ITEM_EX" "3" "Aug 2014" "Red Hat" "Linux Audit API" .SH NAME ausearch_add_timestamp_item_ex \- build up search rule .SH "SYNOPSIS" .B #include .sp int ausearch_add_timestamp_item_ex(auparse_state_t *au, const char *op, time_t sec, unsigned milli, unsigned serial, ausearch_rule_t how) .SH "DESCRIPTION" ausearch_add_timestamp_item adds an event time condition to the current audit search expression. The search conditions can then be used to scan logs, files, or buffers for something of interest. The op parameter specifies the desired comparison. Legal op values are \fI<\fR, \fI<=\fR, \fI>=\fR, \fI>\fR and \fI=\fR. The left operand of the comparison operator is the timestamp of the examined event, the right operand is specified by the sec, milli, and serial parameters. The how value determines how this search condition will affect the existing search expression if one is already defined. The possible values are: .RS .TP .I AUSEARCH_RULE_CLEAR Clear the current search expression, if any, and use only this search condition. .TP .I AUSEARCH_RULE_OR If a search expression .I E is already configured, replace it by \fB(\fIE\fB || \fIthis_search_condition\fB)\fR. .TP .I AUSEARCH_RULE_AND If a search expression .I E is already configured, replace it by \fB(\fIE\fB && \fIthis_search_condition\fB)\fR. .RE .SH "RETURN VALUE" Returns \-1 if an error occurs; otherwise, 0 for success. .SH APPLICATION USAGE Use .BR ausearch_add_item (3) and .BR ausearch_add_interpreted_item (3) to add conditions that check audit record fields. Use .BR ausearch_add_expression (3) to add complex search expressions using a single function call. .SH "SEE ALSO" .BR ausearch_add_expression (3), .BR ausearch_add_item (3), .BR ausearch_add_interpreted_item (3), .BR ausearch_add_regex (3), .BR ausearch_set_stop (3), .BR ausearch_clear (3), .BR ausearch_next_event (3), .BR ausearch_cur_event (3), .BR ausearch\-expression (5). .SH AUTHOR Miloslav Trmac audit-4.0.2/docs/audit_value_needs_encoding.30000644001034500103450000000134114655201403014645 .TH "AUDIT_VALUE_NEEDS_ENCODING" "3" "Apr 2021" "Red Hat" "Linux Audit API" .SH NAME audit_value_needs_encoding \- check a string to see if it needs encoding .SH "SYNOPSIS" .nf .B #include .PP .BI "int audit_value_needs_encoding(const char *" str ", unsigned int " size "); .fi .SH "DESCRIPTION" .BR audit_value_needs_encoding () checks a string to see if it needs encoding. Specifically, this function checks if the string contains a space, a double-quote, or a control character. .I str is the string to check if encoding is needed. .I size is the length of str. .SH "RETURN VALUE" The return value if encoding is needed is 1. If not needed is 0. .SH "SEE ALSO" .BR audit_encode_nv_string (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/audit_log_user_message.30000644001034500103450000000257514655201403014042 .TH "AUDIT_LOG_USER_MESSAGE" "3" "July 2016" "Red Hat" "Linux Audit API" .SH NAME audit_log_user_message \- log a general user message .SH SYNOPSIS .B #include .sp int audit_log_user_message(int audit_fd, int type, const char *message, const char *hostname, const char *addr, const char *tty, int result) .SH DESCRIPTION This function will log a message to the audit system using a predefined message format. This function should be used by all ELF console apps that do not manipulate accounts or groups. If the application is written in Python or another interpreter, then use the .I audit_log_user_comm_message function instead. The function parameters are as follows: .nf audit_fd - The fd returned by audit_open type - type of message, ex: AUDIT_USYS_CONFIG, AUDIT_USER_LOGIN message - the message text being sent hostname - the hostname if known, NULL if unknown addr - The network address of the user, NULL if unknown tty - The tty of the user, if NULL will attempt to figure out result - 1 is "success" and 0 is "failed" .fi .SH "RETURN VALUE" It returns the sequence number which is > 0 on success or <= 0 on error. .SH "ERRORS" This function returns \-1 on failure. Examine errno for more info. .SH "SEE ALSO" .BR audit_log_user_comm_message (3), .BR audit_log_acct_message (3), .BR audit_log_user_avc_message (3), .BR audit_log_semanage_message (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/Makefile.am0000644001034500103450000000645014655201403011275 # Makefile.am -- # Copyright 2004-09,2012,2014-18 Red Hat Inc. # All Rights Reserved. # # 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; see the file COPYING. If not, write to the # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor # Boston, MA 02110-1335, USA. # # Authors: # Steve Grubb # CONFIG_CLEAN_FILES = *.rej *.orig EXTRA_DIST = $(man_MANS) man_MANS = audit_add_rule_data.3 audit_add_watch.3 auditctl.8 auditd.8 \ auditd.conf.5 auditd-plugins.5 \ audit_delete_rule_data.3 audit_detect_machine.3 \ audit_encode_nv_string.3 audit_getloginuid.3 \ audit_get_reply.3 audit_get_session.3 \ audit_log_acct_message.3 audit_log_user_avc_message.3 \ audit_log_user_command.3 audit_log_user_comm_message.3 \ audit_log_user_message.3 audit_log_semanage_message.3 \ auparse_new_buffer.3 audit_open.3 audit_close.3 \ audit_is_enabled.3 audit_request_rules_list_data.3 \ audit_request_signal_info.3 audit_request_status.3 audit.rules.7 \ audit_set_backlog_limit.3 audit_set_enabled.3 audit_set_failure.3 \ audit_setloginuid.3 audit_set_pid.3 audit_set_rate_limit.3 \ audit_update_watch_perms.3 audit_value_needs_encoding.3 \ audit_encode_value.3 auparse_add_callback.3 audit_name_to_syscall.3 \ audit_syscall_to_name.3 audit_name_to_errno.3\ audit_fstype_to_name.3 audit_name_to_fstype.3 \ audit_name_to_action.3 \ audit_flag_to_name.3 audit_name_to_flag.3 \ auparse_destroy.3 auparse_feed.3 auparse_feed_age_events.3 \ auparse_feed_has_data.3 auparse_find_field.3 \ auparse_find_field_next.3 auparse_first_field.3 auparse_first_record.3 \ auparse_flush_feed.3 auparse_get_field_int.3 auparse_get_field_name.3 \ auparse_get_field_str.3 auparse_get_field_type.3 auparse_get_filename.3 \ auparse_get_line_number.3 auparse_get_milli.3 \ auparse_get_node.3 auparse_get_num_fields.3 \ auparse_get_num_records.3 auparse_get_record_text.3 \ auparse_get_serial.3 auparse_get_time.3 auparse_get_timestamp.3 \ auparse_get_type.3 auparse_get_type_name.3 \ auparse_get_field_num.3 auparse_get_record_num.3 \ auparse_goto_field_num.3 auparse_goto_record_num.3 \ auparse_init.3 auparse_interpret_field.3 auparse_metrics.3 \ auparse_next_event.3 auparse_next_field.3 auparse_next_record.3 \ auparse_node_compare.3 auparse_reset.3 auparse_set_escape_mode.3 \ auparse_normalize.3 auparse_normalize_functions.3 \ auparse_timestamp_compare.3 auparse_set_eoe_timeout.3 ausearch-expression.5 \ aureport.8 ausearch.8 ausearch_add_item.3 ausearch_add_interpreted_item.3 \ ausearch_add_expression.3 ausearch_add_timestamp_item.3 ausearch_add_regex.3 \ ausearch_add_timestamp_item_ex.3 ausearch_clear.3 \ ausearch_next_event.3 ausearch_cur_event.3 ausearch_set_stop.3 \ get_auditfail_action.3 set_aumessage_mode.3 \ audispd-zos-remote.8 libaudit.conf.5 \ augenrules.8 audit_set_backlog_wait_time.3 \ zos-remote.conf.5 audit-4.0.2/docs/auparse_feed_has_data.30000644001034500103450000000112214655201403013563 .TH "AUPARSE_FEED_HAS_DATA" "3" "Apr 2016" "Red Hat" "Linux Audit API" .SH NAME auparse_feed_has_data \- check if there is any data accumulating that might need flushing. .SH "SYNOPSIS" .B #include .sp int auparse_feed_has_data(const auparse_state_t *au); .SH "DESCRIPTION" .I auparse_feed_has_data may be called to determine if there is any records that are accumulating but not yet ready to emit. .SH "RETURN VALUE" Returns 1 if any records are accumulating otherwise 0 if empty. .SH "SEE ALSO" .BR auparse_feed (3), .BR auparse_feed_age_events (3) .SH AUTHOR Steve Grubb audit-4.0.2/docs/audit_log_semanage_message.30000644001034500103450000000364414655201403014642 .TH "AUDIT_LOG_SEMANAGE_MESSAGE" "3" "Jan 2012" "Red Hat" "Linux Audit API" .SH NAME audit_log_semanage_message \- log a semanage message .SH SYNOPSIS .B #include .sp .B int audit_log_semanage_message(int audit_fd, int type, .B const char *pgname, const char *op, const char *name, unsigned int id, .B const char *new_seuser, const char *new_role, const char *new_range, .B const char *old_seuser, const char *old_role, const char *old_range, .B const char *host, const char *addr, const char *tty, int result) .SH DESCRIPTION This function will log a message to the audit system using a predefined message format. It should be used for all SE Linux user and role manipulation operations. The function parameters are as follows: .nf audit_fd - The fd returned by audit_open type - type of message: AUDIT_ROLE_ASSIGN/REMOVE for changing any SE Linux user or role attributes. pgname - program's name op - operation. "adding-user", "adding-role", "deleting-user", "deleting-role" name - user's account. If not available use NULL. id - uid that the operation is being performed on. This is used only when name is NULL. new_seuser - the new seuser that the login user is getting new_role - the new_role that the login user is getting new_range - the new mls range that the login user is getting old_seuser - the old seuser that the login usr had old_role - the old role that the login user had old_range - the old mls range that the login usr had host - The hostname if known addr - The network address of the user tty - The tty of the user result - 1 is "success" and 0 is "failed" .fi .SH "RETURN VALUE" It returns the sequence number which is > 0 on success or <= 0 on error. .SH "ERRORS" This function returns \-1 on failure. Examine errno for more info. .SH "SEE ALSO" .BR audit_log_user_message (3), .BR audit_log_acct_message (3), .BR audit_log_user_avc_message (3), .BR audit_log_user_comm_message (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/auparse_get_node.30000644001034500103450000000135014655201403012623 .TH "AUPARSE_GET_NODE" "3" "Sept 2007" "Red Hat" "Linux Audit API" .SH NAME auparse_get_node \- get the event's machine node name .SH "SYNOPSIS" .B #include .sp const char *auparse_get_node(const auparse_state_t *au); .SH "DESCRIPTION" auparse_get_node gets the machine's node name if it exists in the audit event from the current event's timestamp data structure. Not all records have node names since its an admin configurable option. .SH "RETURN VALUE" Returns a copy of the node name or NULL if it does not exist or there was an error. The caller must free the string. .SH "SEE ALSO" .BR auparse_get_timestamp (3), .BR auparse_get_time (3), .BR auparse_get_milli (3). .BR auparse_get_serial (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/auparse_first_field.30000644001034500103450000000101714655201403013331 .TH "AUPARSE_FIRST_FIELD" "3" "Feb 2007" "Red Hat" "Linux Audit API" .SH NAME auparse_first_field \- reposition field cursor .SH "SYNOPSIS" .B #include .sp int auparse_first_field(const auparse_state_t *au); .SH "DESCRIPTION" auparse_first_field repositions the library's internal cursor to point to the first field of the current record in the current event. .SH "RETURN VALUE" Returns 0 if there is no event data; otherwise, 1 for success. .SH "SEE ALSO" .BR auparse_next_field (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/audit_set_enabled.30000644001034500103450000000205514655201403012755 .TH "AUDIT_SET_ENABLED" "3" "Oct 2006" "Red Hat" "Linux Audit API" .SH NAME audit_set_enabled \- Enable or disable auditing .SH "SYNOPSIS" .B #include .sp int audit_set_enabled(int fd, uint32_t enabled); .SH "DESCRIPTION" .PP audit_set_enabled is used to control whether or not the audit system is active. When the audit system is enabled (enabled set to 1), every syscall will pass through the audit system to collect information and potentially trigger an event. If the audit system is disabled (enabled set to 0), syscalls do not enter the audit system and no data is collected. There may be some events generated by MAC subsystems like SE Linux even though the audit system is disabled. It is possible to suppress those events, too, by adding an audit rule with flags set to AUDIT_FILTER_EXCLUDE .SH "RETURN VALUE" The return value is <= 0 on error, otherwise it is the netlink sequence id number. This function can have any error that sendto would encounter. .SH "SEE ALSO" .BR audit_add_rule_data (3), .BR auditd (8). .SH AUTHOR Steve Grubb audit-4.0.2/docs/ausearch_cur_event.30000644001034500103450000000145514655201403013172 .TH "AUSEARCH_CUR_EVENT" "3" "Feb 2024" "Red Hat" "Linux Audit API" .SH NAME ausearch_cur_event \- check if the current event meets search criteria .SH "SYNOPSIS" .B #include .sp int ausearch_cur_event(auparse_state_t *au); .SH "DESCRIPTION" ausearch_cur_event will scan the input source and evaluate whether any record in the current event contains the data being searched for. Evaluation is done at the record level. If a match is found, the cursor is repositioned; otherwise, it remains on the last successfully parsed record within the current event. .SH "RETURN VALUE" Returns \-1 if an error occurs, 0 if no matches, and 1 for success. .SH "SEE ALSO" .BR ausearch_add_item (3), .BR ausearch_add_regex (3), .BR ausearch_next_event (3), .BR ausearch_set_stop (3). .SH AUTHOR Attila Lakatos audit-4.0.2/docs/libaudit.conf.50000644001034500103450000000176614655201403012055 .TH LIBAUDIT.CONF "5" "Oct 2009" "Red Hat" "System Administration Utilities" .SH NAME libaudit.conf \- libaudit configuration file .SH DESCRIPTION The file .I /etc/libaudit.conf contains configuration information for user space applications that link to libaudit. The applications are responsible for querying the settings in this file and obeying the admin's preferences. This file contains one configuration keyword per line, an equal sign, and then followed by appropriate configuration information. The keywords recognized are: .IR failure_action ". These keywords are described below. .TP .I failure_action This keyword specifies what action the admin wishes a user space application to take when there is a failure to send an audit event to the kernel. The possible values are: .IR IGNORE - meaning do nothing, .IR LOG - write to syslog the inability to send an audit event, and .I TERMINATE - the user space application should exit. .SH "SEE ALSO" .BR get_auditfail_action (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/auparse_find_field.30000644001034500103450000000164514655201403013131 .TH "AUPARSE_FIND_FIELD" "3" "June 2021" "Red Hat" "Linux Audit API" .SH NAME auparse_find_field \- search for field name .SH "SYNOPSIS" .B #include .sp const char *auparse_find_field(auparse_state_t *au, const char *name); .SH "DESCRIPTION" auparse_find_field will scan all records in an event to find the first occurrence of the field name passed to it. Searching begins from the cursor's current position. The field name is stored for subsequent searching. NOTE: auparse creates 2 pseudo fields that do not exist in the natural record for SELinux AVC and USER_AVC decision and permissions. The field names are seresult and seperms respectively. .SH "RETURN VALUE" Returns NULL field not found. If an error occurs errno will be set. Otherwise, it returns a pointer to the text value associated with the field. .SH "SEE ALSO" .BR auparse_first_record (3), .BR auparse_find_field_next (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/auparse_get_record_num.30000644001034500103450000000132114655201403014031 .TH "AUPARSE_GET_RECORD_NUM" "3" "Dec 2016" "Red Hat" "Linux Audit API" .SH NAME auparse_get_record_num \- get current record cursor location .SH "SYNOPSIS" .B #include .sp unsigned int auparse_get_record_num(const auparse_state_t *au); .SH "DESCRIPTION" auparse_get_record_num will retrieve the internal library cursors current record location in the current event. Records within the same event are numbered starting from 0. This is generally not needed but there are some cases where one may want to know the exact record being looked at. .SH "RETURN VALUE" Returns the current record cursor location. .SH "SEE ALSO" .BR auparse_goto_record_num (3), auparse_get_field_num (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/audit_name_to_fstype.30000644001034500103450000000115214655201403013521 .TH "AUDIT_NAME_TO_FSTYPE" "3" "Mar 2022" "Red Hat" "Linux Audit API" .SH NAME audit_name_to_fstype \- Convert the fstype name to the numeric fstype value .SH "SYNOPSIS" .nf .B #include .PP .BI "int audit_name_to_fstype(const char " *name ); .fi .SH "DESCRIPTION" .BR audit_name_to_fstype () converts the fstype name ("debugfs" or "tracefs") to the numeric fstype value (0x64626720 or 0x74726163). .I name is the fstype name. .SH "RETURN VALUE" Returns -1 if an name occurs; otherwise, the return value is the numeric fstype value. .SH "SEE ALSO" .BR audit_fstype_to_name (3), .SH AUTHOR Steve Grubb audit-4.0.2/docs/auparse_normalize_functions.30000644001034500103450000000550714655201403015137 .TH "AUPARSE_NORMALIZE_FUNCTIONS" "3" "March 2017" "Red Hat" "Linux Audit API" .SH NAME .nf auparse_normalize_get_event_kind, auparse_normalize_subject_kind, auparse_normalize_get_action, auparse_normalize_object_kind, auparse_normalize_how, auparse_normalize_session, auparse_normalize_subject_primary, auparse_normalize_subject_secondary, auparse_normalize_subject_first_attribute, auparse_normalize_subject_next_attribute, auparse_normalize_object_primary, auparse_normalize_object_secondary, auparse_normalize_object_primary2, auparse_normalize_object_first_attribute, auparse_normalize_object_next_attribute, auparse_normalize_get_results, auparse_normalize_key \- Access normalized fields .fi .SH "SYNOPSIS" .nf .B #include .sp Metadata Functions: .B const char *auparse_normalize_get_event_kind(const auparse_state_t *au); .B const char *auparse_normalize_subject_kind(const auparse_state_t *au); .B const char *auparse_normalize_get_action(const auparse_state_t *au); .B const char *auparse_normalize_object_kind(const auparse_state_t *au); .B const char *auparse_normalize_how(const auparse_state_t *au); .sp Positioning Functions: .B int auparse_normalize_session(auparse_state_t *au); .B int auparse_normalize_subject_primary(auparse_state_t *au); .B int auparse_normalize_subject_secondary(auparse_state_t *au); .B int auparse_normalize_subject_first_attribute(auparse_state_t *au); .B int auparse_normalize_subject_next_attribute(auparse_state_t *au); .B int auparse_normalize_object_primary(auparse_state_t *au); .B int auparse_normalize_object_secondary(auparse_state_t *au); .B int auparse_normalize_object_primary2(auparse_state_t *au); .B int auparse_normalize_object_first_attribute(auparse_state_t *au); .B int auparse_normalize_object_next_attribute(auparse_state_t *au); .B int auparse_normalize_get_results(auparse_state_t *au); .B int auparse_normalize_key(auparse_state_t *au); .fi .SH "DESCRIPTION" After calling the .B auparse_normalize function, you will probably want to access the audit event data. These function provide access to the results of the normalization. There are 2 kinds of function, metadata and positioning. The metadata functions all return a pointer to a string that describes something about the event. This data does not live inside the event but is kept in lookup tables inside the auparse library. The positioning function are different in that they move the internal cursor of auparse to the record and field that contains the information you want. You then use field accessor functions to retrieve the values. .SH "RETURN VALUE" The positioning functions return < 0 on error, 0 if uninitialized, and 1 on success. The metadata functions return NULL on error and a pointer to a string on success. .SH "SEE ALSO" auparse_normalize(3), auparse_get_field_str(3), auparse_interpret_field(3). .BR .SH AUTHOR Steve Grubb audit-4.0.2/docs/audit_name_to_errno.30000644001034500103450000000173514655201403013343 .TH "AUDIT_NAME_TO_ERRNO" "3" "Mar 2022" "Red Hat" "Linux Audit API" .SH NAME audit_name_to_errno, audit_errno_to_name \- Convert the errno name and the numeric errno value to each other .SH "SYNOPSIS" .nf .B #include .PP .BI "int audit_name_to_errno(const char " *error ); .PP .BI "const char *audit_errno_to_name(int " error ); .fi .SH "DESCRIPTION" .BR audit_name_to_errno () converts the errno name ("EPERM", "ENOENT", "ESRCH", etc.) to the numeric errno value (EPERM, ENOENT, ESRCH, etc.). .I error is the errno name. .PP .BR audit_errno_to_name () converts the numeric errno value (EPERM, ENOENT, ESRCH, etc.) to the errno name ("EPERM", "ENOENT", "ESRCH", etc.). .I error is the numeric errno value. .SH "RETURN VALUE" .BR audit_name_to_errno () returns 0 if an error occurs; otherwise, the return value is the numeric errno value. .PP .BR audit_errno_to_name () returns NULL if an error occurs; otherwise, the return value is the errno name. .SH AUTHOR Steve Grubb audit-4.0.2/docs/audit_fstype_to_name.30000644001034500103450000000116114655201403013521 .TH "AUDIT_FSTYPE_TO_NAME" "3" "Mar 2022" "Red Hat" "Linux Audit API" .SH NAME audit_fstype_to_name \- Convert the numeric fstype value to the fstype name .SH "SYNOPSIS" .nf .B #include .PP .BI "const char *audit_fstype_to_name(int " fstype ); .fi .SH "DESCRIPTION" .BR audit_fstype_to_name () converts the numeric fstype value (0x64626720 or 0x74726163) to the fstype name ("debugfs" or "tracefs"). .I fstype is the numeric fstype value. .SH "RETURN VALUE" Returns NULL if an error occurs; otherwise, the return value is the fstype name. .SH "SEE ALSO" .BR audit_name_to_fstype (3), .SH AUTHOR Steve Grubb audit-4.0.2/docs/auparse_feed_age_events.30000644001034500103450000000111614655201403014142 .TH "AUPARSE_FEED_AGE_EVENTS" "3" "Apr 2016" "Red Hat" "Linux Audit API" .SH NAME auparse_feed_age_events \- check events for complete based on time. .SH "SYNOPSIS" .B #include .sp void auparse_feed_age_events(auparse_state_t *au); .SH "DESCRIPTION" .I auparse_feed_age_events should be called to see if any events are complete based on the current clock time. Any newly complete events will be passed to the callback function. .SH "RETURN VALUE" None. .SH "SEE ALSO" .BR auparse_feed (3), .BR auparse_flush_feed (3), .BR auparse_feed_has_data (3) .SH AUTHOR Steve Grubb audit-4.0.2/docs/auparse_feed.30000644001034500103450000000611614655201403011747 .TH "AUPARSE_FEED" "3" "Sept 2023" "Red Hat" "Linux Audit API" .SH NAME auparse_feed \- feed data into parser .SH "SYNOPSIS" .B #include .sp .nf int auparse_feed(auparse_state_t *au, const char *data, size_t data_len); .fi .TP .I au The audit parse state .TP .I data a buffer of data to feed into the parser, it is .I data_len bytes long. The data is copied in the parser, upon return the caller may free or reuse the data buffer. .TP .I data_len number of bytes in .I data .SH "DESCRIPTION" .I auparse_feed supplies new data for the parser to consume. .I auparse_init() must have been called with a source type of AUSOURCE_FEED and a NULL pointer. .br .sp The parser consumes as much data as it can invoking a user supplied callback specified with .I auparse_add_callback with a cb_event_type of .I AUPARSE_CB_EVENT_READY each time the parser recognizes a complete event in the data stream. Data not fully parsed will persist and be prepended to the next feed data. After all data has been feed to the parser .I auparse_flush_feed should be called to signal the end of input data and flush any pending parse data through the parsing system. .SH "RETURN VALUE" Returns \-1 if an error occurs; otherwise, 0 for success. .SH "EXAMPLE" .nf void auparse_callback(auparse_state_t *au, auparse_cb_event_t cb_event_type, void *user_data) { int *event_cnt = (int *)user_data; if (cb_event_type == AUPARSE_CB_EVENT_READY) { if (auparse_first_record(au) <= 0) return; printf("event: %d\\n", *event_cnt); printf("records:%d\\n", auparse_get_num_records(au)); do { printf("fields:%d\\n", auparse_get_num_fields(au)); printf("type=%d ", auparse_get_type(au)); const au_event_t *e = auparse_get_timestamp(au); if (e == NULL) return; printf("event time: %lu.%u:%lu\\n", (long unsigned)e\->sec, e\->milli, e\->serial); auparse_first_field(au); do { printf("%s=%s (%s)\\n", auparse_get_field_name(au), auparse_get_field_str(au), auparse_interpret_field(au)); } while (auparse_next_field(au) > 0); printf("\\n"); } while(auparse_next_record(au) > 0); (*event_cnt)++; } } main(int argc, char **argv) { char *filename = argv[1]; FILE *fp; char buf[256]; size_t len; int *event_cnt = malloc(sizeof(int)); au = auparse_init(AUSOURCE_FEED, 0); auparse_set_eoe_timeout(2); *event_cnt = 1; auparse_add_callback(au, auparse_callback, event_cnt, free); if ((fp = fopen(filename, "r")) == NULL) { fprintf(stderr, "could not open '%s', %s\\n", filename, strerror(errno)); return 1; } while ((len = fread(buf, 1, sizeof(buf), fp))) { auparse_feed(au, buf, len); } auparse_flush_feed(au); auparse_destroy(au); } .fi .SH "SEE ALSO" .BR auparse_add_callback (3), .BR auparse_flush_feed (3), .BR auparse_feed_age_events (3), .BR auparse_feed_has_data (3), .BR auparse_metrics (3) .SH AUTHOR John Dennis audit-4.0.2/docs/ausearch_add_regex.30000644001034500103450000000201614655201403013114 .TH "AUSEARCH_ADD_REGEX" "3" "Sept 2007" "Red Hat" "Linux Audit API" .SH NAME ausearch_add_regex \- use regular expression search rule .SH "SYNOPSIS" .B #include .sp int ausearch_add_regex(auparse_state_t *au, const char *regexp); .SH "DESCRIPTION" ausearch_add_regex adds one search condition based on a regular expression to the current audit search expression. The search conditions can then be used to scan logs, files, or buffers for something of interest. The regular expression follows the posix extended regular expression conventions, and is matched against the full record (without interpreting field values). If an existing search expression .I E is already defined, this function replaces it by \fB(\fIE\fB && \fIthis_regexp\fB)\fR. .SH "RETURN VALUE" Returns \-1 if an error occurs; otherwise, 0 for success. .SH "SEE ALSO" .BR ausearch_add_expression (3), .BR ausearch_add_item (3), .BR ausearch_clear (3), .BR ausearch_next_event (3), .BR ausearch_cur_event (3), .BR regcomp (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/ausearch.80000644001034500103450000004116214655201403011124 .TH AUSEARCH "8" "July 2023" "Red Hat" "System Administration Utilities" .SH NAME ausearch \- a tool to query audit daemon logs .SH SYNOPSIS .B ausearch .RI [ options ] .SH DESCRIPTION \fBausearch\fP is a tool that can query the audit daemon logs based for events based on different search criteria. The ausearch utility can also take input from stdin as long as the input is the raw log data. Each commandline option given forms an "and" statement. For example, searching with \fB\-m\fP and \fB\-ui\fP means return events that have both the requested type and match the user id given. An exception is the \fB\-m\fP and \fB\-n\fP options; multiple record types and nodes are allowed in a search which will return any matching node and record. It should also be noted that each syscall excursion from user space into the kernel and back into user space has one event ID that is unique. Any auditable event that is triggered during this trip share this ID so that they may be correlated. Different parts of the kernel may add supplemental records. For example, an audit event on the syscall "open" will also cause the kernel to emit a PATH record with the file name. The ausearch utility will present all records that make up one event together. This could mean that even though you search for a specific kind of record, the resulting events may contain SYSCALL records. Also be aware that not all record types have the requested information. For example, a PATH record does not have a hostname or a loginuid. .SH OPTIONS .TP .BR \-a ,\ \-\-event \ \fIaudit-event-id\fP Search for an event based on the given \fIevent ID\fP. Messages always start with something like msg=audit(1116360555.329:2401771). The event ID is the number after the ':'. All audit events that are recorded from one application's syscall have the same audit event ID. A second syscall made by the same application will have a different event ID. This way they are unique. .TP .BR \-\-arch \ \fICPU\fP Search for events based on a specific CPU architecture. If you do not know the arch of your machine but you want to use the 32 bit syscall table and your machine supports 32 bits, you can also use .B b32 for the arch. The same applies to the 64 bit syscall table, you can use .B b64. The arch of your machine can be found by doing 'uname -m'. .TP .BR \-c ,\ \-\-comm \ \fIcomm-name\fP Search for an event based on the given \fIcomm name\fP. The comm name is the executable's name from the task structure. .TP .BR \-\-debug Write malformed events that are skipped to stderr. .TP .BR \-\-checkpoint \ \fIcheckpoint-file\fP Checkpoint the output between successive invocations of ausearch such that only events not previously output will print in subsequent invocations. An auditd event is made up of one or more records. When processing events, ausearch defines events as either complete or in-complete. A complete event is either a single record event or one whose event time occurred 2 seconds in the past compared to the event being currently processed. A checkpoint is achieved by recording the last completed event output along with the device number and inode of the file the last completed event appeared in \fIcheckpoint-file\fP. On a subsequent invocation, ausearch will load this checkpoint data and as it processes the log files, it will discard all complete events until it matches the checkpointed one. At this point, it will start outputting complete events. Should the file or the last checkpointed event not be found, one of a number of errors will result and ausearch will terminate. See \fBEXIT STATUS\fP for detail. .TP .BR \-\-eoe\-timeout \ \fIseconds\fP Set the end of event parsing timeout. See \fBend_of_event_timeout\fP in \fIauditd.conf(5)\fP for details. Note that setting this value will override any configured value found in /etc/auditd/auditd.conf. .TP .BR \-e,\ \-\-exit \ \fIexit-code-or-errno\fP Search for an event based on the given syscall \fIexit code or errno\fP. .TP .BR \-\-escape \ \fIoption\fP This option determines if the output is escaped to make the content safer for certain uses. The options are \fIraw\fP , \fItty\fP , \fIshell\fP , and \fIshell_quote\fP. Each mode includes the characters of the preceding mode and escapes more characters. That is to say \fIshell\fP includes all characters escaped by \fItty\fP and adds more. \fItty\fP is the default. .TP .BR \-\-extra-keys \ When the \fIformat\fP mode is \fIcsv\fP, this option will add a final column with key information if its exists for the event. This would only occur on SYSCALL records which were the result of triggering an audit rule that defines a key. .TP .BR \-\-extra-labels \ When the \fIformat\fP mode is \fIcsv\fP, this option will add columns of information about subject and object labels when they exist. .TP .BR \-\-extra-obj2 \ When the \fIformat\fP mode is \fIcsv\fP, this option will add columns of information about a second object when it exists. It's rare that a second object is part of a record. Some examples are when a file is renamed from one name to another or when a device is mounted to a path. .TP .BR \-\-extra-time \ When the \fIformat\fP mode is \fIcsv\fP, this option will add columns of information about broken down time to make subsetting easier. .TP .BR \-f ,\ \-\-file \ \fIfile-name\fP Search for an event based on the given \fIfilename\fP. The argument will match normal files as well as af_unix sockets. .TP .BR \-\-format \ \fIoption\fP Events that match the search criteria are formatted using this option. The supported formats are: raw, default, interpret, csv, and text. The \fIraw\fP option is described under the \fI\-\-raw\fP command line option. The \fIdefault\fP option is what you get when no formatting options are passed. It includes one line as a visual separator which indicates the time stamp and then the records of the event follow. The \fIinterpret\fP option is explained under the \fI\-i\fP command line option. The \fIcsv\fP option outputs the results of the search as a normalized event in comma separated value (CSV) format suitable for import into analytical programs. The \fItext\fP option turns the event into an English sentence that is easier to understand than other options, but it comes at the expense of loss of detail. In most cases this is perfectly fine since the original event still retains all the original information. .TP .BR \-ga ,\ \-\-gid\-all \ \fIall-group-id\fP Search for an event with either effective group ID or group ID matching the given \fIgroup ID\fP. .TP .BR \-ge ,\ \-\-gid\-effective \ \fIeffective-group-id\fP Search for an event with the given \fIeffective group ID\fP or group name. .TP .BR \-gi ,\ \-\-gid \ \fIgroup-id\fP Search for an event with the given \fIgroup ID\fP or group name. .TP .BR \-h ,\ \-\-help Help .TP .BR \-hn ,\ \-\-host \ \fIhost-name\fP Search for an event with the given \fIhost name\fP. The hostname can be either a hostname, fully qualified domain name, or numeric network address. No attempt is made to resolve numeric addresses to domain names or aliases. This search typically correlates to the addr or host field of audit events. Also see the \-\-node command which searches the node field. .TP .BR \-i ,\ \-\-interpret Interpret numeric entities into text. For example, uid is converted to account name. If the audit logs are unenriched, the conversion is done using the current resources of the machine where the search is being run. If you have renamed the accounts, or don't have the same accounts on your machine, you could get misleading results. If the logs are enriched, it uses the supplemental data to do the conversion. This allows accurate log reporting even when run on a different machine than the original logs came from. .TP .BR \-if ,\ \-\-input \ \fIfile-name\fP\ |\ \fIdirectory\fP Use the given \fIfile\fP or \fIdirectory\fP instead of the logs. This is to aid analysis where the logs have been moved to another machine or only part of a log was saved. The path length is limited to 4064 bytes. .TP .BR \-\-input\-logs Use the log file location from auditd.conf as input for searching. This is needed if you are using ausearch from a cron job. .TP .BR \-\-just\-one Stop after emitting the first event that matches the search criteria. .TP .BR \-k ,\ \-\-key \ \fIkey-string\fP Search for an event based on the given \fIkey string\fP. .TP .BR \-l ,\ \-\-line\-buffered Flush output on every line. Most useful when stdout is connected to a pipe and the default block buffering strategy is undesirable. May impose a performance penalty. .TP .BR \-m ,\ \-\-message \ \fImessage-type\fP\ |\ \fIcomma-sep-message-type-list\fP Search for an event matching the given \fImessage type\fP. (Message types are also known as record types.) You may also enter a \fIcomma separated list of message types\fP or multiple individual message types each with its own \fI-m\fP option. There is an \fBALL\fP message type that doesn't exist in the actual logs. It allows you to get all messages in the system. The list of valid messages types is long. The program will display the list whenever no message type is passed with this parameter. The message type can be either text or numeric. If you enter a list, there can be only commas and no spaces separating the list. .TP .BR \-n ,\ \-\-node Search for events originating from a specific machine. Multiple nodes are allowed, and if any nodes match, the event is matched. This search uses the node field in audit events. Also see the \-\-host command which search for events related to host information in the audit trail. .TP .BR \-o ,\ \-\-object \ \fISE-Linux-context-string\fP Search for event with \fItcontext\fP (object) matching the string. .TP .BR \-p ,\ \-\-pid \ \fIprocess-id\fP Search for an event matching the given \fIprocess ID\fP. .TP .BR \-pp ,\ \-\-ppid \ \fIparent-process-id\fP Search for an event matching the given \fIparent process ID\fP. .TP .BR \-r ,\ \-\-raw Output is completely unformatted. This is useful for extracting records to a file that can still be interpreted by audit tools or when piping to other audit tools. .TP .BR \-sc ,\ \-\-syscall \ \fIsyscall-name-or-value\fP Search for an event matching the given \fIsyscall\fP. You may either give the numeric syscall value or the syscall name. If you give the syscall name, it will use the syscall table for the machine that you are using. .TP .BR \-se ,\ \-\-context \ \fISE-Linux-context-string\fP Search for events with either \fIscontext\fP/subject or \fItcontext\fP/object matching the given string. .TP .BR \-\-session \ \fILogin-Session-ID\fP Search for events matching the given Login Session ID. This process attribute is set when a user logs in and can tie any process to a particular user login. .TP .BR \-su ,\ \-\-subject \ \fISE-Linux-context-string\fP Search for event with \fIscontext\fP (subject) matching the string. .TP .BR \-sv ,\ \-\-success \ \fIsuccess-value\fP Search for an event matching the given \fIsuccess value\fP. Legal values are .B yes and .BR no . .TP .BR \-te ,\ \-\-end \ [\fIend-date\fP]\ [\fIend-time\fP] Search for events with time stamps equal to or before the given end time. The format of end time depends on your locale. You can check the format of your locale by running .B date \(aq+%x\(aq. If the date is omitted, .B today is assumed. If the time is omitted, .B now is assumed. Use 24 hour clock time rather than AM or PM to specify time. An example date using the en_US.utf8 locale is 09/03/2009. An example of time is 18:00:00. The date format accepted is influenced by the LC_TIME environmental variable. You may also use the word: \fBnow\fP, \fBrecent\fP, \fBthis-hour\fP, \fBboot\fP, \fBtoday\fP, \fByesterday\fP, \fBthis\-week\fP, \fBweek\-ago\fP, \fBthis\-month\fP, or \fBthis\-year\fP. \fBNow\fP means starting now. \fBRecent\fP is 10 minutes ago. \fBBoot\fP means the time of day to the second when the system last booted. \fBToday\fP means now. \fBYesterday\fP is 1 second after midnight the previous day. \fBThis\-week\fP means starting 1 second after midnight on day 0 of the week determined by your locale (see \fBlocaltime\fP). \fBWeek\-ago\fP means 1 second after midnight exactly 7 days ago. \fBThis\-month\fP means 1 second after midnight on day 1 of the month. \fBThis\-year\fP means the 1 second after midnight on the first day of the first month. .TP .BR \-ts ,\ \-\-start \ [\fIstart-date\fP]\ [\fIstart-time\fP] Search for events with time stamps equal to or after the given start time. The format of start time depends on your locale. You can check the format of your locale by running .B date \(aq+%x\(aq. If the date is omitted, .B today is assumed. If the time is omitted, .B midnight is assumed. Use 24 hour clock time rather than AM or PM to specify time. An example date using the en_US.utf8 locale is 09/03/2009. An example of time is 18:00:00. The date format accepted is influenced by the LC_TIME environmental variable. You may also use the word: \fBnow\fP, \fBrecent\fP, \fBthis-hour\fP, \fBboot\fP, \fBtoday\fP, \fByesterday\fP, \fBthis\-week\fP, \fBweek\-ago\fP, \fBthis\-month\fP, \fBthis\-year\fP, or \fBcheckpoint\fP. \fBBoot\fP means the time of day to the second when the system last booted. \fBToday\fP means starting at 1 second after midnight. \fBRecent\fP is 10 minutes ago. \fBYesterday\fP is 1 second after midnight the previous day. \fBThis\-week\fP means starting 1 second after midnight on day 0 of the week determined by your locale (see \fBlocaltime\fP). \fBWeek\-ago\fP means starting 1 second after midnight exactly 7 days ago. \fBThis\-month\fP means 1 second after midnight on day 1 of the month. \fBThis\-year\fP means the 1 second after midnight on the first day of the first month. .sp \fBcheckpoint\fP means \fIausearch\fP will use the timestamp found within a valid checkpoint file ignoring the recorded inode, device, serial, node and event type also found within a checkpoint file. Essentially, this is the recovery action should an invocation of \fIausearch\fP with a checkpoint option fail with an exit status of 10, 11 or 12. It could be used in a shell script something like: .sp .in +5 .nf .na ausearch --checkpoint /etc/audit/auditd_checkpoint.txt -i _au_status=$? if test ${_au_status} eq 10 -o ${_au_status} eq 11 -o ${_au_status} eq 12 then ausearch --checkpoint /etc/audit/auditd_checkpoint.txt --start checkpoint -i fi .ad .fi .in -5 .TP .BR \-tm ,\ \-\-terminal \ \fIterminal\fP Search for an event matching the given \fIterminal\fP value. Some daemons such as cron and atd use the daemon name for the terminal. .TP .BR \-ua ,\ \-\-uid\-all \ \fIall-user-id\fP Search for an event with either user ID, effective user ID, or login user ID (auid) matching the given \fIuser ID\fP. .TP .BR \-ue ,\ \-\-uid\-effective \ \fIeffective-user-id\fP Search for an event with the given \fIeffective user ID\fP. .TP .BR \-ui ,\ \-\-uid \ \fIuser-id\fP Search for an event with the given \fIuser ID\fP. .TP .BR \-ul ,\ \-\-loginuid \ \fIlogin-id\fP Search for an event with the given \fIlogin user ID\fP. All entry point programs that are PAMified need to be configured with pam_loginuid required for the session for searching on loginuid (auid) to be accurate. .TP .BR \-uu ,\ \-\-uuid \ \fIguest-uuid\fP Search for an event with the given \fIguest UUID\fP. .TP .BR \-v ,\ \-\-version Print the version and exit .TP .BR \-vm ,\ \-\-vm-name \ \fIguest-name\fP Search for an event with the given \fIguest name\fP. .TP .BR \-w ,\ \-\-word String based matches must match the whole word. This category of matches include: filename, hostname, terminal, keys, and SE Linux context. .TP .BR \-x ,\ \-\-executable \ \fIexecutable\fP Search for an event matching the given \fIexecutable\fP name. .SH "EXIT STATUS" .TP 5 0 if OK, .TP 1 if nothing found, or argument errors or minor file access/read errors, .TP 10 invalid checkpoint data found in checkpoint file, .TP 11 checkpoint processing error .TP 12 checkpoint event not found in matching log file .SH NOTE The boot time option is a convenience function and has limitations. The time it calculates is based on time now minus /proc/uptime. If after boot the system clock has been adjusted, perhaps by ntp, then the calculation may be wrong. In that case you'll need to fully specify the time. You can check the time it would use by running: date -d "`cut \-f1 \-d. /proc/uptime` seconds ago" .SH EXAMPLES .nf Search for a specific user: # ausearch \-\-start today \-\-loginuid john \-i Check the SELinux log for any denials today # ausearch \-\-start today \-m avc \-i Output any recent SELinux log # ausearch \-m avc,user_avc,selinux_err,user_selinux_err \-i \-ts recent Output logs in text format # ausearch \-\-start today \-\-format text Output TTY events interpreted and shell escaped # ausearch \-\-start today \-m TTY \-i \-\-escape shell_quote .SH "SEE ALSO" .BR auditd (8), .BR auditd.conf (5), .BR aureport (8), .BR pam_loginuid (8). audit-4.0.2/docs/auparse_reset.30000644001034500103450000000077014655201403012166 .TH "AUPARSE_RESET" "3" "Sep 2014" "Red Hat" "Linux Audit API" .SH NAME auparse_reset \- reset audit parser instance .SH "SYNOPSIS" .B #include .sp int auparse_reset(auparse_state_t *au); .SH "DESCRIPTION" auparse_reset resets all internal cursors to the beginning. It closes files, descriptors, and frees memory buffers. .SH "RETURN VALUE" Returns \-1 if an error occurs; otherwise, 0 for success. .SH "SEE ALSO" .BR auparse_init (3), .BR auparse_destroy (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/ausearch_add_item.30000644001034500103450000000405614655201403012746 .TH "AUSEARCH_ADD_ITEM" "3" "Feb 2012" "Red Hat" "Linux Audit API" .SH NAME ausearch_add_item \- build up search rule .SH "SYNOPSIS" .B #include .sp int ausearch_add_item(auparse_state_t *au, const char *field, const char *op, const char *value, ausearch_rule_t how); .SH "DESCRIPTION" ausearch_add_item adds one search condition to the current audit search expression. The search conditions can then be used to scan logs, files, or buffers for something of interest. The field value is the field name that the value will be checked for. The op variable describes what kind of check is to be done. Legal op values are: .RS .TP .I "exists" just check that a field name exists .TP .I "=" locate the field name and check that the value associated with it is equal to the value given in this rule. .TP .I "!=" locate the field name and check that the value associated with it is NOT equal to the value given in this rule. .RE The value parameter is compared to the uninterpreted field value. If you are trying to match against a field who's type is AUPARSE_TYPE_ESCAPED, you will want to use the ausearch_add_interpreted_item() function instead. The how value determines how this search condition will affect the existing search expression if one is already defined. The possible values are: .RS .TP .I AUSEARCH_RULE_CLEAR Clear the current search expression, if any, and use only this search condition. .TP .I AUSEARCH_RULE_OR If a search expression .I E is already configured, replace it by \fB(\fIE\fB || \fIthis_search_condition\fB)\fR. .TP .I AUSEARCH_RULE_AND If a search expression .I E is already configured, replace it by \fB(\fIE\fB && \fIthis_search_condition\fB)\fR. .RE .SH "RETURN VALUE" Returns \-1 if an error occurs; otherwise, 0 for success. .SH "SEE ALSO" .BR ausearch_add_expression (3), .BR ausearch_add_interpreted_item (3), .BR ausearch_add_timestamp_item (3), .BR ausearch_add_regex (3), .BR ausearch_set_stop (3), .BR ausearch_clear (3), .BR ausearch_next_event (3), .BR ausearch_cur_event (3), .BR ausearch\-expression (5). .SH AUTHOR Steve Grubb audit-4.0.2/docs/auparse_set_eoe_timeout.30000644001034500103450000000145114655201403014232 .TH "AUPARSE_SET_EOE_TIMEOUT" "3" "January 2021" "Red Hat" "Linux Audit API" .SH NAME auparse_set_eoe_timeout \- set the end of event timeout value .SH "SYNOPSIS" .B #include .sp int auparse_set_eoe_timeout(time_t new_tmo) .SH "DESCRIPTION" auparse_set_eoe_timeout is used to set the end of event timeout value (seconds). The value should be a positive integer. If this function is called, it overrides any setting in /etc/auditd.conf. The function should be called after the \fIauparse_init()\fP function call. For details on the timeout, see the \fBend_of_event_timeout\fP configuration item description in \fIauditd.conf(5)\fP. .SH "RETURN VALUE" Returns \-1 if an error occurs; otherwise, 0 for success. .SH "SEE ALSO" .BR auparse_init (3). .BR auditd.conf (8). .SH AUTHOR Steve Grubb audit-4.0.2/docs/auparse_get_line_number.30000644001034500103450000000142614655201403014201 .TH "AUPARSE_GET_LINE_NUMBER" "3" "June 2016" "Red Hat" "Linux Audit API" .SH NAME auparse_get_line_number \- get line number where record was found .SH "SYNOPSIS" .B #include .sp unsigned int auparse_get_line_number(const auparse_state_t *au); .SH "DESCRIPTION" auparse_get_line_number will return the source input line number for the current record of the current event. Line numbers start at 1. If the source input type is AUSOURCE_FILE_ARRAY the line numbering will reset back to 1 each time a new line in the file array is opened. .SH "RETURN VALUE" Returns the line number. Line numbers are 1 based, a zero value indicates the line number information is unavailable. .SH "SEE ALSO" .BR auparse_get_filename (3). .BR auparse_next_record (3). .SH AUTHOR John Dennis audit-4.0.2/docs/set_aumessage_mode.30000644001034500103450000000243214655201403013152 .\" Copyright (C) 2004 IBM .\" This file is distributed according to the GNU General Public License. .\" See the file COPYING in the top level source directory for details. .de Sh \" Subsection .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Ip \" List item .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. .TH "SET_AUMESSAGE_MODE" 3 "2004-12-01" "Linux 2.6" "Linux Programmer's Manual" .SH NAME set_aumessage_mode \- Sets the message mode .SH "SYNOPSIS" .ad l .hy 0 #include .sp .HP 23 void\ \fBset_aumessage_mode\fR(message_t\ \fImode\fR, debug_message_t\ \fIdebug\fR); .ad .hy .SH "DESCRIPTION" .PP \fBset_aumessage_mode\fR sets the location where messages are sent and the output of the debug messages. If \fImode\fR=MSG_STDERR, then messages are sent to stderr. If \fImode\fR=MSG_SYSLOG, then messages are sent to syslog. If \fImode\fR=MSG_QUIET (default), then messages are not sent. If \fIdebug\fR=DBG_YES, then debug messages are output. If \fIdebug\fR=DBG_NO (default), then debug messages are not output. .SH "EXAMPLE" .nf /* Sample code */ set_aumessage_mode(MSG_SYSLOG, DBG_YES) .fi .SH "RETURN VALUE" None. .SH "SEE ALSO" .BR auditd (8), .BR audit_open (3). .SH AUTHOR Debora Velarde. audit-4.0.2/docs/auparse_goto_field_num.30000644001034500103450000000135214655201403014033 .TH "AUPARSE_GOTO_FIELD_NUM" "3" "Dec 2016" "Red Hat" "Linux Audit API" .SH NAME auparse_goto_field_num \- move field cursor to specific field .SH "SYNOPSIS" .B #include .sp int auparse_goto_field_num(const auparse_state_t *au, unsigned int num); .SH "DESCRIPTION" auparse_goto_field_num will move the internal library cursors to point to a specific field number in the current record. Fields within the same record are numbered starting from 0. This is generally not needed but there are some cases where one may want precise control over the exact field being looked at. .SH "RETURN VALUE" Returns 0 on error or 1 for success. .SH "SEE ALSO" .BR auparse_get_field_num (3), auparse_goto_record_num (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/auparse_get_milli.30000644001034500103450000000106714655201403013011 .TH "AUPARSE_GET_MILLI" "3" "Sept 2007" "Red Hat" "Linux Audit API" .SH NAME auparse_get_milli \- get the millisecond value of the event .SH "SYNOPSIS" .B #include .sp unsigned int auparse_get_milli(const auparse_state_t *au); .SH "DESCRIPTION" auparse_get_milli gets the millisecond value of the current event. .SH "RETURN VALUE" Returns 0 if an error occurs; otherwise, the value of the millisecond portion of the timestamp. .SH "SEE ALSO" .BR auparse_get_timestamp (3), .BR auparse_get_time (3). .BR auparse_get_node (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/audit_add_rule_data.30000644001034500103450000000366714655201403013272 .TH "AUDIT_ADD_RULE_DATA" "3" "Aug 2009" "Red Hat" "Linux Audit API" .SH NAME audit_add_rule_data \- Add new audit rule .SH "SYNOPSIS" .B #include .sp int audit_add_rule_data(int fd, struct audit_rule_data *rule, int flags, int action); .SH "DESCRIPTION" audit_add_rule_data adds an audit rule previously constructed with audit_rule_fieldpair_data(3) to one of several kernel event filters. The filter is specified by the flags argument. Possible values for flags are: .TP 3 \(bu AUDIT_FILTER_USER - Apply rule to userspace generated messages. This is the user filter. Normally all user space originating events are accepted. Rules on this filter are typically written to block specific events. .TP \(bu AUDIT_FILTER_TASK - Apply rule at task creation (not syscall). This is the task filter. It's normally used to exclude an application from being audited. .TP \(bu AUDIT_FILTER_EXIT - Apply rule at syscall exit. This is the main filter that is used for syscalls and filesystem watches. Normally all syscall do not trigger events, so this is normally used to specify events that are of interest. .TP \(bu AUDIT_FILTER_EXCLUDE - Apply rule at audit_log_start. This is the exclude filter which discards any records that match. The action type is ignored for this filter, defaulting to "never". .LP .TP \(bu AUDIT_FILTER_FS - Apply rule when adding PATH auxiliary records to SYSCALL events. This is the filesystem filter. This is used to ignore PATH records that are not of interest. .LP .PP The rule's action has two possible values: .TP 3 \(bu AUDIT_NEVER - Do not build context if rule matches. .TP \(bu AUDIT_ALWAYS - Generate audit record if rule matches. .LP .SH "RETURN VALUE" The return value is <= 0 on error, otherwise it is the netlink sequence id number. This function can have any error that sendto would encounter. .SH "SEE ALSO" .BR audit_rule_fieldpair_data (3), .BR audit_delete_rule_data (3), .BR auditctl (8). .SH AUTHOR Steve Grubb. audit-4.0.2/docs/auparse_next_record.30000644001034500103450000000144614655201403013361 .TH "AUPARSE_NEXT_RECORD" "3" "Feb 2007" "Red Hat" "Linux Audit API" .SH NAME auparse_next_record \- move record cursor .SH "SYNOPSIS" .B #include .sp int auparse_next_record(auparse_state_t *au); .SH "DESCRIPTION" auparse_next_record will move the internal library cursors to point to the next record of the current event. You should not call this function from a feed interface callback function. Doing so will deadlock the code. In that scenario, you should check the number of records in the current event with auparse_get_num_records and only call this if there are more records. .SH "RETURN VALUE" Returns \-1 if an error occurs, 0 if no more records in current event, or 1 for success. .SH "SEE ALSO" .BR auparse_next_event (3), auparse_get_num_records (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/auparse_interpret_field.30000644001034500103450000000450514655201403014223 .TH "AUPARSE_INTERPRET_FIELD" "3" "August 2017" "Red Hat" "Linux Audit API" .SH NAME .nf auparse_interpret_field, auparse_interpret_realpath,auparse_interpret_sock_family,auparse_interpret_sock_port,auparse_interpret_sock_address \- get current field's interpreted value .fi .SH "SYNOPSIS" .nf .B #include .sp const char *auparse_interpret_field(const auparse_state_t *au); const char *auparse_interpret_realpath(const auparse_state_t *au); const char *auparse_interpret_sock_family(auparse_state_t *au); const char *auparse_interpret_sock_port(auparse_state_t *au); const char *auparse_interpret_sock_address(auparse_state_t *au); .SH "DESCRIPTION" .B auparse_interpret_field allows access to the interpreted value in the current field of the current record in the current event. The returned string is escaped using the chosen method. The returned value will be destroyed if you call this function again. If you need to interpret another field and keep this value, you will have to copy it for later use. Examples of things that could be interpreted are: uid, gid, syscall numbers, exit codes, file paths, socket addresses, permissions, modes, and capabilities. There are likely to be more in the future. If a value cannot be interpreted, its original value is returned. .B auparse_interpret_realpath is like auparse_interpret_field except that it will call realpath on the results of gluing the cwd and file together. This also implies that it only valid to be called for the file name given in a PATH record. .B auparse_interpret_sock_family will only return the socket family portion of a socket address. .B auparse_interpret_sock_port will only return the port portion of a socket address. Not all socket families have a port. If that is the case, you will get a NULL value in which case your best option is to use the normal interpretation function. .B auparse_interpret_sock_address will only return the address portion of a socket address. Not all socket families have an ip address. If that is the case, you will get a NULL value in which case your best option is to use the normal interpretation function. .SH "RETURN VALUE" Returns NULL if there is an error otherwise a pointer to the interpreted value. .SH "SEE ALSO" .BR auparse_get_field_int (3), .BR auparse_get_field_str (3), .BR auparse_set_escape_mode (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/audit_name_to_flag.30000644001034500103450000000142414655201403013122 .TH "AUDIT_NAME_TO_FLAG" "3" "Mar 2022" "Red Hat" "Linux Audit API" .SH NAME audit_name_to_flag \- Convert the rule-matching filter name to the numeric rule-matching filter value .SH "SYNOPSIS" .nf .B #include .PP .BI "int audit_name_to_flag(const char " *flag ); .fi .SH "DESCRIPTION" .BR audit_name_to_flag () converts the rule-matching filter name ("task", "exit", "user", "exclude", "filesystem") to the numeric rule-matching filter value (AUDIT_FILTER_TASK, AUDIT_FILTER_EXIT, AUDIT_FILTER_USER, AUDIT_FILTER_EXCLUDE, AUDIT_FILTER_FS). .I flag is the rule-matching filter name. .SH "RETURN VALUE" Returns -1 if an error occurs; otherwise, the return value is the numeric rule-matching filter value. .SH "SEE ALSO" .BR audit_flag_to_name (3), .SH AUTHOR Steve Grubb audit-4.0.2/docs/auparse_get_field_int.30000644001034500103450000000106214655201403013633 .TH "AUPARSE_GET_FIELD_INT" "3" "Feb 2007" "Red Hat" "Linux Audit API" .SH NAME auparse_get_field_int \- get current field's value as an int .SH "SYNOPSIS" .B #include .sp int auparse_get_field_int(auparse_state_t *au); .SH "DESCRIPTION" auparse_get_field_int allows access to the value as an int of the current field of the current record in the current event. .SH "RETURN VALUE" Returns \-1 if there is an error with errno set appropriately or the value if errno is zero. .SH "SEE ALSO" .BR auparse_get_field_str (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/auparse_goto_record_num.30000644001034500103450000000134314655201403014226 .TH "AUPARSE_GOTO_RECORD_NUM" "3" "May 2008" "Red Hat" "Linux Audit API" .SH NAME auparse_goto_record_num \- move record cursor to specific record .SH "SYNOPSIS" .B #include .sp int auparse_goto_record_num(const auparse_state_t *au, unsigned int num); .SH "DESCRIPTION" auparse_goto_record_num will move the internal library cursors to point to a specific physical record number. Records within the same event are numbered starting from 0. This is generally not needed but there are some cases where one may want precise control over the exact record being looked at. .SH "RETURN VALUE" Returns 0 on error or 1 for success. .SH "SEE ALSO" .BR auparse_get_num_records (3), auparse_next_record (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/audit_name_to_syscall.30000644001034500103450000000137014655201403013663 .TH "AUDIT_NAME_TO_SYSCALL" "3" "Nov 2021" "Red Hat" "Linux Audit API" .SH NAME audit_name_to_syscall \- Convert the syscall name to the numeric syscall value .SH "SYNOPSIS" .nf .B #include .PP .BI "int audit_name_to_syscall(const char " *sc ", int " machine ); .fi .SH "DESCRIPTION" .BR audit_name_to_syscall () converts the syscall name to the numeric syscall value. .I sc is the syscall name. .I machine is the enum value of the machine type defined in machine_t. .I machine can be obtained by calling .BR audit_detect_machine (3). .SH "RETURN VALUE" Returns -1 if an error occurs; otherwise, the return value is the numeric syscall value. .SH "SEE ALSO" .BR audit_syscall_to_name (3), .BR audit_detect_machine (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/ausearch_add_interpreted_item.30000644001034500103450000000377514655201403015362 .TH "AUSEARCH_ADD_INTERPRETED_ITEM" "3" "Nov 2007" "Red Hat" "Linux Audit API" .SH NAME ausearch_add_interpreted_item \- build up search rule .SH "SYNOPSIS" .B #include .sp int ausearch_add_interpreted_item(auparse_state_t *au, const char *field, const char *op, const char *value, ausearch_rule_t how); .SH "DESCRIPTION" ausearch_add_interpreted_item adds one search condition to the current audit search expression. The search conditions can then be used to scan logs, files, or buffers for something of interest. The field value is the field name that the value will be checked for. The op variable describes what kind of check is to be done. Legal op values are: .RS .TP .I "exists" just check that a field name exists .TP .I "=" locate the field name and check that the value associated with it is equal to the value given in this rule. .TP .I "!=" locate the field name and check that the value associated with it is NOT equal to the value given in this rule. .RE The value parameter is compared to the interpreted field value (the value that would be returned by \fBauparse_interpret_field\fR(3)). The how value determines how this search condition will affect the existing search expression if one is already defined. The possible values are: .RS .TP .I AUSEARCH_RULE_CLEAR Clear the current search expression, if any, and use only this search condition. .TP .I AUSEARCH_RULE_OR If a search expression .I E is already configured, replace it by \fB(\fIE\fB || \fIthis_search_condition\fB)\fR. .TP .I AUSEARCH_RULE_AND If a search expression .I E is already configured, replace it by \fB(\fIE\fB && \fIthis_search_condition\fB)\fR. .RE .SH "RETURN VALUE" Returns \-1 if an error occurs; otherwise, 0 for success. .SH "SEE ALSO" .BR ausearch_add_expression (3), .BR ausearch_add_item (3), .BR ausearch_add_timestamp_item (3), .BR ausearch_add_regex (3), .BR ausearch_set_stop (3), .BR ausearch_clear (3), .BR ausearch_next_event (3), .BR ausearch_cur_event (3), .BR ausearch\-expression (5). .SH AUTHOR Steve Grubb audit-4.0.2/docs/ausearch_add_timestamp_item.30000644001034500103450000000364414655201403015033 .TH "AUSEARCH_ADD_TIMESTAMP_ITEM" "3" "Aug 2014" "Red Hat" "Linux Audit API" .SH NAME ausearch_add_timestamp_item \- build up search rule .SH "SYNOPSIS" .B #include .sp int ausearch_add_timestamp_item(auparse_state_t *au, const char *op, time_t sec, unsigned milli, ausearch_rule_t how) .SH "DESCRIPTION" ausearch_add_timestamp_item adds an event time condition to the current audit search expression. The search conditions can then be used to scan logs, files, or buffers for something of interest. The op parameter specifies the desired comparison. Legal op values are \fI<\fR, \fI<=\fR, \fI>=\fR, \fI>\fR and \fI=\fR. The left operand of the comparison operator is the timestamp of the examined event, the right operand is specified by the sec and milli parameters. The how value determines how this search condition will affect the existing search expression if one is already defined. The possible values are: .RS .TP .I AUSEARCH_RULE_CLEAR Clear the current search expression, if any, and use only this search condition. .TP .I AUSEARCH_RULE_OR If a search expression .I E is already configured, replace it by \fB(\fIE\fB || \fIthis_search_condition\fB)\fR. .TP .I AUSEARCH_RULE_AND If a search expression .I E is already configured, replace it by \fB(\fIE\fB && \fIthis_search_condition\fB)\fR. .RE .SH "RETURN VALUE" Returns \-1 if an error occurs; otherwise, 0 for success. .SH APPLICATION USAGE Use .BR ausearch_add_item (3) and .BR ausearch_add_interpreted_item (3) to add conditions that check audit record fields. Use .BR ausearch_add_expression (3) to add complex search expressions using a single function call. .SH "SEE ALSO" .BR ausearch_add_expression (3), .BR ausearch_add_item (3), .BR ausearch_add_interpreted_item (3), .BR ausearch_add_regex (3), .BR ausearch_set_stop (3), .BR ausearch_clear (3), .BR ausearch_next_event (3), .BR ausearch_cur_event (3), .BR ausearch\-expression (5). .SH AUTHOR Miloslav Trmac audit-4.0.2/docs/get_auditfail_action.30000644001034500103450000000437514655201403013467 .\" Copyright (C) 2006 HP .\" This file is distributed according to the GNU General Public License. .\" See the file COPYING in the top level source directory for details. .de Sh \" Subsection .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Ip \" List item .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. .TH "GET_AUDITFAIL_ACTION" 3 "2006-7-10" "Linux 2.7" "Linux Programmer's Manual" .SH NAME get_auditfail_action \- Get failure_action tunable value .SH "SYNOPSIS" .ad l .hy 0 #include .sp .HP 19 int\ \fBget_auditfail_action\fR(auditfail_t *\fIfailmode\fR); .ad .hy .SH "DESCRIPTION" .PP This function gets the failure_action tunable value stored in \fB/etc/libaudit.conf\fR. \fBget_auditfail_action\fR should be called after an \fBaudit_open\fR call returns an error to see what action the admin prefers. .PP The failure_action value found in \fB/etc/libaudit.conf\fR is copied into the \fIfailmode\fR argument upon function return. This value should then be used by the calling application to determine what action should be taken when the audit subsystem is unavailable. .SH "RETURN VALUE" .PP Upon success, \fBget_auditfail_action\fR returns a zero, and the \fIfailmode\fR argument will hold the failure_action value. The possible values for failure_action are: FAIL_IGNORE (0), FAIL_LOG (1), and FAIL_TERMINATE (2). Upon failure, \fBget_auditfail_action\fR returns a return code of one. .SH "ERRORS" .PP An error is returned if there is an error reading \fB/etc/libaudit.conf\fR or if the failure_action tunable is not found in the file. .SH "EXAMPLES" .PP /* Sample code */ auditfail_t failmode; if ((fd = audit_open() ) < 0 ) { fprintf (stderr, "Cannot open netlink audit socket"); /* Get the failure_action */ if ((rc = get_auditfail_action(&failmode)) == 0) { if (failmode == FAIL_LOG) fprintf (stderr, "Audit subsystem unavailable"); else if (failmode == FAIL_TERMINATE) exit (1); /* If failmode == FAIL_IGNORE, do nothing */ } } .SH "SEE ALSO" .BR audit_open (3), .BR auditd (8). .SH AUTHOR Lisa M. Smith. audit-4.0.2/docs/zos-remote.conf.50000644001034500103450000000512014655201403012350 .\" Copyright (c) International Business Machines Corp., 2007 .\" .\" 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 .\" .\" Changelog: .\" 2007-10-06, created by Klaus Heinrich Kiwi .\" .TH ZOS\-REMOTE.CONF 5 "Oct 2007" "IBM" "System Administration Utilities" .SH NAME zos\-remote.conf \- the audisp-racf plugin configuration file .SH DESCRIPTION .B zos\-remote.conf controls the configuration for the .BR audispd\-zos\-remote (8) Audit dispatcher plugin. The default location for this file is .IR /etc/audit/zos\-remote.conf , however, a different file can be specified as the first argument to the .B audispd\-zos\-remote plugin. See .BR audispd\-zos\-remote (8) and .BR auditd (8). The options available are as follows: .TP .I server This is the IBM z/OS ITDS server hostname or IP address .TP .I port The port number where ITDS is running on the z/OS server. Default is 389 (ldap port) .TP .I user The z/OS RACF user ID which the audispd\-zos\-remote plugin will use to perform Remote Audit requests. This user needs READ access to FACILITY Class resource IRR.LDAP.REMOTE.AUDIT (See .BR audispd\-zos\-remote (8)). .TP .I password The password associated the the z/OS user ID configured above. .TP .I timeout The number in seconds that .B audispd\-zos\-remote plugin will wait before giving up in connection attempts and event submissions. The default value is 15 .TP .I q_depth The .B audispd\-zos\-remote plugin will queue inputted events to the maximum of .I q_depth events while trying to submit those remotely. This can handle burst of events or in case of a slow network connection. However, the .B audispd\-zos\-remote plugin will drop events in case the queue is full. The default queue depth is 64 - Increase this value in case you are experiencing event drop due to full queue .RB ( audispd\-zos\-remote will log this to syslog). .SH "SEE ALSO" .BR audispd\-zos\-remote (8) .SH AUTHOR Klaus Heinrich Kiwi audit-4.0.2/docs/auparse_get_num_records.30000644001034500103450000000075314655201403014224 .TH "AUPARSE_GET_NUM_RECORDS" "3" "Feb 2007" "Red Hat" "Linux Audit API" .SH NAME auparse_get_num_records \- get the number of records .SH "SYNOPSIS" .B #include .sp unsigned int auparse_get_num_records(const auparse_state_t *au); .SH "DESCRIPTION" auparse_get_num_records gets the number of records in the current event. .SH "RETURN VALUE" Returns 0 if an error occurs; otherwise, the number of records. .SH "SEE ALSO" .BR auparse_next_record (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/audit_open.30000644001034500103450000000145514655201403011454 .TH "AUDIT_OPEN" "3" "Oct 2006" "Red Hat" "Linux Audit API" .SH NAME audit_open \- Open a audit netlink socket connection .SH "SYNOPSIS" .B #include .sp int audit_open(void); .SH "DESCRIPTION" audit_open creates a NETLINK_AUDIT socket for communication with the kernel part of the Linux Audit Subsystem. The audit system uses the ACK feature of netlink. This means that every message to the kernel will return a netlink status packet even if the operation succeeds. .SH "RETURN VALUE" Returns \-1 if an error occurs; otherwise, the return value is a descriptor referencing the socket. .SH ERRORS The .BR audit_open () function may fail and set .I errno for any of the errors specified for the .BR socket (2) and .BR fcntl (2) routines. .SH "SEE ALSO" .BR netlink (7). .SH AUTHOR Steve Grubb audit-4.0.2/docs/auparse_set_escape_mode.30000644001034500103450000000267714655201403014173 .TH "AUPARSE_SET_ESCAPE_MODE" "3" "July 2016" "Red Hat" "Linux Audit API" .SH NAME auparse_set_escape_mode \- choose escape method .SH "SYNOPSIS" .B #include .sp void auparse_set_escape_mode(auparse_state_t *au, auparse_esc_t mode); .SH "DESCRIPTION" auparse_set_escape_mode is used to set the escaping method that will be used to output interpreted text. The choices for the mode variable are: .RS .TP .B AUPARSE_ESC_RAW No escaping of any kind is done. .TP .B AUPARSE_ESC_TTY Escape TTY control characters so that they are harmless to display on a terminal. When any control character is found, they are displayed as octal numbers. This is the default mode that the auparse library is initialized with. .TP .B AUPARSE_ESC_SHELL Besides escaping control characters, this will escape some characters that can cause problems when used with shell scripting. Any escaped control characters are displayed as octal numbers. Other escaped characters are proceeded with a backslash. The additional characters it escapes are: " ' ` $ \\ .TP .B AUPARSE_ESC_SHELL_QUOTE Similar to .I AUPARSE_ESC_SHELL but expands the character set to include shell operators. Any escaped control characters are displayed as octal numbers. Other escaped characters are proceeded with a backslash. The additional characters it escapes include: ; ' \ " ` # $ & * ? [ ] < > { } \\ .RE .SH "RETURN VALUE" None .SH "SEE ALSO" .BR auparse_interpret_field (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/ausearch-expression.50000644001034500103450000001306614655201403013320 .TH "AUSEARCH-EXPRESSION" "5" "Feb 2008" "Red Hat" "Linux Audit" .SH NAME ausearch-expression \- audit search expression format .SH OVERVIEW This man page describes the format of "ausearch expressions". Parsing and evaluation of these expressions is provided by libauparse and is common to applications that use this library. .SH LEXICAL STRUCTURE White space (ASCII space, tab and new-line characters) between tokens is ignored. The following tokens are recognized: .TP Punctuation .B ( ) \e .TP Logical operators .B ! && || .TP Comparison operators .B < <= == > >= !== i= i!= r= r!= .TP Unquoted strings Any non-empty sequence of ASCII letters, digits, and the .B _ symbol. .TP Quoted strings A sequence of characters surrounded by the .B \(dq quotes. The .B \e character starts an escape sequence. The only defined escape sequences are .B \e\e and \fB\e\(dq\fR. The semantics of other escape sequences is undefined. .TP Regexps A sequence of characters surrounded by the .B / characters. The .B \e character starts an escape sequence. The only defined escape sequences are .B \e\e and \fB\e/\fR. The semantics of other escape sequences is undefined. .PP Anywhere an unquoted string is valid, a quoted string is valid as well, and vice versa. In particular, field names may be specified using quoted strings, and field values may be specified using unquoted strings. .SH EXPRESSION SYNTAX The primary expression has one of the following forms: .IP .I field comparison-operator value .B \eregexp .I string-or-regexp .PP .I field is either a string, which specifies the first field with that name within the current audit record, or the .B \e escape character followed by a string, which specifies a virtual field with the specified name (virtual fields are defined in a later section). .I field is a string. .I operator specifies the comparison to perform .TP .B r= r!= Get the "raw" string of \fIfield\fR, and compare it to \fIvalue\fR. For fields in audit records, the "raw" string is the exact string stored in the audit record (with all escaping and unprintable character encoding left alone); applications can read the "raw" string using .BR auparse_get_field_str (3). Each virtual field may define a "raw" string. If .I field is not present or does not define a "raw" string, the result of the comparison is .B false (regardless of the operator). .TP .B i= i!= Get the "interpreted" string of \fIfield\fR, and compare it to \fIvalue\fR. For fields in audit records, the "interpreted" string is an "user-readable" interpretation of the field value; applications can read the "interpreted" string using .BR auparse_interpret_field (3). Each virtual field may define an "interpreted" string. If .I field is not present or does not define an "interpreted" string, the result of the comparison is .B false (regardless of the operator). .TP .B < <= == > >= !== Evaluate the "value" of \fIfield\fR, and compare it to \fIvalue\fR. A "value" may be defined for any field or virtual field, but no "value" is currently defined for any audit record field. The rules of parsing \fIvalue\fR for comparing it with the "value" of .I field are specific for each \fIfield\fR. If .I field is not present, the result of the comparison is .B false (regardless of the operator). If .I field does not define a "value", an error is reported when parsing the expression. .PP In the special case of .B \eregexp \fIregexp-or-string\fR, the current audit record is taken as a string (without interpreting field values), and matched against \fIregexp-or-string\fR. .I regexp-or-string is an extended regular expression, using a string or regexp token (in other words, delimited by .B \(dq or \fB/\fR). If .I E1 and .I E2 are valid expressions, then .B ! \fIE1\fR, .I E1 .B && \fIE2\fR, and .I E1 .B || .I E2 are valid expressions as well, with the usual C semantics and evaluation priorities. Note that .B ! .I field op value is interpreted as \fB!(\fIfield op value\fB)\fR, not as \fB(!\fIfield\fB)\fI op value\fR. .SH VIRTUAL FIELDS The following virtual fields are defined: .TP .B \etimestamp The value is the timestamp of the current event. .I value must be formatted as: .sp .in +5 .nf .na ts:seconds.milli .ad .fi .in -5 .sp where .I seconds and .I milli are decimal numbers specifying the seconds and milliseconds part of the timestamp, respectively. .TP .B \etimestamp_ex This is similar to .B \etimestamp but also includes the event's serial number. .I value must be formatted as: .sp .in +5 .nf .na ts:seconds.milli:serial .ad .fi .in -5 .sp where .I serial is a decimal number specifying the event's serial number. .TP .B \erecord_type The value is the type of the current record. .I value is either the record type name, or a decimal number specifying the type. .SH SEMANTICS The expression as a whole applies to a single record. The expression is .B true for a specified event if it is .B true for any record associated with the event. .SH EXAMPLES As a demonstration of the semantics of handling missing fields, the following expression is .B true if .I field is present: .IP .B (\fIfield\fB r= \(dq\(dq) || (\fIfield\fB r!= \(dq\(dq) .PP and the same expression surrounded by .B !( and .B ) is .B true if .I field is not present. .SH FUTURE DIRECTIONS New escape sequences for quoted strings may be defined. For currently defined virtual fields that do not define a "raw" or "interpreted" string, the definition may be added. Therefore, don't rely on the fact that comparing the "raw" or "interpreted" string of the field with any value is \fBfalse\fR. New formats of value constants for the .B \etimestamp virtual field may be added. .SH AUTHOR Miloslav Trmac audit-4.0.2/docs/audit_syscall_to_name.30000644001034500103450000000137214655201403013665 .TH "AUDIT_SYSCALL_TO_NAME" "3" "Nov 2021" "Red Hat" "Linux Audit API" .SH NAME audit_syscall_to_name \- Convert the numeric syscall value to the syscall name .SH "SYNOPSIS" .nf .B #include .PP .BI "const char *audit_syscall_to_name(int " sc ", int " machine ); .fi .SH "DESCRIPTION" .BR audit_syscall_to_name () converts the numeric syscall value to the syscall name. .I sc is the numeric syscall value. .I machine is the enum value of the machine type defined in machine_t. .I machine can be obtained by calling .BR audit_detect_machine (3). .SH "RETURN VALUE" Returns NULL if an error occurs; otherwise, the return value is the syscall name. .SH "SEE ALSO" .BR audit_name_to_syscall (3), .BR audit_detect_machine (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/auditd.conf.50000644001034500103450000005230314655201403011523 .TH AUDITD.CONF "5" "August 2018" "Red Hat" "System Administration Utilities" .SH NAME auditd.conf \- audit daemon configuration file .SH DESCRIPTION The file .I /etc/audit/auditd.conf contains configuration information specific to the audit daemon. Each line should contain one configuration keyword, an equal sign, and then followed by appropriate configuration information. All option names and values are case insensitive. The keywords recognized are listed and described below. Each line should be limited to 160 characters or the line will be skipped. You may add comments to the file by starting the line with a '#' character. .TP .I local_events This yes/no keyword specifies whether or not to include local events. Normally you want local events so the default value is yes. Cases where you would set this to no is when you want to aggregate events only from the network. At the moment, this is useful if the audit daemon is running in a container. This option can only be set once at daemon start up. Reloading the config file has no effect. .TP .I log_file This keyword specifies the full path name to the log file where audit records will be stored. It must be a regular file. .TP .I write_logs This yes/no keyword determines whether or not to write logs to the disk. Normally you want this so the default is yes. .TP .I log_format The log format describes how the information should be stored on disk. There are 2 options: raw and enriched. If set to .IR RAW , the audit records will be stored in a format exactly as the kernel sends it. The .IR ENRICHED option will resolve all uid, gid, syscall, architecture, and socket address information before writing the event to disk. This aids in making sense of events created on one system but reported/analyzed on another system. The .I NOLOG option is now deprecated. If you were setting this format, now you should set the write_logs option to no. .TP .I log_group This keyword specifies the group that is applied to the log file's permissions. The default is root. The group name can be either numeric or spelled out. .TP .I priority_boost This is a non-negative number that tells the audit daemon how much of a priority boost it should take. The default is 4. No change is 0. .TP .I flush Valid values are .IR none ", " incremental ", " incremental_async ", " data ", and " sync ". If set to .IR none , no special effort is made to flush the audit records to disk. If set to .IR incremental , Then the .I freq parameter is used to determine how often an explicit flush to disk is issued. The .IR incremental_async parameter is very much like .IR incremental except the flushing is done asynchronously for higher performance. The .I data parameter tells the audit daemon to keep the data portion of the disk file sync'd at all times. The .I sync option tells the audit daemon to keep both the data and meta-data fully sync'd with every write to disk. The default value is incremental_async. .TP .I freq This is a non-negative number that tells the audit daemon how many records to write before issuing an explicit flush to disk command. This value is only valid when the .I flush keyword is set to .IR incremental or incremental_async. .TP .I num_logs This keyword specifies the number of log files to keep if rotate is given as the .I max_log_file_action. If the number is < 2, logs are not rotated. This number must be 999 or less. The default is 0 - which means no rotation. As you increase the number of log files being rotated, you may need to adjust the kernel backlog setting upwards since it takes more time to rotate the files. This is typically done in /etc/audit/audit.rules. If log rotation is configured to occur, the daemon will check for excess logs and remove them in effort to keep disk space available. The excess log check is only done on startup and when a reconfigure results in a space check. .TP .I name_format This option controls how computer node names are inserted into the audit event stream. It has the following choices: .IR none ", " hostname ", " fqd ", " numeric ", and " user ". .IR None means that no computer name is inserted into the audit event. .IR hostname is the name returned by the gethostname syscall. The .IR fqd means that it takes the hostname and resolves it with dns for a fully qualified domain name of that machine. .IR Numeric is similar to fqd except it resolves the IP address of the machine. In order to use this option, you might want to test that 'hostname \-i' or 'domainname \-i' returns a numeric address. Also, this option is not recommended if dhcp is used because you could have different addresses over time for the same machine. .IR User is an admin defined string from the name option. The default value is .IR none ". .TP .I name This is the admin defined string that identifies the machine if .IR user is given as the .IR name_format option. .TP .I max_log_file This keyword specifies the maximum file size in megabytes. When this limit is reached, it will trigger a configurable action. The value given must be numeric. .TP .I max_log_file_action This parameter tells the system what action to take when the system has detected that the max file size limit has been reached. Valid values are .IR ignore ", " syslog ", " suspend ", " rotate " and "keep_logs. If set to .IR ignore , the audit daemon does nothing. .IR syslog means that it will issue a warning to syslog. .IR suspend will cause the audit daemon to stop writing records to the disk. The daemon will still be alive. The .IR rotate option will cause the audit daemon to rotate the logs. It should be noted that logs with higher numbers are older than logs with lower numbers. This is the same convention used by the logrotate utility. The .IR keep_logs option is similar to rotate except it does not use the num_logs setting. This prevents audit logs from being overwritten. The effect is that logs accumulate and are not deleted \- which will trigger the .I space_left_action if the volume fills up. This is best used in combination with an external script used to archive logs on a periodic basis. .TP .I verify_email This option determines if the email address given in .IR action_mail_acct is checked to see if the domain name can be resolved. This option must be given before .IR action_mail_acct or the default value of yes will be used. .TP .I action_mail_acct This option should contain a valid email address or alias. The default address is root. If the email address is not local to the machine, you must make sure you have email properly configured on your machine and network. Also, this option requires that /usr/lib/sendmail exists on the machine. .TP .I space_left If the free space in the filesystem containing .IR log_file drops below this value, the audit daemon takes the action specified by .IR space_left_action . If the value of .IR space_left is specified as a whole number, it is interpreted as an absolute size in megabytes (MiB). If the value is specified as a number between 1 and 99 followed by a percentage sign (e.g., 5%), the audit daemon calculates the absolute size in megabytes based on the size of the filesystem containing .IR log_file . (E.g., if the filesystem containing .IR log_file is 2 gigabytes in size, and .IR space_left is set to 25%, then the audit daemon sets .IR space_left to approximately 500 megabytes. Note that this calculation is performed when the audit daemon starts, so if you resize the filesystem containing .IR log_file while the audit daemon is running, you should send the audit daemon SIGHUP to re-read the configuration file and recalculate the correct percentage. .TP .I space_left_action This parameter tells the system what action to take when the system has detected that it is starting to get low on disk space. Valid values are .IR ignore ", " syslog ", " rotate ", " email ", " exec ", " suspend ", " single ", and " halt . If set to .IR ignore , the audit daemon does nothing. .I syslog means that it will issue a warning to syslog. .I rotate will rotate logs, losing the oldest to free up space. .I Email means that it will send a warning to the email account specified in .I action_mail_acct as well as sending the message to syslog. .I exec /path-to-script will execute the script. You cannot pass parameters to the script. The script is also responsible for telling the auditd daemon to resume logging once its completed its action. This can be done by adding service auditd resume to the script. .I suspend will cause the audit daemon to stop writing records to the disk. The daemon will still be alive. The .I single option will cause the audit daemon to put the computer system in single user mode. The .I halt option will cause the audit daemon to shutdown the computer system. Except for rotate, it will perform this action just one time. .TP .I admin_space_left This is a numeric value in megabytes that tells the audit daemon when to perform a configurable action because the system .B is running low on disk space. This should be considered the last chance to do something before running out of disk space. The numeric value for this parameter should be lower than the number for space_left. You may also append a percent sign (e.g. 1%) to the number to have the audit daemon calculate the number based on the disk partition size. .TP .I admin_space_left_action This parameter tells the system what action to take when the system has detected that it .B is low on disk space. Valid values are .IR ignore ", " syslog ", "rotate ", " email ", " exec ", " suspend ", " single ", and " halt . If set to .IR ignore , the audit daemon does nothing. .I Syslog means that it will issue a warning to syslog. .I rotate will rotate logs, losing the oldest to free up space. .I Email means that it will send a warning to the email account specified in .I action_mail_acct as well as sending the message to syslog. .I exec /path-to-script will execute the script. You cannot pass parameters to the script. The script is also responsible for telling the auditd daemon to resume logging once its completed its action. This can be done by adding service auditd resume to the script. .I Suspend will cause the audit daemon to stop writing records to the disk. The daemon will still be alive. The .I single option will cause the audit daemon to put the computer system in single user mode. The .I halt option will cause the audit daemon to shutdown the computer system. Except for rotate, it will perform this action just one time. .TP .I disk_full_action This parameter tells the system what action to take when the system has detected that the partition to which log files are written has become full. Valid values are .IR ignore ", " syslog ", " rotate ", " exec ", " suspend ", " single ", and " halt . If set to .IR ignore , the audit daemon will issue a syslog message but no other action is taken. .I Syslog means that it will issue a warning to syslog. .I rotate will rotate logs, losing the oldest to free up space. .I exec /path-to-script will execute the script. You cannot pass parameters to the script. The script is also responsible for telling the auditd daemon to resume logging g once its completed its action. This can be done by adding service auditd resume to the script. .I Suspend will cause the audit daemon to stop writing records to the disk. The daemon will still be alive. The .I single option will cause the audit daemon to put the computer system in single user mode. .I halt option will cause the audit daemon to shutdown the computer system. .TP .I disk_error_action This parameter tells the system what action to take whenever there is an error detected when writing audit events to disk or rotating logs. Valid values are .IR ignore ", " syslog ", " exec ", " suspend ", " single ", and " halt . If set to .IR ignore , the audit daemon will not take any action. .I Syslog means that it will issue no more than 5 consecutive warnings to syslog. .I exec /path-to-script will execute the script. You cannot pass parameters to the script. .I Suspend will cause the audit daemon to stop writing records to the disk. The daemon will still be alive. The .I single option will cause the audit daemon to put the computer system in single user mode. .I halt option will cause the audit daemon to shutdown the computer system. .TP .I tcp_listen_port This is a numeric value in the range 1..65535 which, if specified, causes auditd to listen on the corresponding TCP port for audit records from remote systems. The audit daemon may be linked with tcp_wrappers. You may want to control access with an entry in the hosts.allow and deny files. If this is deployed on a systemd based OS, then you may need to adjust the 'After' directive. See the note in the auditd.service file. .TP .I tcp_listen_queue This is a numeric value which indicates how many pending (requested but unaccepted) connections are allowed. The default is 5. Setting this too small may cause connections to be rejected if too many hosts start up at exactly the same time, such as after a power failure. This setting is only used for aggregating servers. Clients logging to a remote server should keep this commented out. .TP .I tcp_max_per_addr This is a numeric value which indicates how many concurrent connections from one IP address is allowed. The default is 1 and the maximum is 1024. Setting this too large may allow for a Denial of Service attack on the logging server. Also note that the kernel has an internal maximum that will eventually prevent this even if auditd allows it by config. The default should be adequate in most cases unless a custom written recovery script runs to forward unsent events. In this case you would increase the number only large enough to let it in too. .TP .I use_libwrap This setting determines whether or not to use tcp_wrappers to discern connection attempts that are from allowed machines. Legal values are either .IR yes ", or " no " The default value is yes. .TP .I tcp_client_ports This parameter may be a single numeric value or two values separated by a dash (no spaces allowed). It indicates which client ports are allowed for incoming connections. If not specified, any port is allowed. Allowed values are 1..65535. For example, to require the client use a privileged port, specify .I 1\-1023 for this parameter. You will also need to set the local_port option in the audisp-remote.conf file. Making sure that clients send from a privileged port is a security feature to prevent log injection attacks by untrusted users. .TP .I tcp_client_max_idle This parameter indicates the number of seconds that a client may be idle (i.e. no data from them at all) before auditd complains. This is used to close inactive connections if the client machine has a problem where it cannot shutdown the connection cleanly. Note that this is a global setting, and must be higher than any individual client heartbeat_timeout setting, preferably by a factor of two. The default is zero, which disables this check. .TP .I transport If set to .IR TCP ", only clear text tcp connections will be used. If set to .IR KRB5 ", then Kerberos 5 will be used for authentication and encryption. The default value is TCP. .TP .I enable_krb5 This option is deprecated. Use the .IR transport option above instead. If set to "yes", Kerberos 5 will be used for authentication and encryption. The default is "no". If this option is set to "yes" and it follows the transport option, it will override the transport setting. This would be the normal expected behavior for backwards compatibility. .TP .I krb5_principal This is the principal for this server. The default is "auditd". Given this default, the server will look for a key named like .I auditd/hostname@EXAMPLE.COM stored in .I /etc/audit/audit.key to authenticate itself, where hostname is the canonical name for the server's host, as returned by a DNS lookup of its IP address. .TP .I krb5_key_file Location of the key for this client's principal. Note that the key file must be owned by root and mode 0400. The default is .I /etc/audit/audit.key .TP .I distribute_network If set to "yes", network originating events will be distributed to the audit dispatcher for processing. The default is "no". .TP .I q_depth This is a numeric value that tells how big to make the internal queue of the audit event dispatcher. A bigger queue lets it handle a flood of events better, but could hold events that are not processed when the daemon is terminated. If you get messages in syslog about events getting dropped, increase this value. The default value is 2000. .TP .I overflow_action This option determines how the daemon should react to overflowing its internal queue. When this happens, it means that more events are being received than it can pass along to child processes. This error means that it is going to lose the current event that it's trying to dispatch. This option has the following choices: .IR ignore ", " syslog ", " suspend ", " single ", and " halt ". If set to .IR ignore , the audit daemon does nothing. .I syslog means that it will issue a warning to syslog. .I suspend will cause the audit daemon to stop sending events to child processes. The daemon will still be alive. The .I single option will cause the audit daemon to put the computer system in single user mode. .I halt option will cause the audit daemon to shutdown the computer system. .TP .I max_restarts This is a non-negative number that tells the audit event dispatcher how many times it can try to restart a crashed plugin. The default is 10. .TP .I plugin_dir This is the location that auditd will use to search for its plugin configuration files. .TP .I end_of_event_timeout This is a non-negative number of seconds used by the userspace .I auparse() library routines and the .I aureport(8) , .I ausearch(8) utilities to consider an event is complete when parsing an event log stream. For an event stream being processed, if the time of the current event is over .I end_of_event_timeout seconds old, compared to co-located events, then the event is considered complete. See the NOTES section for more detail. .SH NOTES In a CAPP environment, the audit trail is considered so important that access to system resources must be denied if an audit trail cannot be created. In this environment, it would be suggested that /var/log/audit be on its own partition. This is to ensure that space detection is accurate and that no other process comes along and consumes part of it. .PP The flush parameter should be set to sync or data. .PP Max_log_file and num_logs need to be adjusted so that you get complete use of your partition. It should be noted that the more files that have to be rotated, the longer it takes to get back to receiving audit events. Max_log_file_action should be set to keep_logs. .PP Space_left should be set to a number that gives the admin enough time to react to any alert message and perform some maintenance to free up disk space. This would typically involve running the \fBaureport \-t\fP report and moving the oldest logs to an archive area. The value of space_left is site dependent since the rate at which events are generated varies with each deployment. The space_left_action is recommended to be set to email. If you need something like an snmp trap, you can use the exec option to send one. .PP Admin_space_left should be set to the amount of disk space on the audit partition needed for admin actions to be recorded. Admin_space_left_action would be set to single so that use of the machine is restricted to just the console. .PP The disk_full_action is triggered when no more room exists on the partition. All access should be terminated since no more audit capability exists. This can be set to either single or halt. .PP The disk_error_action should be set to syslog, single, or halt depending on your local policies regarding handling of hardware malfunctions. .PP Specifying a single allowed client port may make it difficult for the client to restart their audit subsystem, as it will be unable to recreate a connection with the same host addresses and ports until the connection closure TIME_WAIT state times out. .PP Auditd events are made up of one or more records. The auditd system cannot guarantee that the set of records that make up an event will occur atomically, that is the stream will have interleaved records of different events, IE .PP .RS .br event0_record0 .br event1_record0 .br event2_record0 .br event1_record3 .br event2_record1 .br event1_record4 .br event3_record0 .br .RE .PP The auditd system does not guarantee that the records that make up an event will appear in order. Thus, when processing event streams, we need to maintain a list of events with their own list of records hence List of List (LOL) event processing. When processing an event stream we define the end of an event via .P .RS record type = AUDIT_EOE (audit end of event type record), or .br record type = AUDIT_PROCTITLE (we note the AUDIT_PROCTITLE is always the last record), or .br record type = AUDIT_KERNEL (kernel events are one record events), or .br record type < AUDIT_FIRST_EVENT (only single record events appear before this type), or .br record type >= AUDIT_FIRST_ANOM_MSG (only single record events appear after this type), or .br record type >= AUDIT_MAC_UNLBL_ALLOW && record type <= AUDIT_MAC_CALIPSO_DEL (these are also one record events), or .br for the stream being processed, the time of the event is over end_of_event_timeout seconds old. .RE .SH FILES .TP .I /etc/audit/auditd.conf Audit daemon configuration file .SH "SEE ALSO" .BR auditd (8), .BR audisp\-remote.conf (5), .BR auditd\-plugins (5). .SH AUTHOR Steve Grubb audit-4.0.2/docs/auparse_get_record_text.30000644001034500103450000000076014655201403014224 .TH "AUPARSE_GET_RECORD_TEXT" "3" "Feb 2007" "Red Hat" "Linux Audit API" .SH NAME auparse_get_record_text \- access unparsed record data .SH "SYNOPSIS" .B #include .sp const char *auparse_get_record_text(const auparse_state_t *au); .SH "DESCRIPTION" auparse_get_record_text returns a pointer to the full unparsed record. .SH "RETURN VALUE" Returns NULL if an error occurs; otherwise, a pointer to the record. .SH "SEE ALSO" .BR auparse_next_record (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/audit_detect_machine.30000644001034500103450000000114614655201403013444 .TH "AUDIT_DETECT_MACHINE" "3" "Oct 2006" "Red Hat" "Linux Audit API" .SH NAME audit_detect_machine \- Detects the current machine type .SH "SYNOPSIS" .B #include .sp int audit_detect_machine(void); .SH "DESCRIPTION" audit_detect_machine queries uname and converts the kernel machine string to an enum value defined in machine_t. The machine type is needed for any use of the audit_name_to_syscall function. .SH "RETURN VALUE" Returns \-1 if an error occurs; otherwise, the return value is the machine's type. .SH "SEE ALSO" .BR uname (3), .BR audit_name_to_syscall (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/auparse_flush_feed.30000644001034500103450000000112514655201403013143 .TH "AUPARSE_FLUSH_FEED" "3" "Apr 2016" "Red Hat" "Linux Audit API" .SH NAME auparse_flush_feed \- flush any unconsumed feed data through parser. .SH "SYNOPSIS" .B #include .sp int auparse_flush_feed(auparse_state_t *au); .SH "DESCRIPTION" .I auparse_flush_feed should be called to signal the end of feed input data and flush any pending parse data through the parsing system. .SH "RETURN VALUE" Returns \-1 if an error occurs; otherwise, 0 for success. .SH "SEE ALSO" .BR auparse_feed (3), .BR auparse_feed_age_events (3), .BR auparse_feed_has_data (3) .SH AUTHOR John Dennis audit-4.0.2/docs/audit.rules.70000644001034500103450000003125614655201403011572 .TH AUDIT.RULES "7" "Sep 2023" "Red Hat" "System Administration Utilities" .SH NAME audit.rules \- a set of rules loaded in the kernel audit system .SH DESCRIPTION \fBaudit.rules\fP is a file containing audit rules that will be loaded by the audit daemon's init script whenever the daemon is started. The auditctl program is used by the initscripts to perform this operation. The syntax for the rules is essentially the same as when typing in an auditctl command at a shell prompt except you do not need to type the auditctl command name since that is implied. The audit rules come in 3 varieties: .IR control ", " file ", and " syscall ". .SS Control Control commands generally involve configuring the audit system rather than telling it what to watch for. These commands typically include deleting all rules, setting the size of the kernel's backlog queue, setting the failure mode, setting the event rate limit, or to tell auditctl to ignore syntax errors in the rules and continue loading. Generally, these rules are at the top of the rules file. .SS File System File System rules are sometimes called watches. These rules are used to audit access to particular files or directories that you may be interested in. If the path given in a watch rule is a directory, then the rule used is recursive to the bottom of the directory tree excluding any directories that may be mount points. The syntax of these watch rules generally follow this format: .nf .B \-a always,exit \-F arch=b64 -F path=path-to-file -F perm=permissions -F key=keyname .fi where the permission are any one of the following: .RS .TP 2 .B r - read of the file .TP .B w - write to the file .TP .B x - execute the file .TP .B a - change in the file's attribute .RE For best performance, you should supply an .B arch field in the rule. The individual permissions will cause the selection of specific system calls that use that kind of access. Not supplying the arch will cause the selection of all system calls which will affect performance as all system calls will be evaluated. Watches can also be created using the deprecated \-w format which allows for backwards compatibility at the expense of system performance as explained. Using syscall rules as shown above, you can choose between .B path and .B dir which is against a specific inode or directory tree respectively. It should also be noted that the recursive directory watch will stop if there is a mount point below the parent directory. There is an option to make the mounted subdirectory equivalent by using a .B -q rule. .SS System Call The system call rules are loaded into a matching engine that intercepts each syscall that all programs on the system makes. Therefore it is very important to only use syscall rules when you have to since these affect performance. The more rules, the bigger the performance hit. You can help the performance, though, by combining syscalls into one rule whenever possible. The Linux kernel has 6 rule matching lists or filters as they are sometimes called. They are: task, exit, user, exclude, filesystem, and io_uring. The task list is checked only during the fork or clone syscalls. It is rarely used in practice. The exit filter is the place where all syscall and file system audit requests are evaluated. The user filter is used to filter (remove) some events that originate in user space. By default, any event originating in user space is allowed. So, if there are some events that you do not want to see, then this is a place where some can be removed. See auditctl(8) for fields that are valid. The exclude filter is used to exclude certain events from being emitted. The msgtype and a number of subject attribute fields can be used to tell the kernel which message types you do not want to record. This filter can remove the event as a whole and is not selective about any other attribute. The user and exit filters are better suited to selectively auditing events. The action is ignored for this filter, defaulting to "never". The io_uring filter is used to watch underlying syscalls performed by io_uring operations. Syscall rules take the general form of: .nf .B \-a action,list \-S syscall \-F field=value \-k keyname .fi The .B \-a option tells the kernel's rule matching engine that we want to append a rule at the end of the rule list. But we need to specify which rule list it goes on and what action to take when it triggers. Valid actions are: .RS .TP 7 .B always - always create an event .TP .B never - never create an event .RE The action and list are separated by a comma but no space in between. Valid lists are: .IR task ", " exit ", " user ", " exclude ", " filesystem ", and "io_uring ". Their meaning was explained earlier. Next in the rule would normally be the .B \-S option. This field can either be the syscall name or number. For readability, the name is almost always used. You may give more than one syscall in a rule by specifying another .B \-S option. When sent into the kernel, all syscall fields are put into a mask so that one compare can determine if the syscall is of interest. So, adding multiple syscalls in one rule is very efficient. When you specify a syscall name, auditctl will look up the name and get its syscall number. This leads to some problems on bi-arch machines. The 32 and 64 bit syscall numbers sometimes, but not always, line up. So, to solve this problem, you would generally need to break the rule into 2 with one specifying \-F arch=b32 and the other specifying \-F arch=b64. This needs to go in front of the .B \-S option so that auditctl looks at the right lookup table when returning the number. After the syscall is specified, you would normally have one or more .B \-F options that fine tune what to match against. Rather than list all the valid field types here, the reader should look at the auditctl man page which has a full listing of each field and what it means. But it's worth mentioning a couple things. The audit system considers uids to be unsigned numbers. The audit system uses the number \-1 to indicate that a loginuid is not set. This means that when it's printed out, it looks like 4294967295. But when you write rules, you can use either "unset" which is easy to remember, or -1, or 4294967295. They are all equivalent. If you write a rule that you wanted try to get the valid users of the system, you need to look in /etc/login.defs to see where user accounts start. For example, if UID_MIN is 1000, then you would also need to take into account that the unsigned representation of \-1 is higher than 500. So you would address this with the following piece of a rule: .nf \-F auid>=1000 \-F auid!=unset .fi These individual checks are "anded" and both have to be true. The last thing to know about syscall rules is that you can add a key field which is a free form text string that you want inserted into the event to help identify its meaning. This is discussed in more detail in the NOTES section. .SH NOTES The purpose of auditing is to be able to do an investigation periodically or whenever an incident occurs. A few simple steps in planning up front will make this job easier. The best advice is to use keys in both the watches and system call rules to give the rule a meaning. If rules are related or together meet a specific requirement, then give them a common key name. You can use this during your investigation to select only results with a specific meaning. When doing an investigation, you would normally start off with the main aureport output to just get an idea about what is happening on the system. This report mostly tells you about events that are hard coded by the audit system such as login/out, uses of authentication, system anomalies, how many users have been on the machine, and if SE Linux has detected any AVCs. .nf aureport \-\-start this-week .fi After looking at the report, you probably want to get a second view about what rules you loaded that have been triggering. This is where keys become important. You would generally run the key summary report like this: .nf aureport \-\-start this-week \-\-key \-\-summary .fi This will give an ordered listing of the keys associated with rules that have been triggering. If, for example, you had a syscall audit rule that triggered on the failure to open files with EPERM that had a key field of access like this: .nf \-a always,exit \-F arch=b64 \-S open \-S openat \-S openat2 \-F exit=\-EPERM \-k access .fi Then you can isolate these failures with ausearch and pipe the results to aureport for display. Suppose your investigation noticed a lot of the access denied events. If you wanted to see the files that unauthorized access has been attempted, you could run the following command: .nf ausearch \-\-start this-week \-k access \-\-raw | aureport \-\-file \-\-summary .fi This will give an ordered list showing which files are being accessed with the EPERM failure. Suppose you wanted to see which users might be having failed access, you would run the following command: .nf ausearch \-\-start this-week \-k access \-\-raw | aureport \-\-user \-\-summary .fi If your investigation showed a lot of failed accesses to a particular file, you could run the following report to see who is doing it: .fi ausearch \-\-start this-week \-k access \-f /path-to/file \-\-raw | aureport \-\-user \-i .fi This report will give you the individual access attempts by person. If you needed to see the actual audit event that is being reported, you would look at the date, time, and event columns. Assuming the event was 822 and it occurred at 2:30 on 09/01/2009 and you use the en_US.utf8 locale, the command would look something like this: .nf ausearch \-\-start 09/01/2009 02:30 \-a 822 \-i \-\-just\-one .fi This will select the first event from that day and time with the matching event id and interpret the numeric values into human readable values. The most important step in being able to do this kind of analysis is setting up key fields when the rules were originally written. It should also be pointed out that you can have more than one key field associated with any given rule. .SH TROUBLESHOOTING If you are not getting events on syscall rules that you think you should, try running a test program under strace so that you can see the syscalls. There is a chance that you might have identified the wrong syscall. If you get a warning from auditctl saying, "32/64 bit syscall mismatch in line XX, you should specify an arch". This means that you specified a syscall rule on a bi-arch system where the syscall has a different syscall number for the 32 and 64 bit interfaces. This means that on one of those interfaces you are likely auditing the wrong syscall. To solve the problem, re-write the rule as two rules specifying the intended arch for each rule. For example, .nf \-a always,exit \-S openat \-k access .fi would be rewritten as .nf \-a always,exit \-F arch=b32 \-S openat \-k access \-a always,exit \-F arch=b64 \-S openat \-k access .fi If you get a warning that says, "entry rules deprecated, changing to exit rule". This means that you have a rule intended for the entry filter, but that filter is no longer available. Auditctl moved your rule to the exit filter so that it's not lost. But to solve this so that you do not get the warning any more, you need to change the offending rule from entry to exit. .SH EXAMPLES The following rule shows how to audit failed access to files due to permission problems. Note that it takes two rules for each arch ABI to audit this since file access can fail with two different failure codes indicating permission problems. .nf .B \-a always,exit \-F arch=b32 \-S open,openat,openat2 \-F exit=\-EACCES \-k access .B \-a always,exit \-F arch=b32 \-S open,openat,openat2 \-F exit=\-EPERM \-k access .B \-a always,exit \-F arch=b64 \-S open,openat,openat2 \-F exit=\-EACCES \-k access .B \-a always,exit \-F arch=b64 \-S open,openat,openat2 \-F exit=\-EPERM \-k access .fi .SH IO_URING RULES Io_uring rules do not take an arch field. It is implicit in the specification of the filter. The following example rule watches for file opens through the io_uring subsystem: .nf .B \-a always,io_uring \-S openat,openat2 \-F key=access .SH HARD WIRED EVENTS If auditing is enabled, then you can get any event that is not caused by syscall or file watch rules (because you don't have any rules loaded). So, that means, any event from 1100-1299, 1326, 1328, 1331 and higher can be emitted. The reason that there are a number of events that are hardwired is because they are required by regulatory compliance and are sent automatically as a convenience. (For example, logon/logoff is a mandatory event in all security guidance.) If you don't want this, you can use the exclude filter to drop events that you do not want. .nf .B \-a always,exclude -F msgtype=CRED_REFR .fi .SH "SEE ALSO" .BR auditctl (8), .BR auditd (8). .SH AUTHOR Steve Grubb audit-4.0.2/docs/auparse_add_callback.30000644001034500103450000000315414655201403013407 .TH "AUPARSE_ADD_CALLBACK" "3" "May 2007" "Red Hat" "Linux Audit API" .SH NAME auparse_add_callback \- add a callback handler for notifications .SH "SYNOPSIS" .B #include .sp .nf .B void auparse_add_callback(auparse_state_t *au, auparse_callback_ptr callback, void *user_data, user_destroy user_destroy_func); .fi .SH "DESCRIPTION" auparse_add_callback adds a callback function to the parse state which is invoked to notify the application of parsing events. This is part of the event feed API. The signature of the callback is: .nf void auparse_callback(auparse_state_t *au, auparse_cb_event_t cb_event_type, void *user_data); .fi When the callback is invoked it is passed: .TP .I au a pointer to the parse_state .TP .I cb_event_type enumerated value indicating the reason why the callback was invoked .TP .I user_data pointer to user supplied private data. May be NULL. . .TP .I user_destroy_func pointer to function called when user_data is destroyed. May be NULL. The signature is: .br .sp .nf void destroy(void *user_data); .fi .br .sp The destroy() function should be prepared to accept user_data possibly being NULL. .PP The .I cb_event_type argument indicates why the callback was invoked. It's possible values are: .br .TP .B AUPARSE_CB_EVENT_READY A complete event has been parsed and is ready to be examined. This is logically equivalent to the parse state immediately following .I auparse_next_event() .PP See auparse_feed(3) for a complete code example. . .SH "RETURN VALUE" None. .SH "SEE ALSO" .BR auparse_feed (3), .BR auparse_flush_feed (3). .SH AUTHOR John Dennis audit-4.0.2/docs/auparse_new_buffer.30000644001034500103450000000143214655201403013162 .TH "AUPARSE_NEW_BUFFER" "3" "Feb 2021" "Red Hat" "Linux Audit API" .SH NAME auparse_new_buffer \- replace the buffer in the parser .SH "SYNOPSIS" .B #include .sp .nf int auparse_new_buffer(auparse_state_t *au, const char *data, size_t data_len); .fi .TP .I au The audit parse state .TP .I data a buffer of data to give to the parser, it is .I data_len bytes long. The data is copied in the parser, upon return the caller may free or reuse the data buffer. .TP .I data_len number of bytes in .I data .SH "DESCRIPTION" .I auparse_new_buffer replaces the data that the parser works on. .I auparse_init() must have been called with a source type of AUSOURCE_BUFFER. .SH "RETURN VALUE" Returns 1 if an error occurs; otherwise, 0 for success. .SH "SEE ALSO" .BR auparse_init (3) audit-4.0.2/docs/auparse_first_record.30000644001034500103450000000110614655201403013523 .TH "AUPARSE_FIRST_RECORD" "3" "Sep 2014" "Red Hat" "Linux Audit API" .SH NAME auparse_first_record \- reposition record cursor .SH "SYNOPSIS" .B #include .sp int auparse_first_record(auparse_state_t *au); .SH "DESCRIPTION" auparse_first_record repositions the internal cursors of the parsing library to point to the first field of the first record in the current event. .SH "RETURN VALUE" Returns \-1 if an error occurs, 0 if there is no event data, or 1 for success. .SH "SEE ALSO" .BR auparse_next_event (3), .BR auparse_next_record (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/audit_get_session.30000644001034500103450000000137214655201403013033 .TH "AUDIT_GET_SESSION" "3" "Dec 2016" "Red Hat" "Linux Audit API" .SH NAME audit_get_session \- Get a program's login session id value .SH SYNOPSIS .B #include .sp uin32_t audit_get_session(void); .SH DESCRIPTION This function returns the task's session id attribute. .SH "RETURN VALUE" This function returns the session id value if it was set. It will return a \-1 if the session id is unset. However, since uint32_t is an unsigned type, you will see the converted value instead of \-1. .SH "ERRORS" This function returns \-2 on failure. Additionally, in the event of a real error, errno would be set. The function can set errno based on failures of open, read, or strtoul. .SH "SEE ALSO" .BR audit_getloginuid (3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/auditd-plugins.50000644001034500103450000001162614655201403012261 .TH AUDITD-PLUGINS "5" "Jan 2024" "Red Hat" "System Administration Utilities" .SH NAME auditd-plugins \- realtime event receivers .SH DESCRIPTION \fBauditd\fP can multiplex audit events in realtime. It takes audit events and distributes them to child programs that want to analyze events in realtime. When the audit daemon receives a SIGTERM or SIGHUP, it passes that signal to its child processes so that can reload the configuration or terminate. The child programs install a configuration file in a plugins directory which defaults to \fI/etc/audit/plugins.d\fP. This can be controlled by a auditd.conf config option .B plugin_dir if the admin wished to locate plugins somewhere else. But auditd will install its plugins in the default location. The plugin directory will be scanned and every plugin that is active will be started. If the plugin has a problem and exits, it will be started a maximum of .B max_restarts times as found in auditd.conf. Config file names are not allowed to have more than one '.' in the name or it will be treated as a backup copy and skipped. Config file options are given one per line with an equal sign between the keyword and its value. The available options are as follows: .TP .I active The options for this are .IR yes or .IR no. .TP .I direction The option is dictated by the plugin. .IR In or .IR out are the only choices. You cannot make a plugin operate in a way it wasn't designed just by changing this option. This option is to give a clue to the event dispatcher about which direction events flow. NOTE: inbound events are not supported yet. .TP .I path This is the absolute path to the plugin executable. In the case of internal plugins, it would be the name of the plugin. .TP .I type This tells the dispatcher how the plugin wants to be run. There is only one valid option, .IR always , which means the plugin is external and should always be run. The default is always since there are no more builtin plugins. .TP .I args This allows you to pass arguments to the child program. Generally plugins do not take arguments and have their own config file that instructs them how they should be configured. At the moment, there is a limit of 2 args. .TP .I format The valid options for this are .IR binary and .IR string. .IR Binary passes the data exactly as the audit event dispatcher gets it from the audit daemon. The .IR string option tells the dispatcher to completely change the event into a string suitable for parsing with the audit parsing library. The default value is .IR string. .SH NOTE auditd has an internal queue to hold events for plugins. (See the \fIq_depth\fP setting in \fIauditd.conf\fP.) Plugins have to watch for and dequeue events as fast as possible and queue them internally if they can't be immediately processed. If the plugin is not able to dequeue records, the auditd internal queue will get filled. At any time, as root, you can run the following to check auditd's metrics: auditctl --signal cont ; sleep 1 ; cat /var/run/auditd.state If auditd's internal queue fills, it cannot dequeue any events from the kernel backlog. If the kernel's backlog fills, it looks at the value of backlog_wait_time to delay all processes that generate an event to see if there is eventually room to add the event. This will likely be noticed as slowing down various processes on the machine. The kernel's audit subsystem can be checked by running: auditctl -s When tuning the audit system's performance, you'd want to check both kernel and auditd metrics and adjust accordingly. .SH NOTES FOR DEVELOPERS When the audit daemon starts your plugin, you will be running as root. If you do not need root privileges, you should change uid/gid to lower chances of being a target for exploit. If you need to retain capabilities, using \fBlibcap-ng\fP is the simplest way. Your environment is not going to be clean. You are inheriting many attributes from auditd itself. You will need to adjust your \fBsignal mask\fP, \fBsigaction\fP, \fBumask\fP, and \fBenvironmental variables\fP. Look at the auditd man page to see which signals auditd used. Plugins are expected to handle \fBSIGTERM\fP and \fBSIGHUP\fP. You will also inherit the resource limits of auditd. Note that some of these resource limits, such as maximum number of open descriptors, are controlled by systemd. You also inherit auditd's nice value. You might want to adjust that to be sure to keep up with incoming audit events. Auditd will send events to the plugin on it's \fBstdin\fP. The plugin has to keep this descriptor empty so that events don't back up. If you do significant processing of each event, you should add an internal queue to your design in order to keep events flowing. The \fBauparse_feed\fP function is the preferred way to examine whole events if you need to analyze the contents of the events. .SH FILES /etc/auditd/auditd.conf /etc/audit/plugins.d .SH "SEE ALSO" .BR auditd.conf (5), .BR auditd (8), .BR execve(2), .BR auparse_feed(3). .SH AUTHOR Steve Grubb audit-4.0.2/docs/audit_set_backlog_limit.30000644001034500103450000000145714655201403014170 .TH "AUDIT_SET_BACKLOG_LIMIT" "3" "Oct 2006" "Linux Audit API" .SH NAME audit_set_backlog_limit \- Set the audit backlog limit .SH "SYNOPSIS" .B #include .sp int audit_set_backlog_limit(int fd, uint32_t limit); .SH "DESCRIPTION" audit_set_backlog_limit sets the queue length for audit events awaiting transfer to the audit daemon. The default value is 64 which can potentially be overrun by bursts of activity. When the backlog limit is reached, the kernel consults the failure_flag to see what action to take. .SH "RETURN VALUE" The return value is <= 0 on error, otherwise it is the netlink sequence id number. This function can have any error that sendto would encounter. .SH "SEE ALSO" .BR audit_set_failure (3), .BR audit_open (3), .BR auditd (8), .BR auditctl (8). .SH AUTHOR Steve Grubb audit-4.0.2/docs/audispd-zos-remote.80000644001034500103450000002242314655201403013063 .\" Copyright (c) International Business Machines Corp., 2007 .\" .\" 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 .\" .\" Changelog: .\" 2007-10-06, created by Klaus Heinrich Kiwi .\" .TH AUDISPD-ZOS-REMOTE 8 "Oct 2007" "IBM" "System Administration Utilities" .SH NAME audispd\-zos\-remote \- z/OS Remote-services Audit dispatcher plugin .SH SYNOPSIS .B audispd\-zos\-remote [ .I config-file .B ] .SH DESCRIPTION .B audispd\-zos\-remote is a remote-auditing plugin for the Audit subsystem. It should be started by the .BR auditd (8) daemon and will forward all incoming audit events, as they happen, to a configured z/OS SMF (Service Management Facility) database, through an IBM Tivoli Directory Server (ITDS) set for Remote Audit service. See .B SMF MAPPING section below for more information about the resulting SMF record format. .BR auditd (8) must be configured to start the plugin. This is done by a configuration file usually located at .IR /etc/audit/plugins.d/audispd\-zos\-remote.conf , but multiple instances can be spawned by having multiple configuration files in .I /etc/audit/plugins.d for the same plugin executable (see .BR auditd (8)). Each instance needs a configuration file, located by default at .IR /etc/audit/zos\-remote.conf . Check .BR zos\-remote.conf (5) for details about the plugin configuration. .SH OPTIONS .IP config-file Use an alternate configuration file instead of .IR /etc/audit/zos\-remote.conf . .SH SIGNALS .B audispd\-zos\-remote reacts to SIGTERM and SIGHUP signals (according to the .BR auditd (8) specification): .TP .B SIGHUP Instructs the .B audispd\-zos\-remote plugin to re-read it's configuration and flush existing network connections. .TP .B SIGTERM Performs a clean exit. .B audispd\-zos\-remote will wait up to 10 seconds if there are queued events to be delivered, dropping any remaining queued events after that time. .SH IBM z/OS ITDS Server and RACF configuration In order to use this plugin, you must have an IBM z/OS v1R8 (or higher) server with IBM Tivoli Directory Server (ITDS) configured for Remote Audit service. For more detailed information about how to configure the z/OS server for Remote Auditing, refer to .B z/OS V1R8.0-9.0 Integrated Security Services Enterprise Identity Mapping (EIM) Guide and Reference .nf .RI ( http://publibz.boulder.ibm.com/cgi\-bin/bookmgr_OS390/FRAMESET/EIMA1140/CCONTENTS?DT=20070827115119 ), chapter "2.0 - Working with remote services". .fi .SS Enable ITDS to process Remote Audit requests To enable ITSD to process Remote Audit requests, the user ID associated with ITDS must be granted READ access to the IRR.AUDITX FACILITY Class profile (the profile used to protect the R_Auditx service). This user ID can usually be found in the STARTED Class profile for the ITDS started procedure. If the identity associated with ITDS is .IR ITDSUSER , the administrator can configure RACF to grant Remote Auditing processing to ITDS with the following TSO commands: .TP .I TSO Commands: Grant ITDSUSER READ access to IRR.AUDITX FACILITY Class profile .nf rdefine FACILITY IRR.RAUDITX uacc(none) permit IRR.RAUDITX class(FACILITY) id(ITDSUSER) access(READ) .fi .SS Create/enable RACF user ID to perform Remote Audit requests A z/OS RACF user ID is needed by the plugin - Every Audit request performed by the plugin will use a RACF user ID, as configured in the plugin configuration .BR zos\-remote.conf (5). This user ID needs READ access to FACILITY Class resource IRR.LDAP.REMOTE.AUDIT. If the user ID is .IR BINDUSER , the administrator can configure RACF to enable this user to perform Remote Auditing requests with the following TSO commands: .TP .I TSO Commands: Enable BINDUSER to perform Remote Audit requests .nf rdefine FACILITY IRR.LDAP.REMOTE.AUDIT uacc(none) permit IRR.LDAP.REMOTE.AUDIT class(FACILITY) id(BINDUSER) access(READ) .fi .SS Add @LINUX Class to RACF When performing remote auditing requests, the .B audispd\-zos\-remote plugin will use the special .B @LINUX .I CDT Class and the audit record type (eg.: .BR SYSCALL , .BR AVC , .BR PATH ...) as the .I CDT Resource Class for all events processed. To make sure events are logged, the RACF server must be configured with a Dynamic CDT Class named .B @LINUX with correct sizes and attributes. The following TSO commands can be used to add this class: .TP .I TSO Commands: Add @LINUX CDT Class .nf rdefine cdt @LINUX cdtinfo(posit(493) FIRST(alpha,national,numeric,special) OTHER(alpha,national,numeric,special) RACLIST(REQUIRED) case(asis) generic(allowed) defaultuacc(none) maxlength(246)) setr classact(cdt) setr raclist(cdt) setr raclist(cdt) refresh setr classact(@LINUX) setr raclist(@LINUX) setr generic(@LINUX) .fi .SS Add profiles to the @LINUX Class Once the CDT Class has been defined, you can add profiles to it, specifying resources (wildcards allowed) to log or ignore. The following are examples: .TP .I TSO Commands: Log only AVC records (One generic and one discrete profile): .nf rdefine @LINUX * uacc(none) audit(none(read)) rdefine @LINUX AVC uacc(none) audit(all(read)) setr raclist(@LINUX) refresh .fi .TP .I TSO Commands: Log everything (One generic profile): .nf rdefine @LINUX * uacc(none) audit(all(read)) setr raclist(@LINUX) refresh .fi .P Resources always match the single profile with the .I best match. There are many other ways to define logging in RACF. Please refer to the server documentation for more details. .SH SMF Mapping The ITDS Remote Audit service will cut SMF records of type 83 subtype 4 every time it processes a request. This plugin will issue a remote audit request for every incoming Linux Audit record (meaning that one Linux record will map to one SMF record), and fill this type's records with the following: .SS Link Value The Linux event serial number, encoded in network-byte order hexadecimal representation. Records within the same Event share the same Link Value. .SS Violation Always zero (0) - .I False .SS Event Code Always two (2) - .I Authorization event .SS Event Qualifier Zero (0) - .IR Success , if the event reported .B success=yes or .BR res=success , Three (3) - .IR Fail , if the event reported .B success=no or .BR res=failed , or One (1) - .I Info otherwise. .SS Class Always .I @LINUX .SS Resource The Linux record type for the processed record. e.g.: .IR SYSCALL , AVC , PATH , CWD etc. .SS Log String Textual message bringing the RACF user ID used to perform the request, plus the Linux hostname and the record type for the first record in the processed event. e.g.: .I Remote audit request from RACFUSER. Linux (hostname.localdomain):USER_AUTH .SS Data Field List Also known as .IR relocates , this list will bring all the field names and values in a .B fieldname=value format, as a type 114 .RB ( "Application specific Data" ) relocate. The plug-in will try to interpret those fields (i.e.: use human-readable username .B root instead of numeric userid .BR 0 ) whenever possible. Currently, this plugin will also add a relocate type 113 .RB ( "Date And Time Security Event Occurred" ) with the Event Timestamp in the format as returned by .BR ctime (3). .SH ERRORS Errors and warnings are reported to syslog (under DAEMON facility). In situations where the event was submitted but the z/OS server returned an error condition, the logged message brings a name followed by a human-readable description. Below are some common errors conditions: .TP .B NOTREQ - No logging required Resource (audit record type) is not set to be logged in the RACF server - The @LINUX Class profile governing this audit record type is set to ignore. See .B IBM z/OS RACF Server configuration .TP .B UNDETERMINED - Undetermined result No profile found for specified resource. There is no @LINUX Class configured or no @LINUX Class profile associated with this audit record type. See .B IBM z/OS RACF Server configuration .TP .B UNAUTHORIZED - The user does not have authority the R_auditx service The user ID associated with the ITDS doesn't have READ access to the IRR.AUDITX FACILITY Class profile. See .B IBM z/OS RACF Server configuration .TP .B UNSUF_AUTH - The user has insufficient authority for the requested function The RACF user ID used to perform Remote Audit requests (as configured in .BR zos-remote.conf (5)) don't have access to the IRR.LDAP.REMOTE.AUDIT FACILITY Class profile. See .B IBM z/OS RACF Server configuration .SH BUGS The plugin currently does remote auditing in a best-effort basis, and will discard events in case the z/OS server cannot be contacted (network failures) or in any other case that event submission fails. .SH FILES /etc/audit/plugins.d/audispd\-zos\-remote.conf /etc/audit/zos\-remote.conf .SH "SEE ALSO" .BR auditd (8), .BR zos\-remote.conf (5). .SH AUTHOR Klaus Heinrich Kiwi audit-4.0.2/docs/ausearch_add_expression.30000644001034500103450000000341014655201403014200 .TH "AUSEARCH_ADD_EXPRESSION" "3" "Feb 2008" "Red Hat" "Linux Audit API" .SH NAME ausearch_add_expression \- build up search expression .SH "SYNOPSIS" .B #include \fBint ausearch_add_expression(auparse_state_t *\fIau\fB, const char *\fIexpression\fB, char **\fIerror\fB, ausearch_rule_t \fIhow\fB);\fR .SH "DESCRIPTION" .B ausearch_add_item adds an expression to the current audit search expression. The search conditions can then be used to scan logs, files, or buffers for something of interest. The .I expression parameter contains an expression, as specified in .BR ausearch\-expression (5). The .I how parameter determines how this search expression will affect the existing search expression, if one is already defined. The possible values are: .RS .TP .I AUSEARCH_RULE_CLEAR Clear the current search expression, if any, and use only this search expression. .TP .I AUSEARCH_RULE_OR If a search expression .I E is already configured, replace it by \fB(\fIE\fB || \fIthis_search_expression\fB)\fR. .TP .I AUSEARCH_RULE_AND If a search expression .I E is already configured, replace it by \fB(\fIE\fB && \fIthis_search_expression\fB)\fR. .RE .SH "RETURN VALUE" If successful, .B ausearch_add_expression returns 0. Otherwise, it returns \-1, sets .B errno and it may set \fB*\fIerror\fR to an error message; the caller must free the error message using .BR free (3). If an error message is not available or can not be allocated, \fB*\fIerror\fR is set to \fBNULL\fR. .SH "SEE ALSO" .BR ausearch_add_item (3), .BR ausearch_add_interpreted_item (3), .BR ausearch_add_timestamp_item (3), .BR ausearch_add_regex (3), .BR ausearch_set_stop (3), .BR ausearch_clear (3), .BR ausearch_next_event (3), .BR ausearch_cur_event (3), .BR ausearch\-expression (5). .SH AUTHOR Miloslav Trmac audit-4.0.2/ltmain.sh0000644001034500103450000121201014655201412010121 #! /usr/bin/env sh ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in ## by inline-source v2019-02-19.15 # libtool (GNU libtool) 2.4.7 # Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996-2019, 2021-2022 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. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . PROGRAM=libtool PACKAGE=libtool VERSION=2.4.7 package_revision=2.4.7 ## ------ ## ## Usage. ## ## ------ ## # Run './libtool --help' for help with using this script from the # command line. ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # After configure completes, it has a better idea of some of the # shell tools we need than the defaults used by the functions shared # with bootstrap, so set those here where they can still be over- # ridden by the user, but otherwise take precedence. : ${AUTOCONF="autoconf"} : ${AUTOMAKE="automake"} ## -------------------------- ## ## Source external libraries. ## ## -------------------------- ## # Much of our low-level functionality needs to be sourced from external # libraries, which are installed to $pkgauxdir. # Set a version string for this script. scriptversion=2019-02-19.15; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 # This is free software. There is NO warranty; not even for # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # Copyright (C) 2004-2019, 2021 Bootstrap Authors # # This file is dual licensed under the terms of the MIT license # , and GPL version 2 or later # . You must apply one of # these licenses when using or redistributing this software or any of # the files within it. See the URLs above, or the file `LICENSE` # included in the Bootstrap distribution for the full license texts. # Please report bugs or propose patches to: # ## ------ ## ## Usage. ## ## ------ ## # Evaluate this file near the top of your script to gain access to # the functions and variables defined here: # # . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh # # If you need to override any of the default environment variable # settings, do that before evaluating this file. ## -------------------- ## ## Shell normalisation. ## ## -------------------- ## # Some shells need a little help to be as Bourne compatible as possible. # Before doing anything else, make sure all that help has been provided! 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 # NLS nuisances: We save the old values in case they are required later. _G_user_locale= _G_safe_locale= for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test set = \"\${$_G_var+set}\"; then save_$_G_var=\$$_G_var $_G_var=C export $_G_var _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" fi" done # These NLS vars are set unconditionally (bootstrap issue #24). Unset those # in case the environment reset is needed later and the $save_* variant is not # defined (see the code above). LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL # Make sure IFS has a sensible default sp=' ' nl=' ' IFS="$sp $nl" # There are apparently some retarded systems that use ';' as a PATH separator! 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 # func_unset VAR # -------------- # Portably unset VAR. # In some shells, an 'unset VAR' statement leaves a non-zero return # status if VAR is already unset, which might be problematic if the # statement is used at the end of a function (thus poisoning its return # value) or when 'set -e' is active (causing even a spurious abort of # the script in this case). func_unset () { { eval $1=; (eval unset $1) >/dev/null 2>&1 && eval unset $1 || : ; } } # Make sure CDPATH doesn't cause `cd` commands to output the target dir. func_unset CDPATH # Make sure ${,E,F}GREP behave sanely. func_unset GREP_OPTIONS ## ------------------------- ## ## Locate command utilities. ## ## ------------------------- ## # func_executable_p FILE # ---------------------- # Check that FILE is an executable regular file. func_executable_p () { test -f "$1" && test -x "$1" } # func_path_progs PROGS_LIST CHECK_FUNC [PATH] # -------------------------------------------- # Search for either a program that responds to --version with output # containing "GNU", or else returned by CHECK_FUNC otherwise, by # trying all the directories in PATH with each of the elements of # PROGS_LIST. # # CHECK_FUNC should accept the path to a candidate program, and # set $func_check_prog_result if it truncates its output less than # $_G_path_prog_max characters. func_path_progs () { _G_progs_list=$1 _G_check_func=$2 _G_PATH=${3-"$PATH"} _G_path_prog_max=0 _G_path_prog_found=false _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} for _G_dir in $_G_PATH; do IFS=$_G_save_IFS test -z "$_G_dir" && _G_dir=. for _G_prog_name in $_G_progs_list; do for _exeext in '' .EXE; do _G_path_prog=$_G_dir/$_G_prog_name$_exeext func_executable_p "$_G_path_prog" || continue case `"$_G_path_prog" --version 2>&1` in *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;; *) $_G_check_func $_G_path_prog func_path_progs_result=$func_check_prog_result ;; esac $_G_path_prog_found && break 3 done done done IFS=$_G_save_IFS test -z "$func_path_progs_result" && { echo "no acceptable sed could be found in \$PATH" >&2 exit 1 } } # We want to be able to use the functions in this file before configure # has figured out where the best binaries are kept, which means we have # to search for them ourselves - except when the results are already set # where we skip the searches. # Unless the user overrides by setting SED, search the path for either GNU # sed, or the sed that truncates its output the least. test -z "$SED" && { _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for _G_i in 1 2 3 4 5 6 7; do _G_sed_script=$_G_sed_script$nl$_G_sed_script done echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed _G_sed_script= func_check_prog_sed () { _G_path_prog=$1 _G_count=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo '' >> conftest.nl "$_G_path_prog" -f conftest.sed conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "sed gsed" func_check_prog_sed "$PATH:/usr/xpg4/bin" rm -f conftest.sed SED=$func_path_progs_result } # Unless the user overrides by setting GREP, search the path for either GNU # grep, or the grep that truncates its output the least. test -z "$GREP" && { func_check_prog_grep () { _G_path_prog=$1 _G_count=0 _G_path_prog_max=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo 'GREP' >> conftest.nl "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "grep ggrep" func_check_prog_grep "$PATH:/usr/xpg4/bin" GREP=$func_path_progs_result } ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # All uppercase variable names are used for environment variables. These # variables can be overridden by the user before calling a script that # uses them if a suitable command of that name is not already available # in the command search PATH. : ${CP="cp -f"} : ${ECHO="printf %s\n"} : ${EGREP="$GREP -E"} : ${FGREP="$GREP -F"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} ## -------------------- ## ## Useful sed snippets. ## ## -------------------- ## sed_dirname='s|/[^/]*$||' sed_basename='s|^.*/||' # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='s|\([`"$\\]\)|\\\1|g' # Same as above, but do not quote variable references. sed_double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g' # Sed substitution that converts a w32 file name or path # that contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-'\' parameter expansions in output of sed_double_quote_subst that # were '\'-ed in input to the same. If an odd number of '\' preceded a # '$' in input to sed_double_quote_subst, that '$' was protected from # expansion. Since each input '\' is now two '\'s, look for any number # of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'. _G_bs='\\' _G_bs2='\\\\' _G_bs4='\\\\\\\\' _G_dollar='\$' sed_double_backslash="\ s/$_G_bs4/&\\ /g s/^$_G_bs2$_G_dollar/$_G_bs&/ s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g s/\n//g" # require_check_ifs_backslash # --------------------------- # Check if we can use backslash as IFS='\' separator, and set # $check_ifs_backshlash_broken to ':' or 'false'. require_check_ifs_backslash=func_require_check_ifs_backslash func_require_check_ifs_backslash () { _G_save_IFS=$IFS IFS='\' _G_check_ifs_backshlash='a\\b' for _G_i in $_G_check_ifs_backshlash do case $_G_i in a) check_ifs_backshlash_broken=false ;; '') break ;; *) check_ifs_backshlash_broken=: break ;; esac done IFS=$_G_save_IFS require_check_ifs_backslash=: } ## ----------------- ## ## Global variables. ## ## ----------------- ## # Except for the global variables explicitly listed below, the following # functions in the '^func_' namespace, and the '^require_' namespace # variables initialised in the 'Resource management' section, sourcing # this file will not pollute your global namespace with anything # else. There's no portable way to scope variables in Bourne shell # though, so actually running these functions will sometimes place # results into a variable named after the function, and often use # temporary variables in the '^_G_' namespace. If you are careful to # avoid using those namespaces casually in your sourcing script, things # should continue to work as you expect. And, of course, you can freely # overwrite any of the functions or variables defined here before # calling anything to customize them. EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. # Allow overriding, eg assuming that you follow the convention of # putting '$debug_cmd' at the start of all your functions, you can get # bash to show function call trace with: # # debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name debug_cmd=${debug_cmd-":"} exit_cmd=: # By convention, finish your script with: # # exit $exit_status # # so that you can set exit_status to non-zero if you want to indicate # something went wrong during execution without actually bailing out at # the point of failure. exit_status=$EXIT_SUCCESS # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath=$0 # The name of this program. progname=`$ECHO "$progpath" |$SED "$sed_basename"` # Make sure we have an absolute progpath for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=`$ECHO "$progpath" |$SED "$sed_dirname"` progdir=`cd "$progdir" && pwd` progpath=$progdir/$progname ;; *) _G_IFS=$IFS IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS=$_G_IFS test -x "$progdir/$progname" && break done IFS=$_G_IFS test -n "$progdir" || progdir=`pwd` progpath=$progdir/$progname ;; esac ## ----------------- ## ## Standard options. ## ## ----------------- ## # The following options affect the operation of the functions defined # below, and should be set appropriately depending on run-time para- # meters passed on the command line. opt_dry_run=false opt_quiet=false opt_verbose=false # Categories 'all' and 'none' are always available. Append any others # you will pass as the first argument to func_warning from your own # code. warning_categories= # By default, display warnings according to 'opt_warning_types'. Set # 'warning_func' to ':' to elide all warnings, or func_fatal_error to # treat the next displayed warning as a fatal error. warning_func=func_warn_and_continue # Set to 'all' to display all warnings, 'none' to suppress all # warnings, or a space delimited list of some subset of # 'warning_categories' to display only the listed warnings. opt_warning_types=all ## -------------------- ## ## Resource management. ## ## -------------------- ## # This section contains definitions for functions that each ensure a # particular resource (a file, or a non-empty configuration variable for # example) is available, and if appropriate to extract default values # from pertinent package files. Call them using their associated # 'require_*' variable to ensure that they are executed, at most, once. # # It's entirely deliberate that calling these functions can set # variables that don't obey the namespace limitations obeyed by the rest # of this file, in order that that they be as useful as possible to # callers. # require_term_colors # ------------------- # Allow display of bold text on terminals that support it. require_term_colors=func_require_term_colors func_require_term_colors () { $debug_cmd test -t 1 && { # COLORTERM and USE_ANSI_COLORS environment variables take # precedence, because most terminfo databases neglect to describe # whether color sequences are supported. test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} if test 1 = "$USE_ANSI_COLORS"; then # Standard ANSI escape sequences tc_reset='' tc_bold=''; tc_standout='' tc_red=''; tc_green='' tc_blue=''; tc_cyan='' else # Otherwise trust the terminfo database after all. test -n "`tput sgr0 2>/dev/null`" && { tc_reset=`tput sgr0` test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` tc_standout=$tc_bold test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` } fi } require_term_colors=: } ## ----------------- ## ## Function library. ## ## ----------------- ## # This section contains a variety of useful functions to call in your # scripts. Take note of the portable wrappers for features provided by # some modern shells, which will fall back to slower equivalents on # less featureful shells. # func_append VAR VALUE # --------------------- # Append VALUE onto the existing contents of VAR. # We should try to minimise forks, especially on Windows where they are # unreasonably slow, so skip the feature probes when bash or zsh are # being used: if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then : ${_G_HAVE_ARITH_OP="yes"} : ${_G_HAVE_XSI_OPS="yes"} # The += operator was introduced in bash 3.1 case $BASH_VERSION in [12].* | 3.0 | 3.0*) ;; *) : ${_G_HAVE_PLUSEQ_OP="yes"} ;; esac fi # _G_HAVE_PLUSEQ_OP # Can be empty, in which case the shell is probed, "yes" if += is # useable or anything else if it does not work. test -z "$_G_HAVE_PLUSEQ_OP" \ && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ && _G_HAVE_PLUSEQ_OP=yes if test yes = "$_G_HAVE_PLUSEQ_OP" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_append () { $debug_cmd eval "$1+=\$2" }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_append () { $debug_cmd eval "$1=\$$1\$2" } fi # func_append_quoted VAR VALUE # ---------------------------- # Quote VALUE and append to the end of shell variable VAR, separated # by a space. if test yes = "$_G_HAVE_PLUSEQ_OP"; then eval 'func_append_quoted () { $debug_cmd func_quote_arg pretty "$2" eval "$1+=\\ \$func_quote_arg_result" }' else func_append_quoted () { $debug_cmd func_quote_arg pretty "$2" eval "$1=\$$1\\ \$func_quote_arg_result" } fi # func_append_uniq VAR VALUE # -------------------------- # Append unique VALUE onto the existing contents of VAR, assuming # entries are delimited by the first character of VALUE. For example: # # func_append_uniq options " --another-option option-argument" # # will only append to $options if " --another-option option-argument " # is not already present somewhere in $options already (note spaces at # each end implied by leading space in second argument). func_append_uniq () { $debug_cmd eval _G_current_value='`$ECHO $'$1'`' _G_delim=`expr "$2" : '\(.\)'` case $_G_delim$_G_current_value$_G_delim in *"$2$_G_delim"*) ;; *) func_append "$@" ;; esac } # func_arith TERM... # ------------------ # Set func_arith_result to the result of evaluating TERMs. test -z "$_G_HAVE_ARITH_OP" \ && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ && _G_HAVE_ARITH_OP=yes if test yes = "$_G_HAVE_ARITH_OP"; then eval 'func_arith () { $debug_cmd func_arith_result=$(( $* )) }' else func_arith () { $debug_cmd func_arith_result=`expr "$@"` } fi # func_basename FILE # ------------------ # Set func_basename_result to FILE with everything up to and including # the last / stripped. if test yes = "$_G_HAVE_XSI_OPS"; then # If this shell supports suffix pattern removal, then use it to avoid # forking. Hide the definitions single quotes in case the shell chokes # on unsupported syntax... _b='func_basename_result=${1##*/}' _d='case $1 in */*) func_dirname_result=${1%/*}$2 ;; * ) func_dirname_result=$3 ;; esac' else # ...otherwise fall back to using sed. _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` if test "X$func_dirname_result" = "X$1"; then func_dirname_result=$3 else func_append func_dirname_result "$2" fi' fi eval 'func_basename () { $debug_cmd '"$_b"' }' # func_dirname FILE APPEND NONDIR_REPLACEMENT # ------------------------------------------- # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. eval 'func_dirname () { $debug_cmd '"$_d"' }' # func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT # -------------------------------------------------------- # Perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # For efficiency, we do not delegate to the functions above but instead # duplicate the functionality here. eval 'func_dirname_and_basename () { $debug_cmd '"$_b"' '"$_d"' }' # func_echo ARG... # ---------------- # Echo program name prefixed message. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname: $_G_line" done IFS=$func_echo_IFS } # func_echo_all ARG... # -------------------- # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_echo_infix_1 INFIX ARG... # ------------------------------ # Echo program name, followed by INFIX on the first line, with any # additional lines not showing INFIX. func_echo_infix_1 () { $debug_cmd $require_term_colors _G_infix=$1; shift _G_indent=$_G_infix _G_prefix="$progname: $_G_infix: " _G_message=$* # Strip color escape sequences before counting printable length for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" do test -n "$_G_tc" && { _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"` _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"` } done _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes func_echo_infix_1_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_infix_1_IFS $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 _G_prefix=$_G_indent done IFS=$func_echo_infix_1_IFS } # func_error ARG... # ----------------- # Echo program name prefixed message to standard error. func_error () { $debug_cmd $require_term_colors func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 } # func_fatal_error ARG... # ----------------------- # Echo program name prefixed message to standard error, and exit. func_fatal_error () { $debug_cmd func_error "$*" exit $EXIT_FAILURE } # func_grep EXPRESSION FILENAME # ----------------------------- # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $debug_cmd $GREP "$1" "$2" >/dev/null 2>&1 } # func_len STRING # --------------- # Set func_len_result to the length of STRING. STRING may not # start with a hyphen. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_len () { $debug_cmd func_len_result=${#1} }' else func_len () { $debug_cmd func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` } fi # func_mkdir_p DIRECTORY-PATH # --------------------------- # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { $debug_cmd _G_directory_path=$1 _G_dir_list= if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then # Protect directory names starting with '-' case $_G_directory_path in -*) _G_directory_path=./$_G_directory_path ;; esac # While some portion of DIR does not yet exist... while test ! -d "$_G_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. _G_dir_list=$_G_directory_path:$_G_dir_list # If the last portion added has no slash in it, the list is done case $_G_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` done _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'` func_mkdir_p_IFS=$IFS; IFS=: for _G_dir in $_G_dir_list; do IFS=$func_mkdir_p_IFS # mkdir can fail with a 'File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$_G_dir" 2>/dev/null || : done IFS=$func_mkdir_p_IFS # Bail out if we (or some other process) failed to create a directory. test -d "$_G_directory_path" || \ func_fatal_error "Failed to create '$1'" fi } # func_mktempdir [BASENAME] # ------------------------- # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, BASENAME is the basename for that directory. func_mktempdir () { $debug_cmd _G_template=${TMPDIR-/tmp}/${1-$progname} if test : = "$opt_dry_run"; then # Return a directory name, but don't create it in dry-run mode _G_tmpdir=$_G_template-$$ else # If mktemp works, use that first and foremost _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` if test ! -d "$_G_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race _G_tmpdir=$_G_template-${RANDOM-0}$$ func_mktempdir_umask=`umask` umask 0077 $MKDIR "$_G_tmpdir" umask $func_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$_G_tmpdir" || \ func_fatal_error "cannot create temporary directory '$_G_tmpdir'" fi $ECHO "$_G_tmpdir" } # func_normal_abspath PATH # ------------------------ # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. func_normal_abspath () { $debug_cmd # These SED scripts presuppose an absolute path with a trailing slash. _G_pathcar='s|^/\([^/]*\).*$|\1|' _G_pathcdr='s|^/[^/]*||' _G_removedotparts=':dotsl s|/\./|/|g t dotsl s|/\.$|/|' _G_collapseslashes='s|/\{1,\}|/|g' _G_finalslash='s|/*$|/|' # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"` while :; do # Processed it all yet? if test / = "$func_normal_abspath_tpath"; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result"; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent" ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_notquiet ARG... # -------------------- # Echo program name prefixed message only when not in quiet mode. func_notquiet () { $debug_cmd $opt_quiet || func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_relative_path SRCDIR DSTDIR # -------------------------------- # Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. func_relative_path () { $debug_cmd func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=$func_dirname_result if test -z "$func_relative_path_tlibdir"; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test -n "$func_stripname_result"; then func_append func_relative_path_result "/$func_stripname_result" fi # Normalisation. If bindir is libdir, return '.' else relative path. if test -n "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result" func_relative_path_result=$func_stripname_result fi test -n "$func_relative_path_result" || func_relative_path_result=. : } # func_quote_portable EVAL ARG # ---------------------------- # Internal function to portably implement func_quote_arg. Note that we still # keep attention to performance here so we as much as possible try to avoid # calling sed binary (so far O(N) complexity as long as func_append is O(1)). func_quote_portable () { $debug_cmd $require_check_ifs_backslash func_quote_portable_result=$2 # one-time-loop (easy break) while true do if $1; then func_quote_portable_result=`$ECHO "$2" | $SED \ -e "$sed_double_quote_subst" -e "$sed_double_backslash"` break fi # Quote for eval. case $func_quote_portable_result in *[\\\`\"\$]*) # Fallback to sed for $func_check_bs_ifs_broken=:, or when the string # contains the shell wildcard characters. case $check_ifs_backshlash_broken$func_quote_portable_result in :*|*[\[\*\?]*) func_quote_portable_result=`$ECHO "$func_quote_portable_result" \ | $SED "$sed_quote_subst"` break ;; esac func_quote_portable_old_IFS=$IFS for _G_char in '\' '`' '"' '$' do # STATE($1) PREV($2) SEPARATOR($3) set start "" "" func_quote_portable_result=dummy"$_G_char$func_quote_portable_result$_G_char"dummy IFS=$_G_char for _G_part in $func_quote_portable_result do case $1 in quote) func_append func_quote_portable_result "$3$2" set quote "$_G_part" "\\$_G_char" ;; start) set first "" "" func_quote_portable_result= ;; first) set quote "$_G_part" "" ;; esac done done IFS=$func_quote_portable_old_IFS ;; *) ;; esac break done func_quote_portable_unquoted_result=$func_quote_portable_result case $func_quote_portable_result in # double-quote args containing shell metacharacters to delay # word splitting, command substitution and variable expansion # for a subsequent eval. # many bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_portable_result=\"$func_quote_portable_result\" ;; esac } # func_quotefast_eval ARG # ----------------------- # Quote one ARG (internal). This is equivalent to 'func_quote_arg eval ARG', # but optimized for speed. Result is stored in $func_quotefast_eval. if test xyes = `(x=; printf -v x %q yes; echo x"$x") 2>/dev/null`; then printf -v _GL_test_printf_tilde %q '~' if test '\~' = "$_GL_test_printf_tilde"; then func_quotefast_eval () { printf -v func_quotefast_eval_result %q "$1" } else # Broken older Bash implementations. Make those faster too if possible. func_quotefast_eval () { case $1 in '~'*) func_quote_portable false "$1" func_quotefast_eval_result=$func_quote_portable_result ;; *) printf -v func_quotefast_eval_result %q "$1" ;; esac } fi else func_quotefast_eval () { func_quote_portable false "$1" func_quotefast_eval_result=$func_quote_portable_result } fi # func_quote_arg MODEs ARG # ------------------------ # Quote one ARG to be evaled later. MODEs argument may contain zero or more # specifiers listed below separated by ',' character. This function returns two # values: # i) func_quote_arg_result # double-quoted (when needed), suitable for a subsequent eval # ii) func_quote_arg_unquoted_result # has all characters that are still active within double # quotes backslashified. Available only if 'unquoted' is specified. # # Available modes: # ---------------- # 'eval' (default) # - escape shell special characters # 'expand' # - the same as 'eval'; but do not quote variable references # 'pretty' # - request aesthetic output, i.e. '"a b"' instead of 'a\ b'. This might # be used later in func_quote to get output like: 'echo "a b"' instead # of 'echo a\ b'. This is slower than default on some shells. # 'unquoted' # - produce also $func_quote_arg_unquoted_result which does not contain # wrapping double-quotes. # # Examples for 'func_quote_arg pretty,unquoted string': # # string | *_result | *_unquoted_result # ------------+-----------------------+------------------- # " | \" | \" # a b | "a b" | a b # "a b" | "\"a b\"" | \"a b\" # * | "*" | * # z="${x-$y}" | "z=\"\${x-\$y}\"" | z=\"\${x-\$y}\" # # Examples for 'func_quote_arg pretty,unquoted,expand string': # # string | *_result | *_unquoted_result # --------------+---------------------+-------------------- # z="${x-$y}" | "z=\"${x-$y}\"" | z=\"${x-$y}\" func_quote_arg () { _G_quote_expand=false case ,$1, in *,expand,*) _G_quote_expand=: ;; esac case ,$1, in *,pretty,*|*,expand,*|*,unquoted,*) func_quote_portable $_G_quote_expand "$2" func_quote_arg_result=$func_quote_portable_result func_quote_arg_unquoted_result=$func_quote_portable_unquoted_result ;; *) # Faster quote-for-eval for some shells. func_quotefast_eval "$2" func_quote_arg_result=$func_quotefast_eval_result ;; esac } # func_quote MODEs ARGs... # ------------------------ # Quote all ARGs to be evaled later and join them into single command. See # func_quote_arg's description for more info. func_quote () { $debug_cmd _G_func_quote_mode=$1 ; shift func_quote_result= while test 0 -lt $#; do func_quote_arg "$_G_func_quote_mode" "$1" if test -n "$func_quote_result"; then func_append func_quote_result " $func_quote_arg_result" else func_append func_quote_result "$func_quote_arg_result" fi shift done } # func_stripname PREFIX SUFFIX NAME # --------------------------------- # strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_stripname () { $debug_cmd # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary variable first. func_stripname_result=$3 func_stripname_result=${func_stripname_result#"$1"} func_stripname_result=${func_stripname_result%"$2"} }' else func_stripname () { $debug_cmd case $2 in .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; esac } fi # func_show_eval CMD [FAIL_EXP] # ----------------------------- # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} func_quote_arg pretty,expand "$_G_cmd" eval "func_notquiet $func_quote_arg_result" $opt_dry_run || { eval "$_G_cmd" _G_status=$? if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_show_eval_locale CMD [FAIL_EXP] # ------------------------------------ # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} $opt_quiet || { func_quote_arg expand,pretty "$_G_cmd" eval "func_echo $func_quote_arg_result" } $opt_dry_run || { eval "$_G_user_locale $_G_cmd" _G_status=$? eval "$_G_safe_locale" if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_tr_sh # ---------- # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { $debug_cmd case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_verbose ARG... # ------------------- # Echo program name prefixed message in verbose mode only. func_verbose () { $debug_cmd $opt_verbose && func_echo "$*" : } # func_warn_and_continue ARG... # ----------------------------- # Echo program name prefixed warning message to standard error. func_warn_and_continue () { $debug_cmd $require_term_colors func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 } # func_warning CATEGORY ARG... # ---------------------------- # Echo program name prefixed warning message to standard error. Warning # messages can be filtered according to CATEGORY, where this function # elides messages where CATEGORY is not listed in the global variable # 'opt_warning_types'. func_warning () { $debug_cmd # CATEGORY must be in the warning_categories list! case " $warning_categories " in *" $1 "*) ;; *) func_internal_error "invalid warning category '$1'" ;; esac _G_category=$1 shift case " $opt_warning_types " in *" $_G_category "*) $warning_func ${1+"$@"} ;; esac } # func_sort_ver VER1 VER2 # ----------------------- # 'sort -V' is not generally available. # Note this deviates from the version comparison in automake # in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a # but this should suffice as we won't be specifying old # version formats or redundant trailing .0 in bootstrap.conf. # If we did want full compatibility then we should probably # use m4_version_compare from autoconf. func_sort_ver () { $debug_cmd printf '%s\n%s\n' "$1" "$2" \ | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n } # func_lt_ver PREV CURR # --------------------- # Return true if PREV and CURR are in the correct order according to # func_sort_ver, otherwise false. Use it like this: # # func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..." func_lt_ver () { $debug_cmd test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q` } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: #! /bin/sh # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 # This is free software. There is NO warranty; not even for # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # Copyright (C) 2010-2019, 2021 Bootstrap Authors # # This file is dual licensed under the terms of the MIT license # , and GPL version 2 or later # . You must apply one of # these licenses when using or redistributing this software or any of # the files within it. See the URLs above, or the file `LICENSE` # included in the Bootstrap distribution for the full license texts. # Please report bugs or propose patches to: # # Set a version string for this script. scriptversion=2019-02-19.15; # UTC ## ------ ## ## Usage. ## ## ------ ## # This file is a library for parsing options in your shell scripts along # with assorted other useful supporting features that you can make use # of too. # # For the simplest scripts you might need only: # # #!/bin/sh # . relative/path/to/funclib.sh # . relative/path/to/options-parser # scriptversion=1.0 # func_options ${1+"$@"} # eval set dummy "$func_options_result"; shift # ...rest of your script... # # In order for the '--version' option to work, you will need to have a # suitably formatted comment like the one at the top of this file # starting with '# Written by ' and ending with '# Copyright'. # # For '-h' and '--help' to work, you will also need a one line # description of your script's purpose in a comment directly above the # '# Written by ' line, like the one at the top of this file. # # The default options also support '--debug', which will turn on shell # execution tracing (see the comment above debug_cmd below for another # use), and '--verbose' and the func_verbose function to allow your script # to display verbose messages only when your user has specified # '--verbose'. # # After sourcing this file, you can plug in processing for additional # options by amending the variables from the 'Configuration' section # below, and following the instructions in the 'Option parsing' # section further down. ## -------------- ## ## Configuration. ## ## -------------- ## # You should override these variables in your script after sourcing this # file so that they reflect the customisations you have added to the # option parser. # The usage line for option parsing errors and the start of '-h' and # '--help' output messages. You can embed shell variables for delayed # expansion at the time the message is displayed, but you will need to # quote other shell meta-characters carefully to prevent them being # expanded when the contents are evaled. usage='$progpath [OPTION]...' # Short help message in response to '-h' and '--help'. Add to this or # override it after sourcing this library to reflect the full set of # options your script accepts. usage_message="\ --debug enable verbose shell tracing -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -v, --verbose verbosely report processing --version print version information and exit -h, --help print short or long help message and exit " # Additional text appended to 'usage_message' in response to '--help'. long_help_message=" Warning categories include: 'all' show all warnings 'none' turn off all the warnings 'error' warnings are treated as fatal errors" # Help message printed before fatal option parsing errors. fatal_help="Try '\$progname --help' for more information." ## ------------------------- ## ## Hook function management. ## ## ------------------------- ## # This section contains functions for adding, removing, and running hooks # in the main code. A hook is just a list of function names that can be # run in order later on. # func_hookable FUNC_NAME # ----------------------- # Declare that FUNC_NAME will run hooks added with # 'func_add_hook FUNC_NAME ...'. func_hookable () { $debug_cmd func_append hookable_fns " $1" } # func_add_hook FUNC_NAME HOOK_FUNC # --------------------------------- # Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must # first have been declared "hookable" by a call to 'func_hookable'. func_add_hook () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not accept hook functions." ;; esac eval func_append ${1}_hooks '" $2"' } # func_remove_hook FUNC_NAME HOOK_FUNC # ------------------------------------ # Remove HOOK_FUNC from the list of hook functions to be called by # FUNC_NAME. func_remove_hook () { $debug_cmd eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' } # func_propagate_result FUNC_NAME_A FUNC_NAME_B # --------------------------------------------- # If the *_result variable of FUNC_NAME_A _is set_, assign its value to # *_result variable of FUNC_NAME_B. func_propagate_result () { $debug_cmd func_propagate_result_result=: if eval "test \"\${${1}_result+set}\" = set" then eval "${2}_result=\$${1}_result" else func_propagate_result_result=false fi } # func_run_hooks FUNC_NAME [ARG]... # --------------------------------- # Run all hook functions registered to FUNC_NAME. # It's assumed that the list of hook functions contains nothing more # than a whitespace-delimited list of legal shell function names, and # no effort is wasted trying to catch shell meta-characters or preserve # whitespace. func_run_hooks () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not support hook functions." ;; esac eval _G_hook_fns=\$$1_hooks; shift for _G_hook in $_G_hook_fns; do func_unset "${_G_hook}_result" eval $_G_hook '${1+"$@"}' func_propagate_result $_G_hook func_run_hooks if $func_propagate_result_result; then eval set dummy "$func_run_hooks_result"; shift fi done } ## --------------- ## ## Option parsing. ## ## --------------- ## # In order to add your own option parsing hooks, you must accept the # full positional parameter list from your hook function. You may remove # or edit any options that you action, and then pass back the remaining # unprocessed options in '_result', escaped # suitably for 'eval'. # # The '_result' variable is automatically unset # before your hook gets called; for best performance, only set the # *_result variable when necessary (i.e. don't call the 'func_quote' # function unnecessarily because it can be an expensive operation on some # machines). # # Like this: # # my_options_prep () # { # $debug_cmd # # # Extend the existing usage message. # usage_message=$usage_message' # -s, --silent don'\''t print informational messages # ' # # No change in '$@' (ignored completely by this hook). Leave # # my_options_prep_result variable intact. # } # func_add_hook func_options_prep my_options_prep # # # my_silent_option () # { # $debug_cmd # # args_changed=false # # # Note that, for efficiency, we parse as many options as we can # # recognise in a loop before passing the remainder back to the # # caller on the first unrecognised argument we encounter. # while test $# -gt 0; do # opt=$1; shift # case $opt in # --silent|-s) opt_silent=: # args_changed=: # ;; # # Separate non-argument short options: # -s*) func_split_short_opt "$_G_opt" # set dummy "$func_split_short_opt_name" \ # "-$func_split_short_opt_arg" ${1+"$@"} # shift # args_changed=: # ;; # *) # Make sure the first unrecognised option "$_G_opt" # # is added back to "$@" in case we need it later, # # if $args_changed was set to 'true'. # set dummy "$_G_opt" ${1+"$@"}; shift; break ;; # esac # done # # # Only call 'func_quote' here if we processed at least one argument. # if $args_changed; then # func_quote eval ${1+"$@"} # my_silent_option_result=$func_quote_result # fi # } # func_add_hook func_parse_options my_silent_option # # # my_option_validation () # { # $debug_cmd # # $opt_silent && $opt_verbose && func_fatal_help "\ # '--silent' and '--verbose' options are mutually exclusive." # } # func_add_hook func_validate_options my_option_validation # # You'll also need to manually amend $usage_message to reflect the extra # options you parse. It's preferable to append if you can, so that # multiple option parsing hooks can be added safely. # func_options_finish [ARG]... # ---------------------------- # Finishing the option parse loop (call 'func_options' hooks ATM). func_options_finish () { $debug_cmd func_run_hooks func_options ${1+"$@"} func_propagate_result func_run_hooks func_options_finish } # func_options [ARG]... # --------------------- # All the functions called inside func_options are hookable. See the # individual implementations for details. func_hookable func_options func_options () { $debug_cmd _G_options_quoted=false for my_func in options_prep parse_options validate_options options_finish do func_unset func_${my_func}_result func_unset func_run_hooks_result eval func_$my_func '${1+"$@"}' func_propagate_result func_$my_func func_options if $func_propagate_result_result; then eval set dummy "$func_options_result"; shift _G_options_quoted=: fi done $_G_options_quoted || { # As we (func_options) are top-level options-parser function and # nobody quoted "$@" for us yet, we need to do it explicitly for # caller. func_quote eval ${1+"$@"} func_options_result=$func_quote_result } } # func_options_prep [ARG]... # -------------------------- # All initialisations required before starting the option parse loop. # Note that when calling hook functions, we pass through the list of # positional parameters. If a hook function modifies that list, and # needs to propagate that back to rest of this script, then the complete # modified list must be put in 'func_run_hooks_result' before returning. func_hookable func_options_prep func_options_prep () { $debug_cmd # Option defaults: opt_verbose=false opt_warning_types= func_run_hooks func_options_prep ${1+"$@"} func_propagate_result func_run_hooks func_options_prep } # func_parse_options [ARG]... # --------------------------- # The main option parsing loop. func_hookable func_parse_options func_parse_options () { $debug_cmd _G_parse_options_requote=false # this just eases exit handling while test $# -gt 0; do # Defer to hook functions for initial option parsing, so they # get priority in the event of reusing an option name. func_run_hooks func_parse_options ${1+"$@"} func_propagate_result func_run_hooks func_parse_options if $func_propagate_result_result; then eval set dummy "$func_parse_options_result"; shift # Even though we may have changed "$@", we passed the "$@" array # down into the hook and it quoted it for us (because we are in # this if-branch). No need to quote it again. _G_parse_options_requote=false fi # Break out of the loop if we already parsed every option. test $# -gt 0 || break # We expect that one of the options parsed in this function matches # and thus we remove _G_opt from "$@" and need to re-quote. _G_match_parse_options=: _G_opt=$1 shift case $_G_opt in --debug|-x) debug_cmd='set -x' func_echo "enabling shell trace mode" >&2 $debug_cmd ;; --no-warnings|--no-warning|--no-warn) set dummy --warnings none ${1+"$@"} shift ;; --warnings|--warning|-W) if test $# = 0 && func_missing_arg $_G_opt; then _G_parse_options_requote=: break fi case " $warning_categories $1" in *" $1 "*) # trailing space prevents matching last $1 above func_append_uniq opt_warning_types " $1" ;; *all) opt_warning_types=$warning_categories ;; *none) opt_warning_types=none warning_func=: ;; *error) opt_warning_types=$warning_categories warning_func=func_fatal_error ;; *) func_fatal_error \ "unsupported warning category: '$1'" ;; esac shift ;; --verbose|-v) opt_verbose=: ;; --version) func_version ;; -\?|-h) func_usage ;; --help) func_help ;; # Separate optargs to long options (plugins may need this): --*=*) func_split_equals "$_G_opt" set dummy "$func_split_equals_lhs" \ "$func_split_equals_rhs" ${1+"$@"} shift ;; # Separate optargs to short options: -W*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "$func_split_short_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-v*|-x*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) _G_parse_options_requote=: ; break ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; *) set dummy "$_G_opt" ${1+"$@"}; shift _G_match_parse_options=false break ;; esac if $_G_match_parse_options; then _G_parse_options_requote=: fi done if $_G_parse_options_requote; then # save modified positional parameters for caller func_quote eval ${1+"$@"} func_parse_options_result=$func_quote_result fi } # func_validate_options [ARG]... # ------------------------------ # Perform any sanity checks on option settings and/or unconsumed # arguments. func_hookable func_validate_options func_validate_options () { $debug_cmd # Display all warnings if -W was not given. test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" func_run_hooks func_validate_options ${1+"$@"} func_propagate_result func_run_hooks func_validate_options # Bail if the options were screwed! $exit_cmd $EXIT_FAILURE } ## ----------------- ## ## Helper functions. ## ## ----------------- ## # This section contains the helper functions used by the rest of the # hookable option parser framework in ascii-betical order. # func_fatal_help ARG... # ---------------------- # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { $debug_cmd eval \$ECHO \""Usage: $usage"\" eval \$ECHO \""$fatal_help"\" func_error ${1+"$@"} exit $EXIT_FAILURE } # func_help # --------- # Echo long help message to standard output and exit. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message" exit 0 } # func_missing_arg ARGNAME # ------------------------ # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $debug_cmd func_error "Missing argument for '$1'." exit_cmd=exit } # func_split_equals STRING # ------------------------ # Set func_split_equals_lhs and func_split_equals_rhs shell variables # after splitting STRING at the '=' sign. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_equals () { $debug_cmd func_split_equals_lhs=${1%%=*} func_split_equals_rhs=${1#*=} if test "x$func_split_equals_lhs" = "x$1"; then func_split_equals_rhs= fi }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_equals () { $debug_cmd func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` func_split_equals_rhs= test "x$func_split_equals_lhs=" = "x$1" \ || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` } fi #func_split_equals # func_split_short_opt SHORTOPT # ----------------------------- # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_short_opt () { $debug_cmd func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"} }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_short_opt () { $debug_cmd func_split_short_opt_name=`expr "x$1" : 'x\(-.\)'` func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` } fi #func_split_short_opt # func_usage # ---------- # Echo short help message to standard output and exit. func_usage () { $debug_cmd func_usage_message $ECHO "Run '$progname --help |${PAGER-more}' for full usage" exit 0 } # func_usage_message # ------------------ # Echo short help message to standard output. func_usage_message () { $debug_cmd eval \$ECHO \""Usage: $usage"\" echo $SED -n 's|^# || /^Written by/{ x;p;x } h /^Written by/q' < "$progpath" echo eval \$ECHO \""$usage_message"\" } # func_version # ------------ # Echo version message to standard output and exit. # The version message is extracted from the calling file's header # comments, with leading '# ' stripped: # 1. First display the progname and version # 2. Followed by the header comment line matching /^# Written by / # 3. Then a blank line followed by the first following line matching # /^# Copyright / # 4. Immediately followed by any lines between the previous matches, # except lines preceding the intervening completely blank line. # For example, see the header comments of this file. func_version () { $debug_cmd printf '%s\n' "$progname $scriptversion" $SED -n ' /^# Written by /!b s|^# ||; p; n :fwd2blnk /./ { n b fwd2blnk } p; n :holdwrnt s|^# || s|^# *$|| /^Copyright /!{ /./H n b holdwrnt } s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| G s|\(\n\)\n*|\1|g p; q' < "$progpath" exit $? } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "30/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: # Set a version string. scriptversion='(GNU libtool) 2.4.7' # func_echo ARG... # ---------------- # Libtool also displays the current mode in messages, so override # funclib.sh func_echo with this custom definition. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" done IFS=$func_echo_IFS } # func_warning ARG... # ------------------- # Libtool warnings are not categorized, so override funclib.sh # func_warning with this simpler definition. func_warning () { $debug_cmd $warning_func ${1+"$@"} } ## ---------------- ## ## Options parsing. ## ## ---------------- ## # Hook in the functions to make sure our own options are parsed during # the option parsing loop. usage='$progpath [OPTION]... [MODE-ARG]...' # Short help message in response to '-h'. usage_message="Options: --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information and exit --mode=MODE use operation mode MODE --no-warnings equivalent to '-Wnone' --preserve-dup-deps don't remove duplicate dependency libraries --quiet, --silent don't print informational messages --tag=TAG use configuration variables from tag TAG -v, --verbose print more informational messages than default --version print version information -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -h, --help, --help-all print short, long, or detailed help message " # Additional text appended to 'usage_message' in response to '--help'. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. When passed as first option, '--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that. Try '$progname --help --mode=MODE' for a more detailed description of MODE. When reporting a bug, please describe a test case to reproduce it and include the following information: host-triplet: $host shell: $SHELL compiler: $LTCC compiler flags: $LTCFLAGS linker: $LD (gnu? $with_gnu_ld) version: $progname (GNU libtool) 2.4.7 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` Report bugs to . GNU libtool home page: . General help using GNU software: ." exit 0 } # func_lo2o OBJECT-NAME # --------------------- # Transform OBJECT-NAME from a '.lo' suffix to the platform specific # object suffix. lo2o=s/\\.lo\$/.$objext/ o2lo=s/\\.$objext\$/.lo/ if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_lo2o () { case $1 in *.lo) func_lo2o_result=${1%.lo}.$objext ;; * ) func_lo2o_result=$1 ;; esac }' # func_xform LIBOBJ-OR-SOURCE # --------------------------- # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise) # suffix to a '.lo' libtool-object suffix. eval 'func_xform () { func_xform_result=${1%.*}.lo }' else # ...otherwise fall back to using sed. func_lo2o () { func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"` } func_xform () { func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` } fi # func_fatal_configuration ARG... # ------------------------------- # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_fatal_error ${1+"$@"} \ "See the $PACKAGE documentation for more information." \ "Fatal configuration error." } # func_config # ----------- # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # ------------- # Display the features supported by this script. func_features () { echo "host: $host" if test yes = "$build_libtool_libs"; then echo "enable shared libraries" else echo "disable shared libraries" fi if test yes = "$build_old_libs"; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag TAGNAME # ----------------------- # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname=$1 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf=/$re_begincf/,/$re_endcf/p # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # ------------------------ # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # libtool_options_prep [ARG]... # ----------------------------- # Preparation for options parsed by libtool. libtool_options_prep () { $debug_mode # Option defaults: opt_config=false opt_dlopen= opt_dry_run=false opt_help=false opt_mode= opt_preserve_dup_deps=false opt_quiet=false nonopt= preserve_args= _G_rc_lt_options_prep=: # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; *) _G_rc_lt_options_prep=false ;; esac if $_G_rc_lt_options_prep; then # Pass back the list of options. func_quote eval ${1+"$@"} libtool_options_prep_result=$func_quote_result fi } func_add_hook func_options_prep libtool_options_prep # libtool_parse_options [ARG]... # --------------------------------- # Provide handling for libtool specific options. libtool_parse_options () { $debug_cmd _G_rc_lt_parse_options=false # Perform our own loop to consume as many options as possible in # each iteration. while test $# -gt 0; do _G_match_lt_parse_options=: _G_opt=$1 shift case $_G_opt in --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) func_config ;; --dlopen|-dlopen) opt_dlopen="${opt_dlopen+$opt_dlopen }$1" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) func_features ;; --finish) set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $_G_opt && break opt_mode=$1 case $1 in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $_G_opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_quiet=false func_append preserve_args " $_G_opt" ;; --no-warnings|--no-warning|--no-warn) opt_warning=false func_append preserve_args " $_G_opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $_G_opt" ;; --silent|--quiet) opt_quiet=: opt_verbose=false func_append preserve_args " $_G_opt" ;; --tag) test $# = 0 && func_missing_arg $_G_opt && break opt_tag=$1 func_append preserve_args " $_G_opt $1" func_enable_tag "$1" shift ;; --verbose|-v) opt_quiet=false opt_verbose=: func_append preserve_args " $_G_opt" ;; # An option not handled by this hook function: *) set dummy "$_G_opt" ${1+"$@"} ; shift _G_match_lt_parse_options=false break ;; esac $_G_match_lt_parse_options && _G_rc_lt_parse_options=: done if $_G_rc_lt_parse_options; then # save modified positional parameters for caller func_quote eval ${1+"$@"} libtool_parse_options_result=$func_quote_result fi } func_add_hook func_parse_options libtool_parse_options # libtool_validate_options [ARG]... # --------------------------------- # Perform any sanity checks on option settings and/or unconsumed # arguments. libtool_validate_options () { # save first non-option argument if test 0 -lt $#; then nonopt=$1 shift fi # preserve --debug test : = "$debug_cmd" || func_append preserve_args " --debug" # Keeping compiler generated duplicates in $postdeps and $predeps is not # harmful, and is necessary in a majority of systems that use it to satisfy # symbol dependencies. opt_duplicate_compiler_generated_deps=: $opt_help || { # Sanity checks first: func_check_version_match test yes != "$build_libtool_libs" \ && test yes != "$build_old_libs" \ && func_fatal_configuration "not configured to build any kind of library" # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test execute != "$opt_mode"; then func_error "unrecognized option '-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help=$help help="Try '$progname --help --mode=$opt_mode' for more information." } # Pass back the unparsed argument list func_quote eval ${1+"$@"} libtool_validate_options_result=$func_quote_result } func_add_hook func_validate_options libtool_validate_options # Process options as early as possible so that --help and --version # can return quickly. func_options ${1+"$@"} eval set dummy "$func_options_result"; shift ## ----------- ## ## Main. ## ## ----------- ## magic='%%%MAGIC variable%%%' magic_exe='%%%MAGIC EXE variable%%%' # Global variables. extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # func_generated_by_libtool # True iff stdin has been generated by Libtool. This function is only # a basic sanity check; it will hardly flush out determined imposters. func_generated_by_libtool_p () { $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p } # func_lalib_unsafe_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if 'file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case $lalib_p_line in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test yes = "$lalib_p" } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { test -f "$1" && $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $debug_cmd save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # 'FILE.' does not work on cygwin managed mounts. func_source () { $debug_cmd case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case $lt_sysroot:$1 in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result='='$func_stripname_result ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $debug_cmd if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with '--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=$1 if test yes = "$build_libtool_libs"; then write_lobj=\'$2\' else write_lobj=none fi if test yes = "$build_old_libs"; then write_oldobj=\'$3\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $debug_cmd # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result= if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result"; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $debug_cmd if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $debug_cmd # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $debug_cmd if test -z "$2" && test -n "$1"; then func_error "Could not determine host file name corresponding to" func_error " '$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result=$1 fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $debug_cmd if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " '$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result=$3 fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $debug_cmd case $4 in $1 ) func_to_host_path_result=$3$func_to_host_path_result ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via '$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $debug_cmd $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $debug_cmd case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result=$1 } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result=$func_convert_core_msys_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result=$func_convert_core_file_wine_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via '$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $debug_cmd if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd=func_convert_path_$func_stripname_result fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $debug_cmd func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result=$1 } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_msys_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_path_wine_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_dll_def_p FILE # True iff FILE is a Windows DLL '.def' file. # Keep in sync with _LT_DLL_DEF_P in libtool.m4 func_dll_def_p () { $debug_cmd func_dll_def_p_tmp=`$SED -n \ -e 's/^[ ]*//' \ -e '/^\(;.*\)*$/d' \ -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ -e q \ "$1"` test DEF = "$func_dll_def_p_tmp" } # func_mode_compile arg... func_mode_compile () { $debug_cmd # Get the compilation command and the source file. base_compile= srcfile=$nonopt # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg=$arg arg_mode=normal ;; target ) libobj=$arg arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify '-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs=$IFS; IFS=, for arg in $args; do IFS=$save_ifs func_append_quoted lastarg "$arg" done IFS=$save_ifs func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg=$srcfile srcfile=$arg ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with '-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj=$func_basename_result } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from '$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test yes = "$build_libtool_libs" \ || func_fatal_configuration "cannot build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_arg pretty "$libobj" test "X$libobj" != "X$func_quote_arg_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name '$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname=$func_basename_result xdir=$func_dirname_result lobj=$xdir$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test yes = "$build_old_libs"; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test no = "$compiler_c_o"; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext lockfile=$output_obj.lock else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test yes = "$need_locks"; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test warn = "$need_locks"; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_arg pretty "$srcfile" qsrcfile=$func_quote_arg_result # Only build a PIC object if we are building libtool libraries. if test yes = "$build_libtool_libs"; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test no != "$pic_mode"; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test yes = "$suppress_opt"; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test yes = "$build_old_libs"; then if test yes != "$pic_mode"; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test yes = "$compiler_c_o"; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test no != "$need_locks"; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test compile = "$opt_mode" && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a '.o' file suitable for static linking -static only build a '.o' file suitable for static linking -Wc,FLAG -Xcompiler FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a 'standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix '.c' with the library object suffix, '.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to '-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the '--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the 'install' or 'cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE use a list of object files found in FILE to specify objects -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes) -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wa,FLAG -Xassembler FLAG pass linker-specific FLAG directly to the assembler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with '-') are ignored. Every other argument is treated as a filename. Files ending in '.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in '.la', then a libtool library is created, only library objects ('.lo' files) may be specified, and '-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created using 'ar' and 'ranlib', or on Windows using 'lib'. If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode '$opt_mode'" ;; esac echo $ECHO "Try '$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test : = "$opt_help"; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | $SED -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | $SED '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $debug_cmd # The first argument is the command name. cmd=$nonopt test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "'$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "'$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "'$file' was not linked with '-export-dynamic'" continue fi func_dirname "$file" "" "." dir=$func_dirname_result if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir=$func_dirname_result ;; *) func_warning "'-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir=$absdir # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic=$magic # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file=$progdir/$program elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file=$progdir/$program fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if $opt_dry_run; then # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS else if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd=\$cmd$args fi } test execute = "$opt_mode" && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $debug_cmd libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "'$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument '$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and '=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_quiet && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the '-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the '$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the '$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the '$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test finish = "$opt_mode" && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $debug_cmd # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac then # Aesthetically quote it. func_quote_arg pretty "$nonopt" install_prog="$func_quote_arg_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_arg pretty "$arg" func_append install_prog "$func_quote_arg_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=false stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=: ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test X-m = "X$prev" && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_arg pretty "$arg" func_append install_prog " $func_quote_arg_result" if test -n "$arg2"; then func_quote_arg pretty "$arg2" fi func_append install_shared_prog " $func_quote_arg_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the '$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_arg pretty "$install_override_mode" func_append install_shared_prog " -m $func_quote_arg_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=: if $isdir; then destdir=$dest destname= else func_dirname_and_basename "$dest" "" "." destdir=$func_dirname_result destname=$func_basename_result # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "'$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "'$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic=$magic staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "'$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir=$func_dirname_result func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking '$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname=$1 shift srcname=$realname test -n "$relink_command" && srcname=${realname}T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme=$stripme case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme= ;; esac ;; os2*) case $realname in *_dll.a) tstripme= ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try 'ln -sf' first, because the 'ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib=$destdir/$realname func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name=$func_basename_result instname=$dir/${name}i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile=$destdir/$destname else func_basename "$file" destfile=$func_basename_result destfile=$destdir/$destfile fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest=$destfile destfile= ;; *) func_fatal_help "cannot copy a libtool object to '$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test yes = "$build_old_libs"; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile=$destdir/$destname else func_basename "$file" destfile=$func_basename_result destfile=$destdir/$destfile fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext= case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=.exe fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script '$wrapper'" finalize=: for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'` if test -n "$libdir" && test ! -f "$libfile"; then func_warning "'$lib' has not been installed in '$libdir'" finalize=false fi done relink_command= func_source "$wrapper" outputname= if test no = "$fast_install" && test -n "$relink_command"; then $opt_dry_run || { if $finalize; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file=$func_basename_result outputname=$tmpdir/$file # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_quiet || { func_quote_arg expand,pretty "$relink_command" eval "func_echo $func_quote_arg_result" } if eval "$relink_command"; then : else func_error "error: relink '$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file=$outputname else func_warning "cannot relink '$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name=$func_basename_result # Set up the ranlib parameters. oldlib=$destdir/$name func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run '$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test install = "$opt_mode" && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $debug_cmd my_outputname=$1 my_originator=$2 my_pic_p=${3-false} my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms=${my_outputname}S.c else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist=$output_objdir/$my_outputname.nm func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* External symbol declarations for the compiler. */\ " if test yes = "$dlself"; then func_verbose "generating symbol list for '$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from '$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols=$output_objdir/$outputname.exp $opt_dry_run || { $RM $export_symbols eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from '$dlprefile'" func_basename "$dlprefile" name=$func_basename_result case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename= if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname"; then func_basename "$dlprefile_dlname" dlprefile_dlbasename=$func_basename_result else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename"; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi func_show_eval '$RM "${nlist}I"' if test -n "$global_symbol_to_import"; then eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[];\ " if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ static void lt_syminit(void) { LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; for (; symbol->name; ++symbol) {" $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" echo >> "$output_objdir/$my_dlsyms" "\ } }" fi echo >> "$output_objdir/$my_dlsyms" "\ LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = { {\"$my_originator\", (void *) 0}," if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ {\"@INIT@\", (void *) <_syminit}," fi case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) $my_pic_p && pic_flag_for_symtable=" $pic_flag" ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"' # Transform the symbol file into the correct name. symfileobj=$output_objdir/${my_outputname}S.$objext case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for '$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $debug_cmd win32_libid_type=unknown win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then case $nm_interface in "MS dumpbin") if func_cygming_ms_implib_p "$1" || func_cygming_gnu_implib_p "$1" then win32_nmres=import else win32_nmres= fi ;; *) func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s|.*|import| p q } }'` ;; esac case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $debug_cmd sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $debug_cmd match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive that possess that section. Heuristic: eliminate # all those that have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $debug_cmd if func_cygming_gnu_implib_p "$1"; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1"; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result= fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $debug_cmd f_ex_an_ar_dir=$1; shift f_ex_an_ar_oldlib=$1 if test yes = "$lock_old_archive_extraction"; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test yes = "$lock_old_archive_extraction"; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $debug_cmd my_gentop=$1; shift my_oldlibs=${1+"$@"} my_oldobjs= my_xlib= my_xabs= my_xdir= for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib=$func_basename_result my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir=$my_gentop/$my_xlib_u func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` func_basename "$darwin_archive" darwin_base_archive=$func_basename_result darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches; do func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch" $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive" cd "unfat-$$/$darwin_base_archive-$darwin_arch" func_extract_an_archive "`pwd`" "$darwin_base_archive" cd "$darwin_curdir" $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result=$my_oldobjs } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory where it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs 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 BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" func_quote_arg pretty "$ECHO" qECHO=$func_quote_arg_result $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=$qECHO fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ that is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options that match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test yes = "$fast_install"; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else \$ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* declarations of non-ANSI functions */ #if defined __MINGW32__ # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined __CYGWIN__ # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined other_platform || defined ... */ #endif /* portability defines, excluding path handling macros */ #if defined _MSC_VER # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC #elif defined __MINGW32__ # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined __CYGWIN__ # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined other platforms ... */ #endif #if defined PATH_MAX # define LT_PATHMAX PATH_MAX #elif defined MAXPATHLEN # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \ defined __OS2__ # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free (stale); stale = 0; } \ } while (0) #if defined LT_DEBUGWRAPPER static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; size_t tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined HAVE_DOS_BASED_FILE_SYSTEM if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined HAVE_DOS_BASED_FILE_SYSTEM } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = (size_t) (q - p); p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (STREQ (str, pat)) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else size_t len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { size_t orig_value_len = strlen (orig_value); size_t add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ size_t len = strlen (new_value); while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[--len] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $debug_cmd case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_suncc_cstd_abi # !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!! # Several compiler flags select an ABI that is incompatible with the # Cstd library. Avoid specifying it if any are in CXXFLAGS. func_suncc_cstd_abi () { $debug_cmd case " $compile_command " in *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*) suncc_use_cstd_abi=no ;; *) suncc_use_cstd_abi=yes ;; esac } # func_mode_link arg... func_mode_link () { $debug_cmd case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # what system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll that has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= os2dllname= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=false prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module=$wl-single_module func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test yes != "$build_libtool_libs" \ && func_fatal_configuration "cannot build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg=$1 shift func_quote_arg pretty,unquoted "$arg" qarg=$func_quote_arg_unquoted_result func_append libtool_args " $func_quote_arg_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir=$arg prev= continue ;; dlfiles|dlprefiles) $preload || { # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=: } case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test no = "$dlself"; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test dlprefiles = "$prev"; then dlself=yes elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test dlfiles = "$prev"; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols=$arg test -f "$arg" \ || func_fatal_error "symbol file '$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex=$arg prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir=$arg prev= continue ;; mllvm) # Clang does not use LLVM to link, so we can simply discard any # '-mllvm $arg' options when doing the link step. prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result if test none != "$pic_object"; then # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object fi # Non-PIC object. if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test none = "$pic_object"; then arg=$non_pic_object fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object=$pic_object func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "'$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file '$arg' does not exist" fi arg=$save_arg prev= continue ;; os2dllname) os2dllname=$arg prev= continue ;; precious_regex) precious_files_regex=$arg prev= continue ;; release) release=-$arg prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test rpath = "$prev"; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds=$arg prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xassembler) func_append compiler_flags " -Xassembler $qarg" prev= func_append compile_command " -Xassembler $qarg" func_append finalize_command " -Xassembler $qarg" continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg=$arg case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "'-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test X-export-symbols = "X$arg"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between '-L' and '$1'" else func_fatal_error "need path for '-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of '$dir'" dir=$absdir ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test X-lc = "X$arg" || test X-lm = "X$arg"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test X-lc = "X$arg" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-midnightbsd*) # Do not include libc due to us having libc/libc_r. test X-lc = "X$arg" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test X-lc = "X$arg" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test X-lc = "X$arg" && continue ;; esac elif test X-lc_r = "X$arg"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-midnightbsd*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -mllvm) prev=mllvm continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; # Solaris ld rejects as of 11.4. Refer to Oracle bug 22985199. -pthread) case $host in *solaris2*) ;; *) case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac ;; esac continue ;; -mt|-mthreads|-kthread|-Kthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module=$wl-multi_module continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "'-no-install' is ignored for $host" func_warning "assuming '-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -os2dllname) prev=os2dllname continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs func_quote_arg pretty "$flag" func_append arg " $func_quote_arg_result" func_append compiler_flags " $func_quote_arg_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs func_quote_arg pretty "$flag" func_append arg " $wl$func_quote_arg_result" func_append compiler_flags " $wl$func_quote_arg_result" func_append linker_flags " $func_quote_arg_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xassembler) prev=xassembler continue ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_arg pretty "$arg" arg=$func_quote_arg_result ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # -fstack-protector* stack protector flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization # -specs=* GCC specs files # -stdlib=* select c++ std lib with clang # -fsanitize=* Clang/GCC memory and address sanitizer # -fuse-ld=* Linker select flags for GCC # -Wa,* Pass flags directly to the assembler -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ -specs=*|-fsanitize=*|-fuse-ld=*|-Wa,*) func_quote_arg pretty "$arg" arg=$func_quote_arg_result func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; -Z*) if test os2 = "`expr $host : '.*\(os2\)'`"; then # OS/2 uses -Zxxx to specify OS/2-specific options compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case $arg in -Zlinker | -Zstack) prev=xcompiler ;; esac continue else # Otherwise treat like 'Some other compiler flag' below func_quote_arg pretty "$arg" arg=$func_quote_arg_result fi ;; # Some other compiler flag. -* | +*) func_quote_arg pretty "$arg" arg=$func_quote_arg_result ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result test none = "$pic_object" || { # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object } # Non-PIC object. if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test none = "$pic_object"; then arg=$non_pic_object fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object=$pic_object func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "'$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test dlfiles = "$prev"; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test dlprefiles = "$prev"; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_arg pretty "$arg" arg=$func_quote_arg_result ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the '$prevarg' option requires an argument" if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname=$func_basename_result libobjs_save=$libobjs if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" # Definition is injected by LT_CONFIG during libtool generation. func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH" func_dirname "$output" "/" "" output_objdir=$func_dirname_result$objdir func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test lib = "$linkmode"; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can '-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=false newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test lib,link = "$linkmode,$pass"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs=$tmp_deplibs fi if test lib,link = "$linkmode,$pass" || test prog,scan = "$linkmode,$pass"; then libs=$deplibs deplibs= fi if test prog = "$linkmode"; then case $pass in dlopen) libs=$dlfiles ;; dlpreopen) libs=$dlprefiles ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test lib,dlpreopen = "$linkmode,$pass"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs=$dlprefiles fi if test dlopen = "$pass"; then # Collect dlpreopened libraries save_deplibs=$deplibs deplibs= fi for deplib in $libs; do lib= found=false case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test lib != "$linkmode" && test prog != "$linkmode"; then func_warning "'-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test lib = "$linkmode"; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib=$searchdir/lib$name$search_ext if test -f "$lib"; then if test .la = "$search_ext"; then found=: else found=false fi break 2 fi done done if $found; then # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll=$l done if test "X$ll" = "X$old_library"; then # only static version available found=false func_dirname "$lib" "" "." ladir=$func_dirname_result lib=$ladir/$old_library if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi else # deplib doesn't seem to be a libtool library if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi ;; # -l *.ltframework) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test conv = "$pass" && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test conv = "$pass"; then deplibs="$deplib $deplibs" continue fi if test scan = "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "'-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test link = "$pass"; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test conv = "$pass"; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=false case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=: fi ;; pass_all) valid_a_lib=: ;; esac if $valid_a_lib; then echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" else echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." fi ;; esac continue ;; prog) if test link != "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test conv = "$pass"; then deplibs="$deplib $deplibs" elif test prog = "$linkmode"; then if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=: continue ;; esac # case $deplib $found || test -f "$lib" \ || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'" # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "'$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir=$func_dirname_result dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test lib,link = "$linkmode,$pass" || test prog,scan = "$linkmode,$pass" || { test prog != "$linkmode" && test lib != "$linkmode"; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test conv = "$pass"; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for '$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" elif test prog != "$linkmode" && test lib != "$linkmode"; then func_fatal_error "'$lib' is not a convenience library" fi tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test yes = "$prefer_static_libs" || test built,no = "$prefer_static_libs,$installed"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib=$l done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for '$lib'" fi # This library was specified with -dlopen. if test dlopen = "$pass"; then test -z "$libdir" \ && func_fatal_error "cannot -dlopen a convenience library: '$lib'" if test -z "$dlname" || test yes != "$dlopen_support" || test no = "$build_libtool_libs" then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of '$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir=$ladir fi ;; esac func_basename "$lib" laname=$func_basename_result # Find the relevant object directory and library name. if test yes = "$installed"; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library '$lib' was moved." dir=$ladir absdir=$abs_ladir libdir=$abs_ladir else dir=$lt_sysroot$libdir absdir=$lt_sysroot$libdir fi test yes = "$hardcode_automatic" && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir=$ladir absdir=$abs_ladir # Remove this search path later func_append notinst_path " $abs_ladir" else dir=$ladir/$objdir absdir=$abs_ladir/$objdir # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test dlpreopen = "$pass"; then if test -z "$libdir" && test prog = "$linkmode"; then func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'" fi case $host in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test lib = "$linkmode"; then deplibs="$dir/$old_library $deplibs" elif test prog,link = "$linkmode,$pass"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test prog = "$linkmode" && test link != "$pass"; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=false if test no != "$link_all_deplibs" || test -z "$library_names" || test no = "$build_libtool_libs"; then linkalldeplibs=: fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if $linkalldeplibs; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test prog,link = "$linkmode,$pass"; then if test -n "$library_names" && { { test no = "$prefer_static_libs" || test built,yes = "$prefer_static_libs,$installed"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then # Make sure the rpath contains only unique directories. case $temp_rpath: in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if $alldeplibs && { test pass_all = "$deplibs_check_method" || { test yes = "$build_libtool_libs" && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test built = "$use_static_libs" && test yes = "$installed"; then use_static_libs=no fi if test -n "$library_names" && { test no = "$use_static_libs" || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc* | *os2*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test no = "$installed"; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule= for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule=$dlpremoduletest break fi done if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then echo if test prog = "$linkmode"; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test lib = "$linkmode" && test yes = "$hardcode_into_libs"; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname=$1 shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname=$dlname elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc* | *os2*) func_arith $current - $age major=$func_arith_result versuffix=-$major ;; esac eval soname=\"$soname_spec\" else soname=$realname fi # Make a new name for the extract_expsyms_cmds to use soroot=$soname func_basename "$soroot" soname=$func_basename_result func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from '$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for '$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test prog = "$linkmode" || test relink != "$opt_mode"; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test no = "$hardcode_direct"; then add=$dir/$linklib case $host in *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;; *-*-sysv4*uw2*) add_dir=-L$dir ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir=-L$dir ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we cannot # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library"; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add=$dir/$old_library fi elif test -n "$old_library"; then add=$dir/$old_library fi fi esac elif test no = "$hardcode_minus_L"; then case $host in *-*-sunos*) add_shlibpath=$dir ;; esac add_dir=-L$dir add=-l$name elif test no = "$hardcode_shlibpath_var"; then add_shlibpath=$dir add=-l$name else lib_linked=no fi ;; relink) if test yes = "$hardcode_direct" && test no = "$hardcode_direct_absolute"; then add=$dir/$linklib elif test yes = "$hardcode_minus_L"; then add_dir=-L$absdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add=-l$name elif test yes = "$hardcode_shlibpath_var"; then add_shlibpath=$dir add=-l$name else lib_linked=no fi ;; *) lib_linked=no ;; esac if test yes != "$lib_linked"; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test prog = "$linkmode"; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test yes != "$hardcode_direct" && test yes != "$hardcode_minus_L" && test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test prog = "$linkmode" || test relink = "$opt_mode"; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test yes = "$hardcode_direct" && test no = "$hardcode_direct_absolute"; then add=$libdir/$linklib elif test yes = "$hardcode_minus_L"; then add_dir=-L$libdir add=-l$name elif test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add=-l$name elif test yes = "$hardcode_automatic"; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib"; then add=$inst_prefix_dir$libdir/$linklib else add=$libdir/$linklib fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir=-L$libdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add=-l$name fi if test prog = "$linkmode"; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test prog = "$linkmode"; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test unsupported != "$hardcode_direct"; then test -n "$old_library" && linklib=$old_library compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test yes = "$build_libtool_libs"; then # Not a shared library if test pass_all != "$deplibs_check_method"; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system cannot link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test yes = "$module"; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using 'nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** 'nm' from GNU binutils and a full rebuild may help." fi if test no = "$build_old_libs"; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test lib = "$linkmode"; then if test -n "$dependency_libs" && { test yes != "$hardcode_into_libs" || test yes = "$build_old_libs" || test yes = "$link_static"; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs=$temp_deplibs fi func_append newlib_search_path " $absdir" # Link against this library test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test no != "$link_all_deplibs"; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path=$deplib ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of '$dir'" absdir=$dir fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names"; then for tmp in $deplibrary_names; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl"; then depdepl=$absdir/$objdir/$depdepl darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl" func_append linker_flags " -dylib_file $darwin_install_name:$depdepl" path= fi fi ;; *) path=-L$absdir/$objdir ;; esac else eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "'$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "'$deplib' seems to be moved" path=-L$absdir fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test link = "$pass"; then if test prog = "$linkmode"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs=$newdependency_libs if test dlpreopen = "$pass"; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test dlopen != "$pass"; then test conv = "$pass" || { # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= } if test prog,link = "$linkmode,$pass"; then vars="compile_deplibs finalize_deplibs" else vars=deplibs fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Add Sun CC postdeps if required: test CXX = "$tagname" && { case $host_os in linux*) case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 func_suncc_cstd_abi if test no != "$suncc_use_cstd_abi"; then func_append postdeps ' -library=Cstd -library=Crun' fi ;; esac ;; solaris*) func_cc_basename "$CC" case $func_cc_basename_result in CC* | sunCC*) func_suncc_cstd_abi if test no != "$suncc_use_cstd_abi"; then func_append postdeps ' -library=Cstd -library=Crun' fi ;; esac ;; esac } # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i= ;; esac if test -n "$i"; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test prog = "$linkmode"; then dlfiles=$newdlfiles fi if test prog = "$linkmode" || test lib = "$linkmode"; then dlprefiles=$newdlprefiles fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then func_warning "'-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "'-l' and '-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "'-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "'-R' is ignored for archives" test -n "$vinfo" && \ func_warning "'-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "'-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "'-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs=$output func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form 'libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test no = "$module" \ && func_fatal_help "libtool library '$output' must begin with 'lib'" if test no != "$need_lib_prefix"; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test pass_all != "$deplibs_check_method"; then func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test no = "$dlself" \ || func_warning "'-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test 1 -lt "$#" \ && func_warning "ignoring multiple '-rpath's for a libtool library" install_libdir=$1 oldlibs= if test -z "$rpath"; then if test yes = "$build_libtool_libs"; then # Building a libtool convenience library. # Some compilers have problems with a '.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "'-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "'-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs=$IFS; IFS=: set dummy $vinfo 0 0 0 shift IFS=$save_ifs test -n "$7" && \ func_fatal_help "too many parameters to '-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major=$1 number_minor=$2 number_revision=$3 # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # that has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|freebsd-elf|linux|midnightbsd-elf|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor revision=$number_revision ;; freebsd-aout|qnx|sunos) current=$number_major revision=$number_minor age=0 ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor revision=$number_minor lt_irix_increment=no ;; esac ;; no) current=$1 revision=$2 age=$3 ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT '$current' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION '$revision' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE '$age' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE '$age' is greater than the current interface number '$current'" func_fatal_error "'$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" # On Darwin other compilers case $CC in nagfor*) verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" ;; *) verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; esac ;; freebsd-aout) major=.$current versuffix=.$current.$revision ;; freebsd-elf | midnightbsd-elf) func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision ;; irix | nonstopux) if test no = "$lt_irix_increment"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring=$verstring_prefix$major.$revision # Add in all the interfaces that we are compatible with. loop=$revision while test 0 -ne "$loop"; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring=$verstring_prefix$major.$iface:$verstring done # Before this point, $major must not contain '.'. major=.$major versuffix=$major.$revision ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=.$current.$age.$revision verstring=$current.$age.$revision # Add in all the interfaces that we are compatible with. loop=$age while test 0 -ne "$loop"; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring=$verstring:$iface.0 done # Make executables depend on our current version. func_append verstring ":$current.0" ;; qnx) major=.$current versuffix=.$current ;; sco) major=.$current versuffix=.$current ;; sunos) major=.$current versuffix=.$current.$revision ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 file systems. func_arith $current - $age major=$func_arith_result versuffix=-$major ;; *) func_fatal_configuration "unknown library version type '$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring=0.0 ;; esac if test no = "$need_version"; then versuffix= else versuffix=.0.0 fi fi # Remove version info from name if versioning should be avoided if test yes,no = "$avoid_version,$need_version"; then major= versuffix= verstring= fi # Check to see if the archive will have undefined symbols. if test yes = "$allow_undefined"; then if test unsupported = "$allow_undefined_flag"; then if test yes = "$build_old_libs"; then func_warning "undefined symbols not allowed in $host shared libraries; building static only" build_libtool_libs=no else func_fatal_error "can't build $host shared library unless -no-undefined is specified" fi fi else # Don't allow undefined symbols. allow_undefined_flag=$no_undefined_flag fi fi func_generate_dlsyms "$libname" "$libname" : func_append libobjs " $symfileobj" test " " = "$libobjs" && libobjs= if test relink != "$opt_mode"; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*) if test -n "$precious_files_regex"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles=$dlfiles dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles=$dlprefiles dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test yes = "$build_libtool_libs"; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test yes = "$build_libtool_need_lc"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release= versuffix= major= newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib=$potent_lib while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | $SED 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;; *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib= break 2 fi done done fi if test -n "$a_deplib"; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib"; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib= ;; esac fi if test -n "$a_deplib"; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib=$potent_lib # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib= break 2 fi done done fi if test -n "$a_deplib"; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib"; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs= tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test yes = "$allow_libtool_libs_with_static_runtimes"; then for i in $predeps $postdeps; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test none = "$deplibs_check_method"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test yes = "$droppeddeps"; then if test yes = "$module"; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using 'nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** 'nm' from GNU binutils and a full rebuild may help." fi if test no = "$build_old_libs"; then oldlibs=$output_objdir/$libname.$libext build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test no = "$allow_undefined"; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test no = "$build_old_libs"; then oldlibs=$output_objdir/$libname.$libext build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs=$new_libs # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test yes = "$build_libtool_libs"; then # Remove $wl instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test yes = "$hardcode_into_libs"; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath=$finalize_rpath test relink = "$opt_mode" || rpath=$compile_rpath$rpath for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath=$finalize_shlibpath test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname=$1 shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname=$realname fi if test -z "$dlname"; then dlname=$soname fi lib=$output_objdir/$realname linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols=$output_objdir/$libname.uexp func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile func_dll_def_p "$export_symbols" || { # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols=$export_symbols export_symbols= always_export_symbols=yes } fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for '$libname.la'" export_symbols=$output_objdir/$libname.exp $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs=$IFS; IFS='~' for cmd1 in $cmds; do IFS=$save_ifs # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test yes = "$try_normal_branch" \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=$output_objdir/$output_la.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS=$save_ifs if test -n "$export_symbols_regex" && test : != "$skipped_export"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols=$export_symbols test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test : != "$skipped_export" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for '$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands, which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs=$tmp_deplibs if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test yes = "$compiler_needs_object" && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test relink = "$opt_mode"; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test yes = "$module" && test -n "$module_cmds"; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test : != "$skipped_export" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then output=$output_objdir/$output_la.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then output=$output_objdir/$output_la.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test yes = "$compiler_needs_object"; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-$k.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test -z "$objlist" || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test 1 -eq "$k"; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-$k.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-$k.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi ${skipped_export-false} && { func_verbose "generating symbol list for '$libname.la'" export_symbols=$output_objdir/$libname.exp $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi } test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs=$IFS; IFS='~' for cmd in $concat_cmds; do IFS=$save_ifs $opt_quiet || { func_quote_arg expand,pretty "$cmd" eval "func_echo $func_quote_arg_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test relink = "$opt_mode"; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS=$save_ifs if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi ${skipped_export-false} && { if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols=$export_symbols test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for '$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands, which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi } libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test yes = "$module" && test -n "$module_cmds"; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs=$IFS; IFS='~' for cmd in $cmds; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs $opt_quiet || { func_quote_arg expand,pretty "$cmd" eval "func_echo $func_quote_arg_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test relink = "$opt_mode"; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS=$save_ifs # Restore the uninstalled library and exit if test relink = "$opt_mode"; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test yes = "$module" || test yes = "$export_dynamic"; then # On all known operating systems, these are identical. dlname=$soname fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then func_warning "'-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "'-l' and '-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "'-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "'-R' is ignored for objects" test -n "$vinfo" && \ func_warning "'-version-info' is ignored for objects" test -n "$release" && \ func_warning "'-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object '$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj=$output ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # if reload_cmds runs $LD directly, get rid of -Wl from # whole_archive_flag_spec and hope we can get by with turning comma # into space. case $reload_cmds in *\$LD[\ \$]*) wl= ;; esac if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags else gentop=$output_objdir/${obj}x func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test yes = "$build_libtool_libs" || libobjs=$non_pic_objects # Create the old-style object. reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs output=$obj func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi test yes = "$build_libtool_libs" || { if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS } if test -n "$pic_flag" || test default != "$pic_mode"; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output=$libobj func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "'-version-info' is ignored for programs" test -n "$release" && \ func_warning "'-release' is ignored for programs" $preload \ && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \ && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test CXX = "$tagname"; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " $wl-bind_at_load" func_append finalize_command " $wl-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs=$new_libs func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath=$rpath rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath=$rpath if test -n "$libobjs" && test yes = "$build_old_libs"; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" false # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=: case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=false ;; *cygwin* | *mingw* ) test yes = "$build_libtool_libs" || wrappers_required=false ;; *) if test no = "$need_relink" || test yes != "$build_libtool_libs"; then wrappers_required=false fi ;; esac $wrappers_required || { # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command=$compile_command$compile_rpath # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.$objext"; then func_show_eval '$RM "$output_objdir/${outputname}S.$objext"' fi exit $exit_status } if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test yes = "$no_install"; then # We don't need to create a wrapper script. link_command=$compile_var$compile_command$compile_rpath # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi case $hardcode_action,$fast_install in relink,*) # Fast installation is not supported link_command=$compile_var$compile_command$compile_rpath relink_command=$finalize_var$finalize_command$finalize_rpath func_warning "this platform does not like uninstalled shared libraries" func_warning "'$output' will be relinked during installation" ;; *,yes) link_command=$finalize_var$compile_command$finalize_rpath relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` ;; *,no) link_command=$compile_var$compile_command$compile_rpath relink_command=$finalize_var$finalize_command$finalize_rpath ;; *,needless) link_command=$finalize_var$compile_command$finalize_rpath relink_command= ;; esac # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_arg pretty "$var_value" relink_command="$var=$func_quote_arg_result; export $var; $relink_command" fi done func_quote eval cd "`pwd`" func_quote_arg pretty,unquoted "($func_quote_result; $relink_command)" relink_command=$func_quote_arg_unquoted_result fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource=$output_path/$objdir/lt-$output_name.c cwrapper=$output_path/$output_name.exe $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host"; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do case $build_libtool_libs in convenience) oldobjs="$libobjs_save $symfileobj" addlibs=$convenience build_libtool_libs=no ;; module) oldobjs=$libobjs_save addlibs=$old_convenience build_libtool_libs=no ;; *) oldobjs="$old_deplibs $non_pic_objects" $preload && test -f "$symfileobj" \ && func_append oldobjs " $symfileobj" addlibs=$old_convenience ;; esac if test -n "$addlibs"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase=$func_basename_result case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj"; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test -z "$oldobjs"; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test yes = "$build_old_libs" && old_library=$libname.$libext func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_arg pretty,unquoted "$var_value" relink_command="$var=$func_quote_arg_unquoted_result; export $var; $relink_command" fi done # Quote the link command for shipping. func_quote eval cd "`pwd`" relink_command="($func_quote_result; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" func_quote_arg pretty,unquoted "$relink_command" relink_command=$func_quote_arg_unquoted_result if test yes = "$hardcode_automatic"; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test yes = "$installed"; then if test -z "$install_libdir"; then break fi output=$output_objdir/${outputname}i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name=$func_basename_result func_resolve_sysroot "$deplib" eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "'$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs=$newdependency_libs newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name=$func_basename_result eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "'$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name=$func_basename_result eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "'$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles=$newdlprefiles else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles=$newdlprefiles fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test -n "$bindir"; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result/$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that cannot go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test no,yes = "$installed,$need_relink"; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } if test link = "$opt_mode" || test relink = "$opt_mode"; then func_mode_link ${1+"$@"} fi # func_mode_uninstall arg... func_mode_uninstall () { $debug_cmd RM=$nonopt files= rmforce=false exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic=$magic for arg do case $arg in -f) func_append RM " $arg"; rmforce=: ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir=$func_dirname_result if test . = "$dir"; then odir=$objdir else odir=$dir/$objdir fi func_basename "$file" name=$func_basename_result test uninstall = "$opt_mode" && odir=$dir # Remember odir for removal later, being careful to avoid duplicates if test clean = "$opt_mode"; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif $rmforce; then continue fi rmfiles=$file case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case $opt_mode in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test none != "$pic_object"; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test none != "$non_pic_object"; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test clean = "$opt_mode"; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.$objext" if test yes = "$fast_install" && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name"; then func_append rmfiles " $odir/lt-$noexename.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the $objdir's in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then func_mode_uninstall ${1+"$@"} fi test -z "$opt_mode" && { help=$generic_help func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode '$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # where we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: audit-4.0.2/THANKS0000644001034500103450000000201614655201403007216 This file is to mention significant contributions to this project. * Kris Wilson of IBM for all the testing and bug reports * Tim Chavez of IBM for the auditctl filesystem watch code * Debbie Velarde of IBM for the command line parsing code of ausearch and lspp rules sample configuration * Amy Griffis of HP for the capp.rules sample configuration * Dustin Kirkland of IBM for the new rule operator & exclude filter patch * Sergey Tikhonov for the Alpha Processor support patch * Darrel Goeddel of TCS for new audit rule format patch * Lisa Smith of HP for the audit failure query function * Dan Walsh of Red Hat for Python bindings * John Dennis of Red Hat for rewriting the python bindings and auparse updates * Miloslav Trmac of Red Hat for numerous patches including store forward remote logging * DJ Delorie of Red Hat for the remote logging code * Marcelo Cerri of IBM for the auvirt program * Peter Moody of Google for the interfield comparator code * Burn Alting for the augenrules code and the auparse list of lists conversion audit-4.0.2/INSTALL0000644001034500103450000000202614655201425007341 To build audit from github, cd to the place where you want everything to be. Then do this: git clone https://github.com/linux-audit/audit-userspace.git cd audit-userspace ./autogen.sh ./configure make dist This will result in a tar file. This can then be used with the packaging system for your OS. This is the recommended way to do it. If you do not want use a packaging system, read the options from ./configure --help and choose appropriately. For example, you may want to do something like this as root: ./configure --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin \ --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share \ --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec \ --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man \ --infodir=/usr/share/info --sbindir=/sbin --libdir=/lib64 \ --with-python=yes --with-python3=yes --with-libwrap --enable-tcp=yes \ --enable-gssapi-krb5=yes --with-arm --with-aarch64 --with-libcap-ng=yes \ --without-golang --enable-systemd make make install audit-4.0.2/Makefile.in0000644001034500103450000006701114655201422010357 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am -- # Copyright 2004-08,2015-16 Red Hat Inc. # All Rights Reserved. # # 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; see the file COPYING. If not, write to the # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor # Boston, MA 02110-1335, USA. # # Authors: # Steve Grubb # Rickard E. (Rik) Faith # 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@ subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prog_cc_for_build.m4 \ $(top_srcdir)/m4/cap-ng.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/src/libev/libev.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_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir distdir-am dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \ config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in AUTHORS \ COPYING COPYING.LIB ChangeLog INSTALL NEWS README.md THANKS \ TODO compile config.guess config.sub install-sh ltmain.sh \ missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip # Exists only to be overridden by the user if desired. AM_DISTCHECK_DVI_TARGET = dvi distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILD_EXEEXT = @BUILD_EXEEXT@ BUILD_OBJEXT = @BUILD_OBJEXT@ CAPNG_LDADD = @CAPNG_LDADD@ CAPNG_PKG = @CAPNG_PKG@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_FOR_BUILD = @CC_FOR_BUILD@ CFLAGS = @CFLAGS@ CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ CPP_FOR_BUILD = @CPP_FOR_BUILD@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG = @DEBUG@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GOLANG = @GOLANG@ GOROOT = @GOROOT@ 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@ LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBWRAP_LIBS = @LIBWRAP_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PYTHON = @PYTHON@ PYTHON3_CFLAGS = @PYTHON3_CFLAGS@ PYTHON3_INCLUDES = @PYTHON3_INCLUDES@ PYTHON3_LIBS = @PYTHON3_LIBS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ VERSION = @VERSION@ WFLAGS = @WFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CC_FOR_BUILD = @ac_ct_CC_FOR_BUILD@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gss_libs = @gss_libs@ 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@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ use_python3 = @use_python3@ SUBDIRS = common lib auparse audisp src/libev src tools bindings init.d \ m4 docs rules EXTRA_DIST = ChangeLog AUTHORS NEWS README.md INSTALL \ audit.spec COPYING COPYING.LIB \ contrib/avc_snap contrib/plugin/Makefile \ contrib/plugin/audisp-example.c \ contrib/plugin/audisp-example.conf CONFIG_CLEAN_FILES = debug*.list config/* all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-zstd: distdir tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ *.tar.zst*) \ zstd -dc $(distdir).tar.zst | $(am__untar) ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile config.h installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr \ distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) all install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ clean-libtool cscope cscopelist-am ctags ctags-am dist \ dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ dist-xz dist-zip dist-zstd distcheck distclean \ distclean-generic distclean-hdr distclean-libtool \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile clean-generic: rm -rf autom4te*.cache rm -f *.rej *.orig *.lang # 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: audit-4.0.2/common/0000755001034500103450000000000014655201456007664 5audit-4.0.2/common/common.h0000644001034500103450000000312714655201403011240 /* common.h -- common utility functions used throughout * Copyright 2018-24 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb */ #ifndef AUDIT_FGETS_HEADER #define AUDIT_FGETS_HEADER #include #include "dso.h" // These macros originate in sys/cdefs.h #ifndef __attr_access # define __attr_access(x) #endif #ifndef __attribute_malloc__ # define __attribute_malloc__ #endif #ifndef __attr_dealloc # define __attr_dealloc(dealloc, argno) #endif #ifndef __wur # define __wur #endif AUDIT_HIDDEN_START void audit_fgets_clear(void); int audit_fgets_eof(void); int audit_fgets_more(size_t blen); int audit_fgets(char *buf, size_t blen, int fd) __attr_access ((__write_only__, 1, 2)); char *audit_strsplit_r(char *s, char **savedpp); char *audit_strsplit(char *s); int audit_is_last_record(int type); AUDIT_HIDDEN_END #endif audit-4.0.2/common/strsplit.c0000644001034500103450000000330714655201403011627 /* strsplit.c -- * Copyright 2014,2016,2017 Red Hat Inc., Durham, North Carolina. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb * */ #include #include "common.h" char *audit_strsplit_r(char *s, char **savedpp) { char *ptr; if (s) *savedpp = s; else { if (*savedpp == NULL) return NULL; *savedpp += 1; } retry: ptr = strchr(*savedpp, ' '); if (ptr) { if (ptr == *savedpp) { *savedpp += 1; goto retry; } s = *savedpp; *ptr = 0; *savedpp = ptr; return s; } else { s = *savedpp; *savedpp = NULL; if (*s == 0) return NULL; return s; } } char *audit_strsplit(char *s) { static char *str = NULL; char *ptr; if (s) str = s; else { if (str == NULL) return NULL; str++; } retry: ptr = strchr(str, ' '); if (ptr) { if (ptr == str) { str++; goto retry; } s = str; *ptr = 0; str = ptr; return s; } else { s = str; str = NULL; if (*s == 0) return NULL; return s; } } audit-4.0.2/common/common.c0000644001034500103450000000410314655201403011226 /* common.c -- * Copyright 2023 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb */ #include "libaudit.h" #include "common.h" /* * This function returns 1 if it is the last record in an event. * It returns 0 otherwise. * * When processing an event stream we define the end of an event via * record type = AUDIT_EOE (audit end of event type record), or * record type = AUDIT_PROCTITLE (we note the AUDIT_PROCTITLE is always * the last record), or * record type = AUDIT_KERNEL (kernel events are one record events), or * record type < AUDIT_FIRST_EVENT (only single record events appear * before this type), or * record type >= AUDIT_FIRST_ANOM_MSG (only single record events appear * after this type), or * record type >= AUDIT_MAC_UNLBL_ALLOW && record type <= AUDIT_MAC_CALIPSO_DEL * (these are also one record events) */ int audit_is_last_record(int type) { if (type == AUDIT_PROCTITLE || type == AUDIT_EOE || (type > AUDIT_LOGIN && type < AUDIT_FIRST_EVENT) || type >= AUDIT_FIRST_ANOM_MSG || type == AUDIT_KERNEL || (type >= AUDIT_MAC_UNLBL_ALLOW && type <= AUDIT_MAC_CALIPSO_DEL)) { return 1; } return 0; } audit-4.0.2/common/Makefile.in0000644001034500103450000005025714655201422011653 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am-- # Copyright 2018-2023 Red Hat Inc. # All Rights Reserved. # # 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; see the file COPYING. If not, write to the # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor # Boston, MA 02110-1335, USA. # # Authors: # Steve Grubb # 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@ subdir = common ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prog_cc_for_build.m4 \ $(top_srcdir)/m4/cap-ng.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/src/libev/libev.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libaucommon_la_LIBADD = am_libaucommon_la_OBJECTS = audit-fgets.lo strsplit.lo common.lo libaucommon_la_OBJECTS = $(am_libaucommon_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/audit-fgets.Plo \ ./$(DEPDIR)/common.Plo ./$(DEPDIR)/strsplit.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libaucommon_la_SOURCES) DIST_SOURCES = $(libaucommon_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILD_EXEEXT = @BUILD_EXEEXT@ BUILD_OBJEXT = @BUILD_OBJEXT@ CAPNG_LDADD = @CAPNG_LDADD@ CAPNG_PKG = @CAPNG_PKG@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_FOR_BUILD = @CC_FOR_BUILD@ CFLAGS = @CFLAGS@ CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ CPP_FOR_BUILD = @CPP_FOR_BUILD@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG = @DEBUG@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GOLANG = @GOLANG@ GOROOT = @GOROOT@ 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@ LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBWRAP_LIBS = @LIBWRAP_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PYTHON = @PYTHON@ PYTHON3_CFLAGS = @PYTHON3_CFLAGS@ PYTHON3_INCLUDES = @PYTHON3_INCLUDES@ PYTHON3_LIBS = @PYTHON3_LIBS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ VERSION = @VERSION@ WFLAGS = @WFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CC_FOR_BUILD = @ac_ct_CC_FOR_BUILD@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gss_libs = @gss_libs@ 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@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ use_python3 = @use_python3@ CONFIG_CLEAN_FILES = *.rej *.orig AM_CFLAGS = -fPIC -DPIC -D_GNU_SOURCE -g AM_CPPFLAGS = -I${top_srcdir} -I${top_srcdir}/lib noinst_HEADERS = common.h libaucommon_la_DEPENDENCIES = ../config.h libaucommon_la_SOURCES = audit-fgets.c strsplit.c common.c noinst_LTLIBRARIES = libaucommon.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu common/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu common/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libaucommon.la: $(libaucommon_la_OBJECTS) $(libaucommon_la_DEPENDENCIES) $(EXTRA_libaucommon_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libaucommon_la_OBJECTS) $(libaucommon_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audit-fgets.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/common.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strsplit.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/audit-fgets.Plo -rm -f ./$(DEPDIR)/common.Plo -rm -f ./$(DEPDIR)/strsplit.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/audit-fgets.Plo -rm -f ./$(DEPDIR)/common.Plo -rm -f ./$(DEPDIR)/strsplit.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: audit-4.0.2/common/Makefile.am0000644001034500103450000000217414655201403011634 # Makefile.am-- # Copyright 2018-2023 Red Hat Inc. # All Rights Reserved. # # 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; see the file COPYING. If not, write to the # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor # Boston, MA 02110-1335, USA. # # Authors: # Steve Grubb # CONFIG_CLEAN_FILES = *.rej *.orig AM_CFLAGS = -fPIC -DPIC -D_GNU_SOURCE -g AM_CPPFLAGS = -I${top_srcdir} -I${top_srcdir}/lib noinst_HEADERS = common.h libaucommon_la_DEPENDENCIES = ../config.h libaucommon_la_SOURCES = audit-fgets.c strsplit.c common.c noinst_LTLIBRARIES = libaucommon.la audit-4.0.2/common/audit-fgets.c0000644001034500103450000000735014655201403012161 /* audit-fgets.c -- a replacement for glibc's fgets * Copyright 2018,2022 Red Hat Inc. * All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb */ #include "config.h" #include #include #include #include #include "common.h" #define BUF_SIZE 8192 static char buffer[2*BUF_SIZE+1] = { 0 }; static char *current = buffer; static char *const eptr = buffer+(2*BUF_SIZE); static int eof = 0; int audit_fgets_eof(void) { return eof; } /* This function dumps any accumulated text. This is to remove dangling text * that never got consumed for the intended purpose. */ void audit_fgets_clear(void) { buffer[0] = 0; current = buffer; eof = 0; } /* Function to check if we have more data stored * and ready to process. If we have a newline or enough * bytes we return 1 for success. Otherwise 0 meaning that * there is not enough to process without blocking. */ int audit_fgets_more(size_t blen) { char *ptr = strchr(buffer, '\n'); assert(blen != 0); if (ptr || (size_t)(current-buffer) >= blen-1) return 1; return 0; } /* Function to read the next chunk of data from the given fd. If we have * data to return, we pass the line length for success. 0 for no data. And * -1 if there was an error reading the fd. */ int audit_fgets(char *buf, size_t blen, int fd) { int complete = 0; size_t line_len = 0; char *line_end = NULL; assert(blen != 0); /* See if we have more in the buffer first */ if (current != buffer) { line_end = strchr(buffer, '\n'); if (line_end == NULL && (size_t)(current - buffer) >= blen-1) line_end = current-1; // have enough to fill blen, so point to end } /* Otherwise get some new bytes */ if (line_end == NULL && current != eptr && !eof) { ssize_t len; /* Use current since we may be adding more */ do { len = read(fd, current, eptr - current); } while (len < 0 && errno == EINTR); if (len < 0) return -1; if (len == 0) eof = 1; else current[len] = 0; current += len; /* Start from beginning to see if we have one */ line_end = strchr(buffer, '\n'); } /* See what we have */ if (line_end) { /* Include the last character (usually newline) */ line_len = (line_end+1) - buffer; /* Make sure we are within the right size */ if (line_len > blen-1) line_len = blen-1; complete = 1; } else if (current == eptr) { /* We are full but no newline */ line_len = blen-1; complete = 1; } else if (current >= buffer+blen-1) { /* Not completely full, no newline, but enough to fill buf */ line_len = blen-1; complete = 1; } if (complete) { size_t remainder_len; /* Move to external buf and terminate it */ memcpy(buf, buffer, line_len); buf[line_len] = 0; remainder_len = current - (buffer + line_len); if (remainder_len > 0) { /* We have a few leftover bytes to move */ memmove(buffer, buffer+line_len, remainder_len); current = buffer+remainder_len; } else { /* Got the whole thing, just reset */ current = buffer; } *current = 0; } return complete ? line_len : 0; } audit-4.0.2/config.sub0000755001034500103450000010572414655201422010301 #!/usr/bin/sh # Configuration validation subroutine script. # Copyright 1992-2023 Free Software Foundation, Inc. # shellcheck disable=SC2006,SC2268 # see below for rationale timestamp='2023-06-23' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # https://git.savannah.gnu.org/cgit/config.git/plain/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. # The "shellcheck disable" line above the timestamp inhibits complaints # about features and limitations of the classic Bourne shell that were # superseded or lifted in POSIX. However, this script identifies a wide # variety of pre-POSIX systems that do not have POSIX shells at all, and # even some reasonably current systems (Solaris 10 as case-in-point) still # have a pre-POSIX /bin/sh. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2023 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 ;; *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 # Split fields of configuration type # shellcheck disable=SC2162 saved_IFS=$IFS IFS="-" read field1 field2 field3 field4 <&2 exit 1 ;; *-*-*-*) basic_machine=$field1-$field2 basic_os=$field3-$field4 ;; *-*-*) # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two # parts maybe_os=$field2-$field3 case $maybe_os in nto-qnx* | linux-* | uclinux-uclibc* \ | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ | storm-chaos* | os2-emx* | rtmk-nova* | managarm-*) basic_machine=$field1 basic_os=$maybe_os ;; android-linux) basic_machine=$field1-unknown basic_os=linux-android ;; *) basic_machine=$field1-$field2 basic_os=$field3 ;; esac ;; *-*) # A lone config we happen to match not fitting any pattern case $field1-$field2 in decstation-3100) basic_machine=mips-dec basic_os= ;; *-*) # Second component is usually, but not always the OS case $field2 in # Prevent following clause from handling this valid os sun*os*) basic_machine=$field1 basic_os=$field2 ;; zephyr*) basic_machine=$field1-unknown basic_os=$field2 ;; # Manufacturers dec* | mips* | sequent* | encore* | pc533* | 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* | sim | cisco \ | oki | wec | wrs | winbond) basic_machine=$field1-$field2 basic_os= ;; *) basic_machine=$field1 basic_os=$field2 ;; esac ;; esac ;; *) # Convert single-component short-hands not valid as part of # multi-component configurations. case $field1 in 386bsd) basic_machine=i386-pc basic_os=bsd ;; a29khif) basic_machine=a29k-amd basic_os=udi ;; adobe68k) basic_machine=m68010-adobe basic_os=scout ;; alliant) basic_machine=fx80-alliant basic_os= ;; altos | altos3068) basic_machine=m68k-altos basic_os= ;; am29k) basic_machine=a29k-none basic_os=bsd ;; amdahl) basic_machine=580-amdahl basic_os=sysv ;; amiga) basic_machine=m68k-unknown basic_os= ;; amigaos | amigados) basic_machine=m68k-unknown basic_os=amigaos ;; amigaunix | amix) basic_machine=m68k-unknown basic_os=sysv4 ;; apollo68) basic_machine=m68k-apollo basic_os=sysv ;; apollo68bsd) basic_machine=m68k-apollo basic_os=bsd ;; aros) basic_machine=i386-pc basic_os=aros ;; aux) basic_machine=m68k-apple basic_os=aux ;; balance) basic_machine=ns32k-sequent basic_os=dynix ;; blackfin) basic_machine=bfin-unknown basic_os=linux ;; cegcc) basic_machine=arm-unknown basic_os=cegcc ;; convex-c1) basic_machine=c1-convex basic_os=bsd ;; convex-c2) basic_machine=c2-convex basic_os=bsd ;; convex-c32) basic_machine=c32-convex basic_os=bsd ;; convex-c34) basic_machine=c34-convex basic_os=bsd ;; convex-c38) basic_machine=c38-convex basic_os=bsd ;; cray) basic_machine=j90-cray basic_os=unicos ;; crds | unos) basic_machine=m68k-crds basic_os= ;; da30) basic_machine=m68k-da30 basic_os= ;; decstation | pmax | pmin | dec3100 | decstatn) basic_machine=mips-dec basic_os= ;; delta88) basic_machine=m88k-motorola basic_os=sysv3 ;; dicos) basic_machine=i686-pc basic_os=dicos ;; djgpp) basic_machine=i586-pc basic_os=msdosdjgpp ;; ebmon29k) basic_machine=a29k-amd basic_os=ebmon ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson basic_os=ose ;; gmicro) basic_machine=tron-gmicro basic_os=sysv ;; go32) basic_machine=i386-pc basic_os=go32 ;; h8300hms) basic_machine=h8300-hitachi basic_os=hms ;; h8300xray) basic_machine=h8300-hitachi basic_os=xray ;; h8500hms) basic_machine=h8500-hitachi basic_os=hms ;; harris) basic_machine=m88k-harris basic_os=sysv3 ;; hp300 | hp300hpux) basic_machine=m68k-hp basic_os=hpux ;; hp300bsd) basic_machine=m68k-hp basic_os=bsd ;; hppaosf) basic_machine=hppa1.1-hp basic_os=osf ;; hppro) basic_machine=hppa1.1-hp basic_os=proelf ;; i386mach) basic_machine=i386-mach basic_os=mach ;; isi68 | isi) basic_machine=m68k-isi basic_os=sysv ;; m68knommu) basic_machine=m68k-unknown basic_os=linux ;; magnum | m3230) basic_machine=mips-mips basic_os=sysv ;; merlin) basic_machine=ns32k-utek basic_os=sysv ;; mingw64) basic_machine=x86_64-pc basic_os=mingw64 ;; mingw32) basic_machine=i686-pc basic_os=mingw32 ;; mingw32ce) basic_machine=arm-unknown basic_os=mingw32ce ;; monitor) basic_machine=m68k-rom68k basic_os=coff ;; morphos) basic_machine=powerpc-unknown basic_os=morphos ;; moxiebox) basic_machine=moxie-unknown basic_os=moxiebox ;; msdos) basic_machine=i386-pc basic_os=msdos ;; msys) basic_machine=i686-pc basic_os=msys ;; mvs) basic_machine=i370-ibm basic_os=mvs ;; nacl) basic_machine=le32-unknown basic_os=nacl ;; ncr3000) basic_machine=i486-ncr basic_os=sysv4 ;; netbsd386) basic_machine=i386-pc basic_os=netbsd ;; netwinder) basic_machine=armv4l-rebel basic_os=linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony basic_os=newsos ;; news1000) basic_machine=m68030-sony basic_os=newsos ;; necv70) basic_machine=v70-nec basic_os=sysv ;; nh3000) basic_machine=m68k-harris basic_os=cxux ;; nh[45]000) basic_machine=m88k-harris basic_os=cxux ;; nindy960) basic_machine=i960-intel basic_os=nindy ;; mon960) basic_machine=i960-intel basic_os=mon960 ;; nonstopux) basic_machine=mips-compaq basic_os=nonstopux ;; os400) basic_machine=powerpc-ibm basic_os=os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson basic_os=ose ;; os68k) basic_machine=m68k-none basic_os=os68k ;; paragon) basic_machine=i860-intel basic_os=osf ;; parisc) basic_machine=hppa-unknown basic_os=linux ;; psp) basic_machine=mipsallegrexel-sony basic_os=psp ;; pw32) basic_machine=i586-unknown basic_os=pw32 ;; rdos | rdos64) basic_machine=x86_64-pc basic_os=rdos ;; rdos32) basic_machine=i386-pc basic_os=rdos ;; rom68k) basic_machine=m68k-rom68k basic_os=coff ;; sa29200) basic_machine=a29k-amd basic_os=udi ;; sei) basic_machine=mips-sei basic_os=seiux ;; sequent) basic_machine=i386-sequent basic_os= ;; sps7) basic_machine=m68k-bull basic_os=sysv2 ;; st2000) basic_machine=m68k-tandem basic_os= ;; stratus) basic_machine=i860-stratus basic_os=sysv4 ;; sun2) basic_machine=m68000-sun basic_os= ;; sun2os3) basic_machine=m68000-sun basic_os=sunos3 ;; sun2os4) basic_machine=m68000-sun basic_os=sunos4 ;; sun3) basic_machine=m68k-sun basic_os= ;; sun3os3) basic_machine=m68k-sun basic_os=sunos3 ;; sun3os4) basic_machine=m68k-sun basic_os=sunos4 ;; sun4) basic_machine=sparc-sun basic_os= ;; sun4os3) basic_machine=sparc-sun basic_os=sunos3 ;; sun4os4) basic_machine=sparc-sun basic_os=sunos4 ;; sun4sol2) basic_machine=sparc-sun basic_os=solaris2 ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun basic_os= ;; sv1) basic_machine=sv1-cray basic_os=unicos ;; symmetry) basic_machine=i386-sequent basic_os=dynix ;; t3e) basic_machine=alphaev5-cray basic_os=unicos ;; t90) basic_machine=t90-cray basic_os=unicos ;; toad1) basic_machine=pdp10-xkl basic_os=tops20 ;; tpf) basic_machine=s390x-ibm basic_os=tpf ;; udi29k) basic_machine=a29k-amd basic_os=udi ;; ultra3) basic_machine=a29k-nyu basic_os=sym1 ;; v810 | necv810) basic_machine=v810-nec basic_os=none ;; vaxv) basic_machine=vax-dec basic_os=sysv ;; vms) basic_machine=vax-dec basic_os=vms ;; vsta) basic_machine=i386-pc basic_os=vsta ;; vxworks960) basic_machine=i960-wrs basic_os=vxworks ;; vxworks68) basic_machine=m68k-wrs basic_os=vxworks ;; vxworks29k) basic_machine=a29k-wrs basic_os=vxworks ;; xbox) basic_machine=i686-pc basic_os=mingw32 ;; ymp) basic_machine=ymp-cray basic_os=unicos ;; *) basic_machine=$1 basic_os= ;; esac ;; esac # Decode 1-component or ad-hoc basic machines case $basic_machine in # 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) cpu=hppa1.1 vendor=winbond ;; op50n) cpu=hppa1.1 vendor=oki ;; op60c) cpu=hppa1.1 vendor=oki ;; ibm*) cpu=i370 vendor=ibm ;; orion105) cpu=clipper vendor=highlevel ;; mac | mpw | mac-mpw) cpu=m68k vendor=apple ;; pmac | pmac-mpw) cpu=powerpc vendor=apple ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) cpu=m68000 vendor=att ;; 3b*) cpu=we32k vendor=att ;; bluegene*) cpu=powerpc vendor=ibm basic_os=cnk ;; decsystem10* | dec10*) cpu=pdp10 vendor=dec basic_os=tops10 ;; decsystem20* | dec20*) cpu=pdp10 vendor=dec basic_os=tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) cpu=m68k vendor=motorola ;; dpx2*) cpu=m68k vendor=bull basic_os=sysv3 ;; encore | umax | mmax) cpu=ns32k vendor=encore ;; elxsi) cpu=elxsi vendor=elxsi basic_os=${basic_os:-bsd} ;; fx2800) cpu=i860 vendor=alliant ;; genix) cpu=ns32k vendor=ns ;; h3050r* | hiux*) cpu=hppa1.1 vendor=hitachi basic_os=hiuxwe2 ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) cpu=m68000 vendor=hp ;; hp9k3[2-9][0-9]) cpu=m68k vendor=hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) cpu=hppa1.1 vendor=hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp cpu=hppa1.1 vendor=hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp cpu=hppa1.1 vendor=hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) cpu=hppa1.1 vendor=hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; i*86v32) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=sysv32 ;; i*86v4*) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=sysv4 ;; i*86v) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=sysv ;; i*86sol2) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=solaris2 ;; j90 | j90-cray) cpu=j90 vendor=cray basic_os=${basic_os:-unicos} ;; iris | iris4d) cpu=mips vendor=sgi case $basic_os in irix*) ;; *) basic_os=irix4 ;; esac ;; miniframe) cpu=m68000 vendor=convergent ;; *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) cpu=m68k vendor=atari basic_os=mint ;; news-3600 | risc-news) cpu=mips vendor=sony basic_os=newsos ;; next | m*-next) cpu=m68k vendor=next case $basic_os in openstep*) ;; nextstep*) ;; ns2*) basic_os=nextstep2 ;; *) basic_os=nextstep3 ;; esac ;; np1) cpu=np1 vendor=gould ;; op50n-* | op60c-*) cpu=hppa1.1 vendor=oki basic_os=proelf ;; pa-hitachi) cpu=hppa1.1 vendor=hitachi basic_os=hiuxwe2 ;; pbd) cpu=sparc vendor=tti ;; pbb) cpu=m68k vendor=tti ;; pc532) cpu=ns32k vendor=pc532 ;; pn) cpu=pn vendor=gould ;; power) cpu=power vendor=ibm ;; ps2) cpu=i386 vendor=ibm ;; rm[46]00) cpu=mips vendor=siemens ;; rtpc | rtpc-*) cpu=romp vendor=ibm ;; sde) cpu=mipsisa32 vendor=sde basic_os=${basic_os:-elf} ;; simso-wrs) cpu=sparclite vendor=wrs basic_os=vxworks ;; tower | tower-32) cpu=m68k vendor=ncr ;; vpp*|vx|vx-*) cpu=f301 vendor=fujitsu ;; w65) cpu=w65 vendor=wdc ;; w89k-*) cpu=hppa1.1 vendor=winbond basic_os=proelf ;; none) cpu=none vendor=none ;; leon|leon[3-9]) cpu=sparc vendor=$basic_machine ;; leon-*|leon[3-9]-*) cpu=sparc vendor=`echo "$basic_machine" | sed 's/-.*//'` ;; *-*) # shellcheck disable=SC2162 saved_IFS=$IFS IFS="-" read cpu vendor <&2 exit 1 ;; esac ;; esac # Here we canonicalize certain aliases for manufacturers. case $vendor in digital*) vendor=dec ;; commodore*) vendor=cbm ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if test x$basic_os != x then # First recognize some ad-hoc cases, or perhaps split kernel-os, or else just # set os. case $basic_os in gnu/linux*) kernel=linux os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'` ;; os2-emx) kernel=os2 os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'` ;; nto-qnx*) kernel=nto os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'` ;; *-*) # shellcheck disable=SC2162 saved_IFS=$IFS IFS="-" read kernel os <&2 exit 1 ;; esac # As a final step for OS-related things, validate the OS-kernel combination # (given a valid OS), if there is a kernel. case $kernel-$os in linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \ | linux-musl* | linux-relibc* | linux-uclibc* | linux-mlibc* ) ;; uclinux-uclibc* ) ;; managarm-mlibc* | managarm-kernel* ) ;; -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* | -mlibc* ) # These are just libc implementations, not actual OSes, and thus # require a kernel. echo "Invalid configuration '$1': libc '$os' needs explicit kernel." 1>&2 exit 1 ;; -kernel* ) echo "Invalid configuration '$1': '$os' needs explicit kernel." 1>&2 exit 1 ;; *-kernel* ) echo "Invalid configuration '$1': '$kernel' does not support '$os'." 1>&2 exit 1 ;; kfreebsd*-gnu* | kopensolaris*-gnu*) ;; vxworks-simlinux | vxworks-simwindows | vxworks-spe) ;; nto-qnx*) ;; os2-emx) ;; *-eabi* | *-gnueabi*) ;; -*) # Blank kernel with real OS is always fine. ;; *-*) echo "Invalid configuration '$1': Kernel '$kernel' not known to work with OS '$os'." 1>&2 exit 1 ;; esac # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. case $vendor in unknown) case $cpu-$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 ;; *-clix*) vendor=intergraph ;; *-mvs* | *-opened*) vendor=ibm ;; *-os400*) vendor=ibm ;; s390-* | s390x-*) 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 ;; esac echo "$cpu-$vendor-${kernel:+$kernel-}$os" exit # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: audit-4.0.2/Makefile.am0000644001034500103450000000244314655201403010343 # Makefile.am -- # Copyright 2004-08,2015-16 Red Hat Inc. # All Rights Reserved. # # 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; see the file COPYING. If not, write to the # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor # Boston, MA 02110-1335, USA. # # Authors: # Steve Grubb # Rickard E. (Rik) Faith # SUBDIRS = common lib auparse audisp src/libev src tools bindings init.d \ m4 docs rules EXTRA_DIST = ChangeLog AUTHORS NEWS README.md INSTALL \ audit.spec COPYING COPYING.LIB \ contrib/avc_snap contrib/plugin/Makefile \ contrib/plugin/audisp-example.c \ contrib/plugin/audisp-example.conf CONFIG_CLEAN_FILES = debug*.list config/* clean-generic: rm -rf autom4te*.cache rm -f *.rej *.orig *.lang audit-4.0.2/COPYING.LIB0000644001034500103450000006365614655201403007764 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, 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 and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. ^L Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. ^L GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, 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 library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete 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 distribute a copy of this License along with the Library. 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 Library or any portion of it, thus forming a work based on the Library, 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) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, 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 Library, 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 Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. ^L Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you 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. If distribution of 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 satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. ^L 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be 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. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. ^L 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library 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. 9. 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 Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library 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 with this License. ^L 11. 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 Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library 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 Library. 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. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library 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. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser 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 Library 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 Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. ^L 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, 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 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "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 LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. 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 LIBRARY 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 LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS ^L How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! audit-4.0.2/TODO0000644001034500103450000000125314655201403006775 Future roadmap (subject to change): =================================== 4.0.x * In auditd, look into non-blocking handling of write to plugins * Basic HIDS based on reactive audit component * Multi-thread audisp-remote * Support multiple time streams when searching * If searching user/group doesn't map to uid/gid, do translated string search 4.1 * Support TLS PSK as remote logging transport * audisp-remote, add config to say what home network is so laptops don't try if their not on a network that can reach the server. * Change ausearch to output name="" unless its a real null. (mount) ausearch-report.c, 523. FIXME Someday... * Container support * Rewrite swig based python audit-4.0.2/src/0000755001034500103450000000000014655201457007164 5audit-4.0.2/src/ausearch-lol.c0000644001034500103450000002452314655201403011624 /* * ausearch-lol.c - linked list of linked lists library * Copyright (c) 2008,2010,2014,2016,2019,2021 Red Hat Inc. * All Rights Reserved. * * This software may be freely redistributed and/or modified 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, Inc., 51 Franklin Street, Fifth Floor * Boston, MA 02110-1335, USA. * * Authors: * Steve Grubb */ #include "ausearch-lol.h" #include #include #include #include #include #include "ausearch-common.h" #include "auditd-config.h" #include "common.h" #define ARRAY_LIMIT 80 static int ready = 0; event very_first_event; // End of Event timeout value (in seconds). This can be over-riden via configuration or command line argument. static time_t eoe_timeout = EOE_TIMEOUT; void lol_create(lol *lo) { int size = ARRAY_LIMIT * sizeof(lolnode); lo->maxi = -1; lo->limit = ARRAY_LIMIT; lo->array = (lolnode *)malloc(size); if (lo->array == NULL) { fprintf(stderr, "Out of memory. Check %s file, %d line", __FILE__, __LINE__); lo->limit = 0; return; } memset(lo->array, 0, size); } void lol_clear(lol *lo) { int i; for (i=0; i<=lo->maxi; i++) { if (lo->array[i].status) { list_clear(lo->array[i].l); free(lo->array[i].l); } } free(lo->array); lo->array = NULL; lo->maxi = -1; } static void lol_append(lol *lo, llist *l) { int i; size_t new_size; lolnode *ptr; for(i=0; ilimit; i++) { lolnode *cur = &lo->array[i]; if (cur->status == L_EMPTY) { cur->l = l; cur->status = L_BUILDING; if (i > lo->maxi) lo->maxi = i; return; } } // Overran the array...lets make it bigger new_size = sizeof(lolnode) * (lo->limit + ARRAY_LIMIT); ptr = realloc(lo->array, new_size); if (ptr) { lo->array = ptr; memset(&lo->array[lo->limit], 0, sizeof(lolnode) * ARRAY_LIMIT); lo->array[i].l = l; lo->array[i].status = L_BUILDING; lo->maxi = i; lo->limit += ARRAY_LIMIT; } } static int str2event(char *s, event *e) { char *ptr; errno = 0; e->sec = strtoul(s, NULL, 10); if (errno || e->sec > (LONG_MAX - eoe_timeout -1)) return -1; ptr = strchr(s, '.'); if (ptr) { ptr++; e->milli = strtoul(ptr, NULL, 10); if (errno || e->milli > 999) return -1; s = ptr; } else e->milli = 0; ptr = strchr(s, ':'); if (ptr) { ptr++; e->serial = strtoul(ptr, NULL, 10); if (errno) return -1; } else e->serial = 0; return 0; } static int inline events_are_equal(event *e1, event *e2) { if (!(e1->serial == e2->serial && e1->milli == e2->milli && e1->sec == e2->sec)) return 0; if (e1->node && e2->node) { if (strcmp(e1->node, e2->node)) return 0; } else if (e1->node || e2->node) return 0; return 1; } // Returns -1 if e1 < e2, 0 if equal, and 1 if e1 > e2 static int compare_event_time(event *e1, event *e2) { if (e1->sec != e2->sec) { if (e1->sec > e2->sec) return 1; return -1; } if (e1->milli != e2->milli) { if (e1->milli > e2->milli) return 1; return -1; } if (e1->serial != e2->serial) { if (e1->serial > e2->serial) return 1; return -1; } return 0; } #ifndef HAVE_STRNDUPA #define strndupa(s, n) \ ({ \ const char *__old = (s); \ size_t __len = strnlen (__old, (n)); \ char *__new = (char *) alloca(__len + 1); \ __new[__len] = '\0'; \ (char *) memcpy (__new, __old, __len); \ }) #endif /* * This function will look at the line and pick out pieces of it. */ static int extract_timestamp(const char *b, event *e) { char *ptr, *tmp, *tnode, *ttype; e->node = NULL; if (*b == 'n') tmp = strndupa(b, 340); else tmp = strndupa(b, 80); ptr = audit_strsplit(tmp); if (ptr) { // Check to see if this is the node info if (*ptr == 'n') { tnode = ptr+5; ptr = audit_strsplit(NULL); } else tnode = NULL; // at this point we have type= ttype = ptr+5; // Now should be pointing to msg= ptr = audit_strsplit(NULL); // strlen is for fuzzers that make invalid lines if (ptr && strnlen(ptr, 20) > 18) { if (*(ptr+9) == '(') ptr+=9; else ptr = strchr(ptr, '('); if (ptr) { // now we should be pointed at the timestamp char *eptr; ptr++; eptr = strchr(ptr, ')'); if (eptr) *eptr = 0; if (str2event(ptr, e)) { fprintf(stderr, "Error extracting time stamp (%s)\n", ptr); return 0; } else if ((start_time && e->sec < start_time) || (end_time && e->sec > end_time)) { if (very_first_event.sec == 0) { very_first_event.sec = e->sec; very_first_event.milli = e->milli; } return 0; } else { // If no start time, any event is 1st if (very_first_event.sec == 0 && start_time == 0) { very_first_event.sec = e->sec; very_first_event.milli = e->milli; } if (tnode) e->node = strdup(tnode); e->type = audit_name_to_msg_type(ttype); } return 1; } // else we have a bad line } // else we have a bad line } // else we have a bad line return 0; } // This function will check events to see if they are complete // FIXME: Can we think of other ways to determine if the event is done? static void check_events(lol *lo, time_t sec) { int i; for(i=0;i<=lo->maxi; i++) { lolnode *cur = &lo->array[i]; if (cur->status == L_BUILDING) { // If eoe_timeout seconds have elapsed, we are done if (cur->l->e.sec + eoe_timeout <= sec) { cur->status = L_COMPLETE; ready++; } else if (audit_is_last_record(cur->l->e.type)) { // If known to be 1 record event, we are done cur->status = L_COMPLETE; ready++; } } } } // This function will check events to see if they are complete but not compare against a given time static void check_events_without_time(lol *lo) { int i; for(i=0;i<=lo->maxi; i++) { lolnode *cur = &lo->array[i]; if (cur->status == L_BUILDING) { /* We now iterate over the event's records but without affecting the node's current * pointer (cur->l->cur). That is, we don't call the list-* routines * We could jump to the last record in the list which is normally a PROCTITLE, but this * may not be guaranteed, so we check all record types */ lnode *ln = cur->l->head; while (ln) { if (audit_is_last_record(ln->type)) { cur->status = L_COMPLETE; ready++; break; } ln = ln->next; } } } } // This function adds a new record to an existing linked list // or creates a new one if its a new event int lol_add_record(lol *lo, char *buff) { int i, fmt; lnode n; event e; char *ptr; llist *l; // Short circuit if event is not of interest if (extract_timestamp(buff, &e) == 0) return 0; n.a0 = 0L; n.a1 = 0L; n.type = e.type; n.message = strdup(buff); if(n.message == NULL) { free((char *)e.node); fprintf(stderr, "Out of memory. Check %s file, %d line", __FILE__, __LINE__); return 0; } ptr = strchr(n.message, AUDIT_INTERP_SEPARATOR); if (ptr) { n.mlen = ptr - n.message; if (n.mlen > MAX_AUDIT_MESSAGE_LENGTH) n.mlen = MAX_AUDIT_MESSAGE_LENGTH; *ptr = 0; n.interp = ptr + 1; // since we are most of the way down the string, scan from there ptr = strrchr(n.interp, 0x0a); if (ptr) { *ptr = 0; n.tlen = ptr - n.message; if (n.tlen > MAX_AUDIT_MESSAGE_LENGTH) n.tlen = MAX_AUDIT_MESSAGE_LENGTH; } else n.tlen = n.mlen; fmt = LF_ENRICHED; } else { ptr = strrchr(n.message, 0x0a); if (ptr) { *ptr = 0; n.mlen = ptr - n.message; if (n.mlen > MAX_AUDIT_MESSAGE_LENGTH) n.mlen = MAX_AUDIT_MESSAGE_LENGTH; } else n.mlen = strlen(n.message); n.interp = NULL; n.tlen = n.mlen; fmt = LF_RAW; } // Now see where this belongs for (i=0; i<=lo->maxi; i++) { if (lo->array[i].status == L_BUILDING) { l = lo->array[i].l; if (events_are_equal(&l->e, &e)) { free((char *)e.node); list_append(l, &n); if (fmt > l->fmt) l->fmt = fmt; return 1; } } } // Eat standalone EOE, main event was already marked complete if (e.type == AUDIT_EOE) { free((char *)e.node); free(n.message); return 0; } // Create new event and fill it in l = malloc(sizeof(llist)); if (l == NULL) { free((char *)e.node); free(n.message); fprintf(stderr, "Out of memory. Check %s file, %d line", __FILE__, __LINE__); return 0; } list_create(l); l->e.milli = e.milli; l->e.sec = e.sec; l->e.serial = e.serial; l->e.node = e.node; l->e.type = e.type; l->fmt = fmt; list_append(l, &n); lol_append(lo, l); check_events(lo, e.sec); return 1; } // This function will mark all events as "done" void terminate_all_events(lol *lo) { int i; for (i=0; i<=lo->maxi; i++) { lolnode *cur = &lo->array[i]; if (cur->status == L_BUILDING) { cur->status = L_COMPLETE; ready++; } } } // This function will mark all events as complete if it can. void complete_all_events(lol *lo) { check_events_without_time(lo); } /* Search the list for any event that is ready to go. The caller * takes custody of the memory */ llist* get_ready_event(lol *lo) { int i; lolnode *lowest = NULL; if (ready == 0) return NULL; for (i=0; i<=lo->maxi; i++) { // Look for the event with the lowest time stamp lolnode *cur = &lo->array[i]; if (cur->status == L_EMPTY) continue; if (lowest == NULL) lowest = cur; else if (compare_event_time(&(lowest->l->e), &(cur->l->e)) == 1) lowest = cur; } if (lowest && lowest->status == L_COMPLETE) { lowest->status = L_EMPTY; ready--; // Try to consolidate the array so that we iterate // over a smaller portion next time if (lowest == &lo->array[lo->maxi]) { lolnode *ptr = lowest; while (ptr->status == L_EMPTY && lo->maxi > 0) { lo->maxi--; ptr = &lo->array[lo->maxi]; } } return lowest->l; } return NULL; } /* * lol_set_eoe_timeout - set the end of event timeout to given value * * Args * new_eoe_tmo - value * Rtn * void */ void lol_set_eoe_timeout(time_t new_eoe_tmo) { eoe_timeout = new_eoe_tmo; } time_t lol_get_eoe_timeout(void) { return eoe_timeout; } audit-4.0.2/src/ausearch-nvpair.h0000644001034500103450000000341214655201403012334 /* * ausearch-nvpair.h - Header file for ausearch-nvpair.c * Copyright (c) 2006-08 Red Hat Inc. * All Rights Reserved. * * This software may be freely redistributed and/or modified 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, Inc., 51 Franklin Street, Fifth Floor * Boston, MA 02110-1335, USA. * * Authors: * Steve Grubb */ #ifndef AUNVPAIR_HEADER #define AUNVPAIR_HEADER #include "config.h" #include /* This is the node of the linked list. message & item are the only elements * at this time. Any data elements that are per item goes here. */ typedef struct _nvnode{ char *name; // The name string long val; // The value field struct _nvnode* next; // Next nvpair node pointer } nvnode; /* This is the linked list head. Only data elements that are 1 per * event goes here. */ typedef struct { nvnode *head; // List head nvnode *cur; // Pointer to current node unsigned int cnt; // How many items in this list } nvlist; void search_list_create(nvlist *l); static inline nvnode *search_list_get_cur(nvlist *l) { return l->cur; } int search_list_append(nvlist *l, nvnode *node); void search_list_clear(nvlist* l); /* Given a numeric index, find that record. */ int search_list_find_val(nvlist *l, long val); #endif audit-4.0.2/src/auditd-sendmail.c0000644001034500103450000000562214655201403012310 /* auditd-sendmail.c -- * Copyright 2005 Red Hat Inc., Durham, North Carolina. * All Rights Reserved. * * 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 * * Authors: * Steve Grubb * */ #include "config.h" #include #include // for access() #include #include #include #include "libaudit.h" #include "private.h" #include "auditd-config.h" extern const char *email_command; static int safe_popen(pid_t *pid, const char *mail_acct); // returns 1 on error & 0 if OK int sendmail(const char *subject, const char *content, const char *mail_acct) { pid_t pid; if (access(email_command, 01) == 0) { FILE *mail; int fd; fd = safe_popen(&pid, mail_acct); if (fd < 0) return 1; mail = fdopen(fd, "w"); if (mail == NULL) { kill(pid, SIGKILL); close(fd); audit_msg(LOG_ERR, "Error - starting mail"); return 1; } fprintf(mail, "To: %s\n", mail_acct); fprintf(mail, "From: root\n"); // fprintf(mail, "X-Sender: %s\n", mail_acct); fprintf(mail, "Subject: %s\n\n", subject); // End of Header fprintf(mail, "%s\n", content); fprintf(mail, ".\n\n"); // Close it up... fclose(mail); return 0; } else audit_msg(LOG_ERR, "Error - %s isn't executable", email_command); return 1; } static int safe_popen(pid_t *pid, const char *mail_acct) { char *argv[4]; char acct[256]; int pipe_fd[2]; struct sigaction sa; if (pipe(pipe_fd)) { audit_msg(LOG_ALERT, "Audit daemon failed to create pipe while sending email alert"); return -1; } *pid = fork(); if (*pid < 0) { close(pipe_fd[0]); close(pipe_fd[1]); audit_msg(LOG_ALERT, "Audit daemon failed to fork while sending email alert"); return -1; } if (*pid) { /* Parent */ close(pipe_fd[0]); // adjust pipe return pipe_fd[1]; } /* Child */ sigfillset (&sa.sa_mask); sigprocmask (SIG_UNBLOCK, &sa.sa_mask, 0); close(pipe_fd[1]); // adjust pipe dup2(pipe_fd[0], 0); /* Make email acct param */ snprintf(acct, sizeof(acct), "-f%s", mail_acct); /* Stuff arg list */ argv[0] = (char *)email_command; argv[1] = (char *)"-t"; argv[2] = acct; argv[3] = NULL; execve(email_command, argv, NULL); audit_msg(LOG_ALERT, "Audit daemon failed to exec %s", email_command); exit(1); } audit-4.0.2/src/auditctl.c0000644001034500103450000011760214655201403011057 /* auditctl.c -- * Copyright 2004-2017,20-23 Red Hat Inc. * All Rights Reserved. * * 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 * * Authors: * Steve Grubb * Rickard E. (Rik) Faith * Richard Guy Briggs */ #include "config.h" #include #include #include #include /* strdup needs xopen define */ #include #include #include #include #include #include #include #include #include #include #include /* For basename */ #include /* PATH_MAX */ #include #include // SYS_pidfd_open #include #include "libaudit.h" #include "auditctl-listing.h" #include "private.h" #include "common.h" /* This define controls the size of the line that we will request when * reading in rules from a file. */ #define LINE_SIZE 6144 /* Global functions */ static int handle_request(int status); static void get_reply(void); extern int delete_all_rules(int fd); /* Global vars */ int list_requested = 0, interpret = 0; char key[AUDIT_MAX_KEY_LEN+1]; const char key_sep[2] = { AUDIT_KEY_SEPARATOR, 0 }; static unsigned int keylen; static int fd = -1; static int add = AUDIT_FILTER_UNSET, del = AUDIT_FILTER_UNSET, action = -1; static int ignore = 0, continue_error = 0; static int exclude = 0; static int multiple = 0; static struct audit_rule_data *rule_new = NULL; /* * This function will reset everything used for each loop when loading * a ruleset from a file. */ static int reset_vars(void) { list_requested = 0; _audit_syscalladded = 0; _audit_permadded = 0; _audit_archadded = 0; _audit_exeadded = 0; _audit_filterfsadded = 0; _audit_elf = 0; add = AUDIT_FILTER_UNSET; del = AUDIT_FILTER_UNSET; action = -1; exclude = 0; multiple = 0; audit_rule_free_data(rule_new); rule_new = audit_rule_create_data(); if (fd < 0) { if ((fd = audit_open()) < 0) { audit_msg(LOG_ERR, "Cannot open netlink audit socket"); return 1; } } return 0; } static void usage(void) { printf( "usage: auditctl [options]\n" " -a Append rule to end of ist with ction\n" " -A Add rule at beginning of ist with ction\n" " -b Set max number of outstanding audit buffers\n" " allowed Default=64\n" " -c Continue through errors in rules\n" " -C f=f Compare collected fields if available:\n" " Field name, operator(=,!=), field name\n" " -d Delete rule from ist with ction\n" " l=task,exit,user,exclude,filesystem\n" " a=never,always\n" " -D Delete all rules and watches\n" " -e [0..2] Set enabled flag\n" " -f [0..2] Set failure flag\n" " 0=silent 1=printk 2=panic\n" " -F f=v Build rule: field name, operator(=,!=,<,>,<=,\n" " >=,&,&=) value\n" " -h Help\n" " -i Ignore errors when reading rules from file\n" " -k Set filter key on audit rule\n" " -l List rules\n" " -m text Send a user-space message\n" " -p [r|w|x|a] Set permissions filter on watch\n" " r=read, w=write, x=execute, a=attribute\n" " -q make subtree part of mount point's dir watches\n" " -r Set limit in messages/sec (0=none)\n" " -R read rules from file\n" " -s Report status\n" " -S syscall Build rule: syscall name or number\n" " --signal Send the specified signal to the daemon\n" " -t Trim directory watches\n" " -v Version\n" " -w Insert watch at \n" " -W Remove watch at \n" #if HAVE_DECL_AUDIT_FEATURE_VERSION == 1 " --loginuid-immutable Make loginuids unchangeable once set\n" #endif #if HAVE_DECL_AUDIT_VERSION_BACKLOG_WAIT_TIME == 1 || \ HAVE_DECL_AUDIT_STATUS_BACKLOG_WAIT_TIME == 1 " --backlog_wait_time Set the kernel backlog_wait_time\n" #endif #if defined(HAVE_STRUCT_AUDIT_STATUS_FEATURE_BITMAP) " --reset-lost Reset the lost record counter\n" #endif #if HAVE_DECL_AUDIT_STATUS_BACKLOG_WAIT_TIME_ACTUAL == 1 " --reset_backlog_wait_time_actual Reset the actual backlog wait time counter\n" #endif ); } static int lookup_filter(const char *str, int *filter) { *filter = audit_name_to_flag(str); if (*filter == AUDIT_FILTER_EXCLUDE) exclude = 1; if (*filter == -1) return 2; return 0; } static int lookup_action(const char *str, int *act) { if (strcmp(str, "always") == 0) *act = AUDIT_ALWAYS; else if (strcmp(str, "never") == 0) *act = AUDIT_NEVER; else if (strcmp(str, "possible") == 0) return 1; else return 2; return 0; } /* * Returns 0 ok, 1 deprecated action, 2 rule error, * 3 multiple rule insert/delete */ static int audit_rule_setup(char *opt, int *filter, int *act) { int rc; char *p; if (++multiple != 1) return 3; p = strchr(opt, ','); if (p == NULL || strchr(p+1, ',')) return 2; *p = 0; /* Try opt both ways */ if (lookup_action(opt, act) == 2) { rc = lookup_filter(opt, filter); if (rc != 0) { *p = ','; return rc; } } /* Repair the string */ *p = ','; opt = p+1; /* If flags are empty, p+1 must be the filter */ if (*filter == AUDIT_FILTER_UNSET) lookup_filter(opt, filter); else { rc = lookup_action(opt, act); if (rc != 0) return rc; } /* Make sure we set both */ if (*filter == AUDIT_FILTER_UNSET || *act == -1) return 2; return 0; } /* * This function will check the path before accepting it. It returns * 1 on error and 0 on success. */ static int check_path(const char *path) { char *ptr, *base; size_t nlen; size_t plen = strlen(path); if (plen >= PATH_MAX) { audit_msg(LOG_ERR, "The path passed for the watch is too big"); return 1; } if (path[0] != '/') { audit_msg(LOG_ERR, "The path must start with '/'"); return 1; } ptr = strdup(path); base = basename(ptr); nlen = strlen(base); free(ptr); if (nlen > NAME_MAX) { audit_msg(LOG_ERR, "The base name of the path is too big"); return 1; } /* These are warnings, not errors */ if (strstr(path, "..")) audit_msg(LOG_WARNING, "Warning - relative path notation is not supported"); if (strchr(path, '*') || strchr(path, '?')) audit_msg(LOG_WARNING, "Warning - wildcard notation is not supported"); return 0; } /* * Setup a watch. The "name" of the watch in userspace will be the to * the watch. When this potential watch reaches the kernel, it will resolve * down to (of terminating file or directory). * Returns a 1 on success & -1 on failure. */ static int audit_setup_watch_name(struct audit_rule_data **rulep, char *path) { int type = AUDIT_WATCH; size_t len; struct stat buf; if (check_path(path)) return -1; // Trim trailing '/' should they exist len = strlen(path); if (len > 2 && path[len-1] == '/') { while (path[len-1] == '/' && len > 1) { path[len-1] = 0; len--; } } if (stat(path, &buf) == 0) { if (S_ISDIR(buf.st_mode)) type = AUDIT_DIR; } /* FIXME: might want to check to see that rule is empty */ if (audit_add_watch_dir(type, rulep, path)) return -1; if (add != AUDIT_FILTER_UNSET) audit_msg(LOG_INFO, "Old style watch rules are slower"); return 1; } /* * Setup a watch permissions. * Returns a 1 on success & -1 on failure. */ static int audit_setup_perms(const char *opt) { unsigned int i, len, val = 0; len = strlen(opt); if (len > 4) { audit_msg(LOG_ERR, "permission %s is too long", opt); return -1; } for (i = 0; i < len; i++) { switch (tolower(opt[i])) { case 'r': val |= AUDIT_PERM_READ; break; case 'w': val |= AUDIT_PERM_WRITE; break; case 'x': val |= AUDIT_PERM_EXEC; break; case 'a': val |= AUDIT_PERM_ATTR; break; default: audit_msg(LOG_ERR, "Permission %c isn't supported", opt[i]); return -1; } } if (audit_update_watch_perms(rule_new, val) == 0) { _audit_permadded = 1; return 1; } return -1; } static int equiv_parse(char *optarg, char **mp, char **sub) { char *ptr = strchr(optarg, ','); if (ptr == NULL) return -1; // no comma *ptr = 0; ptr++; if (*ptr == 0) return -1; // ends with comma *mp = optarg; *sub = ptr; if (strchr(*sub, ',')) return -1; // too many commas return 0; } static int audit_request_rule_list(void) { if (audit_request_rules_list_data(fd) > 0) { list_requested = 1; get_reply(); return 1; } return 0; } static int check_rule_mismatch(int lineno, const char *option) { struct audit_rule_data tmprule; unsigned int old_audit_elf = _audit_elf; int rc = 0; switch (_audit_elf) { case AUDIT_ARCH_X86_64: _audit_elf = AUDIT_ARCH_I386; break; case AUDIT_ARCH_PPC64: _audit_elf = AUDIT_ARCH_PPC; break; case AUDIT_ARCH_S390X: _audit_elf = AUDIT_ARCH_S390; break; } char *ptr, *saved, *tmp = strdup(option); if (tmp == NULL) return -1; ptr = strtok_r(tmp, ",", &saved); memset(&tmprule, 0, sizeof(struct audit_rule_data)); while (ptr) { audit_rule_syscallbyname_data(&tmprule, ptr); ptr = strtok_r(NULL, ",", &saved); } if (memcmp(tmprule.mask, rule_new->mask, AUDIT_BITMASK_SIZE * sizeof(tmprule.mask[0]))) rc = 1; free(tmp); _audit_elf = old_audit_elf; if (rc) { if (lineno) audit_msg(LOG_WARNING, "WARNING - 32/64 bit syscall mismatch in line %d, you should specify an arch", lineno); else audit_msg(LOG_WARNING, "WARNING - 32/64 bit syscall mismatch, you should specify an arch"); } return 0; } #ifdef SYS_pidfd_open static int pidfd_open(int pid, unsigned int flags) { return syscall(SYS_pidfd_open, pid, flags); } static int pidfd_send_signal(int pidfd, int sig, siginfo_t *info, unsigned int flags) { return syscall(SYS_pidfd_send_signal, pidfd, sig, info, flags); } // This function uses the new pidfd_ family of functions to send // the signal to auditd. If the signal is SIGTERM, it waits for auditd // to exit before returning. This is to prevent old and new daemons // from stepping on each other since auditd shutsdown slowly. static int sure_kill(int pid, int signal) { int rc = 0; int pidfd = pidfd_open(pid, 0); if (pidfd < 0) return -1; if (pidfd_send_signal(pidfd, signal, NULL, 0) < 0) { rc = -1; goto out; } if (signal == SIGTERM) { struct pollfd pollfd; pollfd.fd = pidfd; pollfd.events = POLLIN; int ready = poll(&pollfd, 1, -1); if (ready == -1) { perror("poll"); rc = -1; goto out; } // Check if it exited or errored if (!(pollfd.revents & POLLIN)) rc = -1; } out: close(pidfd); return rc; } #endif static int send_signal(const char *optarg) { int signal = 0, retval, i; int timeout = 40; /* loop has delay of .1 - so this is 4 seconds */ struct audit_reply rep; fd_set read_mask; FD_ZERO(&read_mask); FD_SET(fd, &read_mask); if (strcasecmp(optarg, "TERM") == 0 || strcasecmp(optarg, "stop") == 0) signal = SIGTERM; else if (strcasecmp(optarg, "HUP") == 0 || strcasecmp(optarg, "reload") == 0) signal = SIGHUP; else if (strcasecmp(optarg, "USR1") == 0 || strcasecmp(optarg, "rotate") == 0) signal = SIGUSR1; else if (strcasecmp(optarg, "USR2") == 0 || strcasecmp(optarg, "resume") == 0) signal = SIGUSR2; else if (strcasecmp(optarg, "CONT") == 0 || strcasecmp(optarg, "state") == 0) signal = SIGCONT; if (signal == 0) { audit_msg(LOG_ERR, "%s is an unsupported signal", optarg); exit(1); } // Request status so that we can find the pid retval = audit_request_status(fd); if (retval == -1) { if (errno == ECONNREFUSED) audit_msg(LOG_INFO, "The audit system is disabled"); exit(1); } // Receive the netlink info for (i = 0; i < timeout; i++) { struct timeval t; t.tv_sec = 0; t.tv_usec = 100000; /* .1 second */ do { retval = select(fd+1, &read_mask, NULL, NULL, &t); } while (retval < 0 && errno == EINTR); // We'll try to read just in case retval = audit_get_reply(fd, &rep, GET_REPLY_NONBLOCKING, 0); if (retval > 0) { if (rep.type == NLMSG_ERROR && rep.error->error == 0) { i = 0; /* reset timeout */ continue; /* This was an ack */ } if (rep.type == NLMSG_NOOP) { i = 0; /* If getting more, reset timeout */ continue; } else if (rep.type == NLMSG_DONE) break; else if (rep.type == AUDIT_GET) { if (rep.status->pid == 0) { audit_msg(LOG_INFO, "Auditd is not running"); exit(2); } #ifdef SYS_pidfd_open retval = sure_kill(rep.status->pid, signal); #else retval = kill(rep.status->pid, signal); #endif if (retval < 0) { audit_msg(LOG_WARNING, "Failed sending signal to auditd (%s)", strerror(errno)); exit(1); } else return -2; } } } audit_msg(LOG_WARNING, "Failed sending signal to auditd (timeout)"); exit(1); } static int report_status(void) { int retval; retval = audit_request_status(fd); if (retval == -1) { if (errno == ECONNREFUSED) fprintf(stderr, "The audit system is disabled\n"); return -1; } get_reply(); retval = audit_request_features(fd); if (retval == -1) { // errno is EINVAL if the kernel does support features API if (errno == EINVAL) return -2; return -1; } get_reply(); return -2; } #ifdef WITH_IO_URING // return 0 on success and -1 if unknown op. static int parse_io_uring(const char *optarg) { if (strchr(optarg, ',')) { int retval = -1; char *saved, *ptr, *tmp = strdup(optarg); if (tmp == NULL) return retval; ptr = strtok_r(tmp, ",", &saved); while (ptr) { retval = audit_rule_io_uringbyname_data(rule_new, ptr); if (retval != 0) break; ptr = strtok_r(NULL, ",", &saved); } free(tmp); return retval; } return audit_rule_io_uringbyname_data(rule_new, optarg); } #endif static const struct option long_opts[] = { #if HAVE_DECL_AUDIT_FEATURE_VERSION == 1 {"loginuid-immutable", 0, NULL, 1}, #endif #if HAVE_DECL_AUDIT_VERSION_BACKLOG_WAIT_TIME == 1 || \ HAVE_DECL_AUDIT_STATUS_BACKLOG_WAIT_TIME == 1 {"backlog_wait_time", 1, NULL, 2}, #endif #if defined(HAVE_STRUCT_AUDIT_STATUS_FEATURE_BITMAP) {"reset-lost", 0, NULL, 3}, #endif #if HAVE_DECL_AUDIT_STATUS_BACKLOG_WAIT_TIME_ACTUAL == 1 {"reset_backlog_wait_time_actual", 0, NULL, 4}, #endif {"signal", 1, NULL, 5}, {NULL, 0, NULL, 0} }; // FIXME: Change these to enums /* * returns: -3 deprecated, -2 success - no reply, -1 error - noreply, * 0 success - reply, > 0 success - rule */ static int setopt(int count, int lineno, char *vars[]) { int c, lidx = 0; int retval = 0, rc; optind = 0; opterr = 0; key[0] = 0; keylen = AUDIT_MAX_KEY_LEN; while ((retval >= 0) && (c = getopt_long(count, vars, "hicslDvtC:e:f:r:b:a:A:d:S:F:m:R:w:W:k:p:q:", long_opts, &lidx)) != EOF) { int flags = AUDIT_FILTER_UNSET; rc = 10; // Init to something impossible to see if unused. switch (c) { case 'h': usage(); retval = -1; break; case 'i': ignore = 1; retval = -2; break; case 'c': ignore = 1; continue_error = 1; retval = -2; break; case 's': if (count > 3) { audit_msg(LOG_ERR, "Too many options for status command"); retval = -1; break; } else if (optind == 2 && count == 3) { if (strcmp(vars[optind], "-i") == 0) { interpret = 1; count -= 1; } else { audit_msg(LOG_ERR, "Only -i option is allowed"); retval = -1; break; } } retval = report_status(); break; case 'e': if (optarg && ((strcmp(optarg, "0") == 0) || (strcmp(optarg, "1") == 0) || (strcmp(optarg, "2") == 0))) { if (audit_set_enabled(fd, strtoul(optarg,NULL,0)) > 0) audit_request_status(fd); else retval = -1; } else { audit_msg(LOG_ERR, "Enable must be 0, 1, or 2 was %s", optarg); retval = -1; } break; case 'f': if (optarg && ((strcmp(optarg, "0") == 0) || (strcmp(optarg, "1") == 0) || (strcmp(optarg, "2") == 0))) { if (audit_set_failure(fd, strtoul(optarg,NULL,0)) > 0) audit_request_status(fd); else return -1; } else { audit_msg(LOG_ERR, "Failure must be 0, 1, or 2 was %s", optarg); retval = -1; } break; case 'r': if (optarg && isdigit((unsigned char)optarg[0])) { uint32_t rate; errno = 0; rate = strtoul(optarg,NULL,0); if (errno) { audit_msg(LOG_ERR, "Error converting rate"); return -1; } if (audit_set_rate_limit(fd, rate) > 0) audit_request_status(fd); else return -1; } else { audit_msg(LOG_ERR,"Rate must be a numeric value was %s", optarg); retval = -1; } break; case 'b': if (optarg && isdigit((unsigned char)optarg[0])) { uint32_t limit; errno = 0; limit = strtoul(optarg,NULL,0); if (errno) { audit_msg(LOG_ERR, "Error converting backlog"); return -1; } if (audit_set_backlog_limit(fd, limit) > 0) audit_request_status(fd); else return -1; } else { audit_msg(LOG_ERR, "Backlog must be a numeric value was %s", optarg); retval = -1; } break; case 'l': if (count > 4) { audit_msg(LOG_ERR, "Wrong number of options for list request"); retval = -1; break; } if (count == 3) { if (strcmp(vars[optind], "-i") == 0) { interpret = 1; count -= 1; } else { audit_msg(LOG_ERR, "Only -k or -i options are allowed"); retval = -1; break; } } else if (count == 4) { if (vars[optind] && strcmp(vars[optind], "-k") == 0) { strncat(key, vars[3], keylen); count -= 2; } else { audit_msg(LOG_ERR, "Only -k or -i options are allowed"); retval = -1; break; } } if (audit_request_rule_list()) { list_requested = 1; retval = -2; } else retval = -1; break; case 'a': if (strstr(optarg, "task") && _audit_syscalladded) { audit_msg(LOG_ERR, "Syscall auditing requested for task list"); retval = -1; } else { rc = audit_rule_setup(optarg, &add, &action); if (rc == 3) { audit_msg(LOG_ERR, "Multiple rule insert/delete operations are not allowed\n"); retval = -1; } else if (rc == 2) { audit_msg(LOG_ERR, "Append rule - bad keyword %s", optarg); retval = -1; } else if (rc == 1) { audit_msg(LOG_ERR, "Append rule - possible is deprecated"); return -3; /* deprecated - eat it */ } else retval = 1; /* success - please send */ } break; case 'A': if (strstr(optarg, "task") && _audit_syscalladded) { audit_msg(LOG_ERR, "Error: syscall auditing requested for task list"); retval = -1; } else { rc = audit_rule_setup(optarg, &add, &action); if (rc == 3) { audit_msg(LOG_ERR, "Multiple rule insert/delete operations are not allowed"); retval = -1; } else if (rc == 2) { audit_msg(LOG_ERR, "Add rule - bad keyword %s", optarg); retval = -1; } else if (rc == 1) { audit_msg(LOG_WARNING, "Append rule - possible is deprecated"); return -3; /* deprecated - eat it */ } else { add |= AUDIT_FILTER_PREPEND; retval = 1; /* success - please send */ } } break; case 'd': rc = audit_rule_setup(optarg, &del, &action); if (rc == 3) { audit_msg(LOG_ERR, "Multiple rule insert/delete operations are not allowed"); retval = -1; } else if (rc == 2) { audit_msg(LOG_ERR, "Delete rule - bad keyword %s", optarg); retval = -1; } else if (rc == 1) { audit_msg(LOG_INFO, "Delete rule - possible is deprecated"); return -3; /* deprecated - eat it */ } else retval = 1; /* success - please send */ break; case 'S': { int unknown_arch = !_audit_elf; #ifdef WITH_IO_URING if (((add & (AUDIT_FILTER_MASK|AUDIT_FILTER_UNSET)) == AUDIT_FILTER_URING_EXIT || (del & (AUDIT_FILTER_MASK|AUDIT_FILTER_UNSET)) == AUDIT_FILTER_URING_EXIT)) { // Do io_uring op rc = parse_io_uring(optarg); switch (rc) { case 0: _audit_syscalladded = 1; retval = 1; /* success - please send */ break; case -1: audit_msg(LOG_ERR, "io_uring op unknown: %s", optarg); retval = -1; break; } break; } #endif /* Do some checking to make sure that we are not adding a * syscall rule to a list that does not make sense. */ if (((add & (AUDIT_FILTER_MASK|AUDIT_FILTER_UNSET)) == AUDIT_FILTER_TASK || (del & (AUDIT_FILTER_MASK|AUDIT_FILTER_UNSET)) == AUDIT_FILTER_TASK)) { audit_msg(LOG_ERR, "Error: syscall auditing being added to task list"); return -1; } else if (((add & (AUDIT_FILTER_MASK|AUDIT_FILTER_UNSET)) == AUDIT_FILTER_USER || (del & (AUDIT_FILTER_MASK|AUDIT_FILTER_UNSET)) == AUDIT_FILTER_USER)) { audit_msg(LOG_ERR, "Error: syscall auditing being added to user list"); return -1; } else if (((add & (AUDIT_FILTER_MASK|AUDIT_FILTER_UNSET)) == AUDIT_FILTER_FS || (del & (AUDIT_FILTER_MASK|AUDIT_FILTER_UNSET)) == AUDIT_FILTER_FS)) { audit_msg(LOG_ERR, "Error: syscall auditing being added to filesystem list"); return -1; } else if (exclude) { audit_msg(LOG_ERR, "Error: syscall auditing cannot be put on exclude list"); return -1; } else { if (unknown_arch) { int machine; unsigned int elf; machine = audit_detect_machine(); if (machine < 0) { audit_msg(LOG_ERR, "Error detecting machine type"); return -1; } elf = audit_machine_to_elf(machine); if (elf == 0) { audit_msg(LOG_ERR, "Error looking up elf type %d", machine); return -1; } _audit_elf = elf; } } rc = _audit_parse_syscall(optarg, rule_new); switch (rc) { case 0: _audit_syscalladded = 1; if (unknown_arch && add != AUDIT_FILTER_UNSET) if (check_rule_mismatch(lineno, optarg) == -1) retval = -1; break; case -1: audit_msg(LOG_ERR, "Syscall name unknown: %s", optarg); retval = -1; break; case -2: audit_msg(LOG_ERR, "Elf type unknown: 0x%x", _audit_elf); retval = -1; break; case -3: // Error reported - do nothing here retval = -1; break; }} break; case 'F': if (add != AUDIT_FILTER_UNSET) flags = add & AUDIT_FILTER_MASK; else if (del != AUDIT_FILTER_UNSET) flags = del & AUDIT_FILTER_MASK; // if the field is arch & there is a -t option...we // can allow it else if ((optind >= count) || (strstr(optarg, "arch=") == NULL) || (strcmp(vars[optind], "-t") != 0)) { audit_msg(LOG_ERR, "List must be given before field"); retval = -1; break; } // Keys need to get handled differently if (strncmp(optarg, "key=", 4) == 0) { optarg += 4; goto process_keys; } rc = audit_rule_fieldpair_data(&rule_new,optarg,flags); if (rc != 0) { audit_number_to_errmsg(rc, optarg); retval = -1; } else { if (rule_new->fields[rule_new->field_count-1] == AUDIT_PERM) _audit_permadded = 1; if (rule_new->fields[rule_new->field_count-1] == AUDIT_EXE) _audit_exeadded = 1; } break; case 'C': if (add != AUDIT_FILTER_UNSET) flags = add & AUDIT_FILTER_MASK; else if (del != AUDIT_FILTER_UNSET) flags = del & AUDIT_FILTER_MASK; rc = audit_rule_interfield_comp_data(&rule_new, optarg, flags); if (rc != 0) { audit_number_to_errmsg(rc, optarg); retval = -1; } else { if (rule_new->fields[rule_new->field_count - 1] == AUDIT_PERM) _audit_permadded = 1; } break; case 'm': if (count > 3) { audit_msg(LOG_ERR, "The -m option must be only the only option and takes 1 parameter"); retval = -1; } else { const char*s = optarg; char *umsg; while (*s) { if (*s < 32) { audit_msg(LOG_ERR, "Illegal character in audit event"); return -1; } s++; } if (asprintf(&umsg, "text=%s", optarg) < 0) { audit_msg(LOG_ERR, "Can't create user event"); return -1; } if (audit_log_user_message( fd, AUDIT_USER, umsg, NULL, NULL, NULL, 1) <= 0) retval = -1; else { free(umsg); return -2; // success - no reply for this } free(umsg); } break; case 'R': audit_msg(LOG_ERR, "Error - nested rule files not supported"); retval = -1; break; case 'D': if (count > 4 || count == 3) { audit_msg(LOG_ERR, "Wrong number of options for Delete all request"); retval = -1; break; } if (count == 4) { if (strcmp(vars[optind], "-k") == 0) { strncat(key, vars[3], keylen); count -= 2; } else { audit_msg(LOG_ERR, "Only the -k option is allowed"); retval = -1; break; } } retval = delete_all_rules(fd); if (retval == 0) { (void)audit_request_rule_list(); key[0] = 0; retval = -2; } break; case 'w': if (add != AUDIT_FILTER_UNSET || del != AUDIT_FILTER_UNSET) { audit_msg(LOG_ERR, "watch option can't be given with a syscall"); retval = -1; } else if (optarg) { add = AUDIT_FILTER_EXIT; action = AUDIT_ALWAYS; _audit_syscalladded = 1; retval = audit_setup_watch_name(&rule_new, optarg); } else { audit_msg(LOG_ERR, "watch option needs a path"); retval = -1; } break; case 'W': if (optarg) { del = AUDIT_FILTER_EXIT; action = AUDIT_ALWAYS; _audit_syscalladded = 1; retval = audit_setup_watch_name(&rule_new, optarg); } else { audit_msg(LOG_ERR, "watch option needs a path"); retval = -1; } break; case 'k': if (!(_audit_syscalladded || _audit_permadded || _audit_exeadded || _audit_filterfsadded) || (add==AUDIT_FILTER_UNSET && del==AUDIT_FILTER_UNSET)) { audit_msg(LOG_ERR, "key option needs a watch or syscall given prior to it"); retval = -1; break; } else if (!optarg) { audit_msg(LOG_ERR, "key option needs a value"); retval = -1; break; } process_keys: if ((strlen(optarg)+strlen(key)+(!!key[0])) > AUDIT_MAX_KEY_LEN) { audit_msg(LOG_ERR, "key option exceeds size limit"); retval = -1; } else { if (strchr(optarg, AUDIT_KEY_SEPARATOR)) audit_msg(LOG_ERR, "key %s has illegal character", optarg); if (key[0]) { // Add the separator if we need to strcat(key, key_sep); keylen--; } strncat(key, optarg, keylen); keylen = AUDIT_MAX_KEY_LEN - strlen(key); } break; case 'p': if (add == AUDIT_FILTER_UNSET && del == AUDIT_FILTER_UNSET) { audit_msg(LOG_ERR, "permission option needs a watch given prior to it"); retval = -1; } else if (!optarg) { audit_msg(LOG_ERR, "permission option needs a filter"); retval = -1; } else retval = audit_setup_perms(optarg); break; case 'q': if (_audit_syscalladded) { audit_msg(LOG_ERR, "Syscall auditing requested for make equivalent"); retval = -1; } else { char *mp, *sub; retval = equiv_parse(optarg, &mp, &sub); if (retval < 0) { audit_msg(LOG_ERR, "Error parsing equivalent parts"); retval = -1; } else { retval = audit_make_equivalent(fd, mp, sub); if (retval <= 0) { retval = -1; } else return -2; // success - no reply needed } } break; case 't': retval = audit_trim_subtrees(fd); if (retval <= 0) retval = -1; else return -2; // success - no reply for this break; case 'v': printf("auditctl version %s\n", VERSION); retval = -2; break; // Now the long options case 1: retval = audit_set_loginuid_immutable(fd); if (retval <= 0) retval = -1; else return -2; // success - no reply for this break; case 2: #if HAVE_DECL_AUDIT_VERSION_BACKLOG_WAIT_TIME == 1 || \ HAVE_DECL_AUDIT_STATUS_BACKLOG_WAIT_TIME == 1 if (optarg && isdigit((unsigned char)optarg[0])) { uint32_t bwt; errno = 0; bwt = strtoul(optarg,NULL,0); if (errno) { audit_msg(LOG_ERR, "Error converting backlog_wait_time"); return -1; } if (audit_set_backlog_wait_time(fd, bwt) > 0) audit_request_status(fd); else return -1; } else { audit_msg(LOG_ERR, "Backlog_wait_time must be a numeric value was %s", optarg); retval = -1; } #else audit_msg(LOG_ERR, "backlog_wait_time is not supported on your kernel"); retval = -1; #endif break; case 3: if ((rc = audit_reset_lost(fd)) >= 0) { audit_msg(LOG_INFO, "lost: %u", rc); return -2; } else { audit_number_to_errmsg(rc, long_opts[lidx].name); retval = -1; } break; case 4: #if HAVE_DECL_AUDIT_STATUS_BACKLOG_WAIT_TIME_ACTUAL == 1 if ((rc = audit_reset_backlog_wait_time_actual(fd)) >= 0) { audit_msg(LOG_INFO, "backlog_wait_time_actual: %u", rc); return -2; } else { audit_number_to_errmsg(rc, long_opts[lidx].name); retval = -1; } #else audit_msg(LOG_ERR, "reset_backlog_wait_time_actual is not supported on your kernel"); retval = -1; #endif break; case 5: retval = send_signal(optarg); break; default: { char *bad_opt; if (optind >= 2) bad_opt = vars[optind -1]; else bad_opt = " "; if (lineno) audit_msg(LOG_ERR, "Option %s on line %d is invalid", bad_opt, lineno); else audit_msg(LOG_ERR, "Option %s is invalid", bad_opt); retval = -1; } break; } } /* catch extra args or errors where the user types "- s" */ if (optind == 1) retval = -1; else if ((optind < count) && (retval != -1)) { audit_msg(LOG_ERR, "parameter passed without an option given"); retval = -1; } /* See if we were adding a key */ if (key[0] && list_requested == 0) { int flags = 0; char *cmd=NULL; /* Get the flag */ if (add != AUDIT_FILTER_UNSET) flags = add & AUDIT_FILTER_MASK; else if (del != AUDIT_FILTER_UNSET) flags = del & AUDIT_FILTER_MASK; /* Build the command */ if (asprintf(&cmd, "key=%s", key) < 0) { cmd = NULL; audit_msg(LOG_ERR, "Out of memory adding key"); retval = -1; } else { /* Add this to the rule */ int ret = audit_rule_fieldpair_data(&rule_new, cmd, flags); if (ret != 0) { audit_number_to_errmsg(ret, cmd); retval = -1; } free(cmd); } } if (retval == -1 && errno == ECONNREFUSED) audit_msg(LOG_ERR, "The audit system is disabled"); return retval; } static char *get_line(FILE *f, char *buf) { if (fgets_unlocked(buf, LINE_SIZE, f)) { /* remove newline */ char *ptr = strchr(buf, 0x0a); if (ptr) *ptr = 0; return buf; } return NULL; } static void preprocess(char *buf) { unsigned int i = 0; bool esc_ctx = false; while (buf[i]) { if (buf[i] == '\\' && esc_ctx == false) esc_ctx = true; else { if (esc_ctx == true) { if (buf[i] == ' ') { buf[i] = 0x07; buf[i - 1] = 0x07; } else if (buf[i] == '\\') { buf[i] = 0x04; buf[i - 1] = 0x04; } esc_ctx = false; } } i++; } } static void postprocess(char *buf) { char *str = strdup(buf); char *pos1 = str; char *pos2 = buf; if (!str) return; while (*pos1) { if (*pos1 == 0x07) { *pos2 = ' '; pos1 += 2; pos2++; continue; } else if (*pos1 == 0x04) { *pos2 = '\\'; pos1 += 2; pos2++; continue; } *pos2 = *pos1; pos2++; pos1++; } *pos2 = 0; free(str); } /* * This function reads the given file line by line and executes the rule. * It returns 0 if everything went OK, 1 if there are problems before reading * the file, 2 if the rules file doesn't exist and it should, and -1 on * error conditions after executing some of the rules. It will abort reading * the file if it encounters any problems. */ static int fileopt(const char *file) { int i, tfd, rc, lineno = 1; struct stat st; FILE *f; char buf[LINE_SIZE]; /* Does the file exist? */ rc = open(file, O_RDONLY); if (rc < 0) { if (errno != ENOENT) { audit_msg(LOG_ERR,"Error opening %s (%s)", file, strerror(errno)); return 1; } audit_msg(LOG_ERR, "audit rules file %s doesn't exist", file); return 2; } tfd = rc; /* Is the file permissions sane? */ if (fstat(tfd, &st) < 0) { audit_msg(LOG_ERR, "Error fstat'ing %s (%s)", file, strerror(errno)); close(tfd); return 1; } if (!S_ISREG(st.st_mode)) { audit_msg(LOG_ERR, "Error - %s is not a regular file", file); close(tfd); return 1; } f = fdopen(tfd, "rm"); if (f == NULL) { audit_msg(LOG_ERR, "Error - fdopen failed (%s)", strerror(errno)); close(tfd); return 1; } /* Read until eof, lineno starts as 1 */ while (get_line(f, buf)) { char *ptr, **fields; unsigned int idx=0, nf = (strlen(buf)/3) + 3; /* Weed out blank lines */ while (buf[idx] == ' ') idx++; if (buf[idx] == 0) { lineno++; continue; } preprocess(buf); ptr = audit_strsplit(buf); if (ptr == NULL) break; /* allow comments */ if (ptr[0] == '#') { lineno++; continue; } i = 0; fields = malloc(nf * sizeof(char *)); if (fields == NULL) { audit_msg(LOG_ERR, "Out of memory. Check %s file, %d line", __FILE__, __LINE__); fclose(f); return 1; } fields[i++] = "auditctl"; fields[i++] = ptr; while( (ptr=audit_strsplit(NULL)) && (i < nf-1)) { postprocess(ptr); fields[i++] = ptr; } fields[i] = NULL; /* Parse it */ if (reset_vars()) { free(fields); fclose(f); return -1; } rc = setopt(i, lineno, fields); free(fields); /* handle reply or send rule */ if (rc != -3) { if (handle_request(rc) == -1) { if (errno != ECONNREFUSED) audit_msg(LOG_ERR, "There was an error in line %d of %s", lineno, file); else { audit_msg(LOG_ERR, "The audit system is disabled"); fclose(f); return 0; } if (ignore == 0) { fclose(f); return -1; } if (continue_error) continue_error = -1; } } lineno++; } fclose(f); return 0; } /* Return 1 if ready, 0 otherwise */ static int is_ready(void) { if (audit_is_enabled(fd) == 2) { audit_msg(LOG_ERR, "The audit system is in immutable mode," " no rule changes allowed"); return 0; } else if (errno == ECONNREFUSED) { audit_msg(LOG_ERR, "The audit system is disabled"); return 0; } return 1; } int main(int argc, char *argv[]) { int retval = 1; set_aumessage_mode(MSG_STDERR, DBG_NO); if (argc == 1) { usage(); return 1; } #ifndef DEBUG /* Make sure we are root if we do anything except help */ if (!(argc == 2 && (strcmp(argv[1], "--help")==0 || strcmp(argv[1], "-h") == 0 || (strcmp(argv[1], "-l") == 0 && geteuid() == 0))) && !audit_can_control()) { audit_msg(LOG_WARNING, "You must be root to run this program."); return 4; } #endif /* Check where the rules are coming from: commandline or file */ if ((argc == 3) && (strcmp(argv[1], "-R") == 0)) { // If reading a file, its most likely start up. Send problems // to syslog where they will persist for later review set_aumessage_mode(MSG_SYSLOG, DBG_NO); fd = audit_open(); if (is_ready() == 0) return 1; else if (fileopt(argv[2])) { free(rule_new); return 1; } else { free(rule_new); if (continue_error < 0) return 1; return 0; } } else { if (reset_vars()) { free(rule_new); return 1; } retval = setopt(argc, 0, argv); if (retval == -3) { free(rule_new); return 0; } } if (add != AUDIT_FILTER_UNSET || del != AUDIT_FILTER_UNSET) { fd = audit_open(); if (is_ready() == 0) { free(rule_new); return 1; } } retval = handle_request(retval); if (retval == -1) { if (errno != ECONNREFUSED) audit_msg(LOG_ERR, "There was an error while processing parameters"); else { audit_msg(LOG_ERR, "The audit system is disabled"); return 0; } } free(rule_new); return retval; } /* * This function is called after setopt to handle the return code. * On entry, status = 0 means just get the reply. Greater than 0 means we * are adding or deleting a rule or watch. -1 means an error occurred. * -2 means everything is OK and no reply needed. Even if there's an * error, we need to call this routine to close up the audit fd. * The return code from this function is 0 success and -1 error. */ static int handle_request(int status) { if (status == 0) { if (_audit_syscalladded) { audit_msg(LOG_ERR, "Error - no list specified"); return -1; } get_reply(); } else if (status == -2) status = 0; // report success else if (status > 0) { int rc; if (add != AUDIT_FILTER_UNSET) { // if !task add syscall any if not specified if ((add & AUDIT_FILTER_MASK) != AUDIT_FILTER_TASK && _audit_syscalladded != 1) { audit_rule_syscallbyname_data( rule_new, "all"); } set_aumessage_mode(MSG_QUIET, DBG_NO); rc = audit_add_rule_data(fd, rule_new, add, action); set_aumessage_mode(MSG_STDERR, DBG_NO); /* Retry for legacy kernels */ if (rc < 0) { if (errno == EINVAL && rule_new->fields[0] == AUDIT_DIR) { rule_new->fields[0] = AUDIT_WATCH; rc = audit_add_rule_data(fd, rule_new, add, action); } else { audit_msg(LOG_ERR, "Error sending add rule data request (%s)", errno == EEXIST ? "Rule exists" : strerror(-rc)); } } } else if (del != AUDIT_FILTER_UNSET) { if ((del & AUDIT_FILTER_MASK) != AUDIT_FILTER_TASK && _audit_syscalladded != 1) { audit_rule_syscallbyname_data( rule_new, "all"); } set_aumessage_mode(MSG_QUIET, DBG_NO); rc = audit_delete_rule_data(fd, rule_new, del, action); set_aumessage_mode(MSG_STDERR, DBG_NO); /* Retry for legacy kernels */ if (rc < 0) { if (errno == EINVAL && rule_new->fields[0] == AUDIT_DIR) { rule_new->fields[0] = AUDIT_WATCH; rc = audit_delete_rule_data(fd,rule_new, del, action); } else { audit_msg(LOG_ERR, "Error sending delete rule data request (%s)", errno == EEXIST ? "Rule exists" : strerror(-rc)); } } } else { usage(); audit_close(fd); exit(1); } if (rc <= 0) status = -1; else status = 0; } else status = -1; if (!list_requested) audit_close(fd); fd = -1; return status; } /* * A reply from the kernel is expected. Get and display it. */ static void get_reply(void) { int i, retval; int timeout = 40; /* loop has delay of .1 - so this is 4 seconds */ struct audit_reply rep; fd_set read_mask; FD_ZERO(&read_mask); FD_SET(fd, &read_mask); // Reset printing counter audit_print_init(); for (i = 0; i < timeout; i++) { struct timeval t; t.tv_sec = 0; t.tv_usec = 100000; /* .1 second */ do { retval=select(fd+1, &read_mask, NULL, NULL, &t); } while (retval < 0 && errno == EINTR); // We'll try to read just in case retval = audit_get_reply(fd, &rep, GET_REPLY_NONBLOCKING, 0); if (retval > 0) { if (rep.type == NLMSG_ERROR && rep.error->error == 0) { i = 0; /* reset timeout */ continue; /* This was an ack */ } if ((retval = audit_print_reply(&rep, fd)) == 0) break; else i = 0; /* If getting more, reset timeout */ } } } audit-4.0.2/src/test/0000755001034500103450000000000014655201457010143 5audit-4.0.2/src/test/Makefile.in0000644001034500103450000010407314655201425012130 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Copyright 2008,2014,2015 Red Hat Inc., Durham, North Carolina. # All Rights Reserved. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Authors: # Steve Grubb # 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@ check_PROGRAMS = ilist_test$(EXEEXT) slist_test$(EXEEXT) subdir = src/test ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prog_cc_for_build.m4 \ $(top_srcdir)/m4/cap-ng.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/src/libev/libev.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = ilist_test_SOURCES = ilist_test.c ilist_test_OBJECTS = ilist_test.$(OBJEXT) ilist_test_DEPENDENCIES = ${top_builddir}/src/ausearch-int.o AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = slist_test_SOURCES = slist_test.c slist_test_OBJECTS = slist_test.$(OBJEXT) slist_test_DEPENDENCIES = ${top_builddir}/src/ausearch-string.o AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/ilist_test.Po \ ./$(DEPDIR)/slist_test.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = ilist_test.c slist_test.c DIST_SOURCES = ilist_test.c slist_test.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ $(top_srcdir)/test-driver DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILD_EXEEXT = @BUILD_EXEEXT@ BUILD_OBJEXT = @BUILD_OBJEXT@ CAPNG_LDADD = @CAPNG_LDADD@ CAPNG_PKG = @CAPNG_PKG@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_FOR_BUILD = @CC_FOR_BUILD@ CFLAGS = @CFLAGS@ CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ CPP_FOR_BUILD = @CPP_FOR_BUILD@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG = @DEBUG@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GOLANG = @GOLANG@ GOROOT = @GOROOT@ 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@ LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBWRAP_LIBS = @LIBWRAP_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PYTHON = @PYTHON@ PYTHON3_CFLAGS = @PYTHON3_CFLAGS@ PYTHON3_INCLUDES = @PYTHON3_INCLUDES@ PYTHON3_LIBS = @PYTHON3_LIBS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ VERSION = @VERSION@ WFLAGS = @WFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CC_FOR_BUILD = @ac_ct_CC_FOR_BUILD@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gss_libs = @gss_libs@ 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@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ use_python3 = @use_python3@ AM_CPPFLAGS = -I${top_srcdir} -I${top_srcdir}/lib -I${top_srcdir}/src TESTS = $(check_PROGRAMS) ilist_test_LDADD = ${top_builddir}/src/ausearch-int.o slist_test_LDADD = ${top_builddir}/src/ausearch-string.o all: all-am .SUFFIXES: .SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/test/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/test/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-checkPROGRAMS: @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list ilist_test$(EXEEXT): $(ilist_test_OBJECTS) $(ilist_test_DEPENDENCIES) $(EXTRA_ilist_test_DEPENDENCIES) @rm -f ilist_test$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ilist_test_OBJECTS) $(ilist_test_LDADD) $(LIBS) slist_test$(EXEEXT): $(slist_test_OBJECTS) $(slist_test_DEPENDENCIES) $(EXTRA_slist_test_DEPENDENCIES) @rm -f slist_test$(EXEEXT) $(AM_V_CCLD)$(LINK) $(slist_test_OBJECTS) $(slist_test_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ilist_test.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slist_test.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ elif test -n "$$redo_logs"; then \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ if test -n "$(PACKAGE_BUGREPORT)"; then \ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: $(check_PROGRAMS) @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ trs_list=`for i in $$bases; do echo $$i.trs; done`; \ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all $(check_PROGRAMS) @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? ilist_test.log: ilist_test$(EXEEXT) @p='ilist_test$(EXEEXT)'; \ b='ilist_test'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) slist_test.log: slist_test$(EXEEXT) @p='slist_test$(EXEEXT)'; \ b='slist_test'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/ilist_test.Po -rm -f ./$(DEPDIR)/slist_test.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/ilist_test.Po -rm -f ./$(DEPDIR)/slist_test.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ check-am clean clean-checkPROGRAMS clean-generic clean-libtool \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ recheck tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: audit-4.0.2/src/test/Makefile.am0000644001034500103450000000212714655201403012110 # Copyright 2008,2014,2015 Red Hat Inc., Durham, North Carolina. # All Rights Reserved. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Authors: # Steve Grubb # AM_CPPFLAGS = -I${top_srcdir} -I${top_srcdir}/lib -I${top_srcdir}/src check_PROGRAMS = ilist_test slist_test TESTS = $(check_PROGRAMS) ilist_test_LDADD = ${top_builddir}/src/ausearch-int.o slist_test_LDADD = ${top_builddir}/src/ausearch-string.o audit-4.0.2/src/test/slist_test.c0000644001034500103450000000355214655201403012420 #include #include #include "ausearch-string.h" slist s; int print_list(void) { int cnt = 0; slist_first(&s); do { snode *cur = slist_get_cur(&s); if (cur) { cnt++; printf("%s\n", cur->str); } } while (slist_next(&s)); return cnt; } int main(void) { snode n, *node; int rc, i = 0; slist_create(&s); // This first test checks to see if list is // created in a numeric order slist_add_if_uniq(&s, "test1"); slist_add_if_uniq(&s, "test2"); slist_first(&s); slist_add_if_uniq(&s, "test3"); puts("should be 3"); rc = print_list(); if (s.cnt != 3 || rc !=3) { puts("test count is wrong"); return 1; } n.str = strdup("test4"); n.key = NULL; n.hits = 1; slist_append(&s, &n); puts("should add a #4"); rc = print_list(); if (s.cnt != 4 || rc != 4) { puts("test count is wrong"); return 1; } slist_add_if_uniq(&s, "test2"); puts("should be same"); rc = print_list(); if (s.cnt != 4 || rc != 4) { puts("test count is wrong"); return 1; } slist_clear(&s); puts("should be empty"); rc = print_list(); if (s.cnt != 0 || rc != 0) { puts("test count is wrong"); return 1; } puts("starting sort test"); // Now test to see if the sort function works // Fill the list exactly backwards slist_add_if_uniq(&s, "test1"); slist_add_if_uniq(&s, "test3"); slist_add_if_uniq(&s, "test3"); slist_add_if_uniq(&s, "test2"); slist_add_if_uniq(&s, "test4"); slist_add_if_uniq(&s, "test3"); slist_add_if_uniq(&s, "test4"); slist_add_if_uniq(&s, "test4"); slist_add_if_uniq(&s, "test2"); slist_add_if_uniq(&s, "test4"); slist_sort_by_hits(&s); slist_first(&s); do { node = slist_get_cur(&s); if (node->hits != (4-i)) { printf("Sort test failed - i:%d != hits:%u\n", i, node->hits); return 1; } i++; } while ((node = slist_next(&s))); puts("sort test passes"); slist_clear(&s); return 0; } audit-4.0.2/src/test/ilist_test.c0000644001034500103450000000264414655201403012407 #include #include "ausearch-int.h" int main(void) { int i = 0; ilist e; int_node *node; ilist_create(&e); // This first test checks to see if list is // created in a numeric order ilist_add_if_uniq(&e, 6, 0); ilist_add_if_uniq(&e, 5, 0); ilist_add_if_uniq(&e, 7, 0); ilist_add_if_uniq(&e, 1, 0); ilist_add_if_uniq(&e, 8, 0); ilist_add_if_uniq(&e, 2, 0); ilist_add_if_uniq(&e, 9, 0); ilist_add_if_uniq(&e, 0, 0); ilist_add_if_uniq(&e, 4, 0); ilist_add_if_uniq(&e, 3, 0); ilist_first(&e); do { node = ilist_get_cur(&e); if (i != node->num) { printf("Test failed - i:%d != num:%d\n", i, node->num); return 1; } i++; } while ((node = ilist_next(&e))); ilist_clear(&e); puts("starting sort test"); // Now test to see if the sort function works // Fill the list exactly backwards ilist_add_if_uniq(&e, 3, 0); ilist_add_if_uniq(&e, 3, 0); ilist_add_if_uniq(&e, 4, 0); ilist_add_if_uniq(&e, 3, 0); ilist_add_if_uniq(&e, 4, 0); ilist_add_if_uniq(&e, 2, 0); ilist_add_if_uniq(&e, 4, 0); ilist_add_if_uniq(&e, 2, 0); ilist_add_if_uniq(&e, 4, 0); ilist_add_if_uniq(&e, 1, 0); ilist_sort_by_hits(&e); i = 0; ilist_first(&e); do { node = ilist_get_cur(&e); if (node->hits != (4-i)) { printf("Sort test failed - i:%d != ihits:%u\n", i, node->hits); return 1; } i++; } while ((node = ilist_next(&e))); ilist_clear(&e); printf("ilist tests passed\n"); return 0; } audit-4.0.2/src/auditd-reconfig.c0000644001034500103450000000700414655201403012304 /* auditd-reconfig.c -- * Copyright 2005,2021 Red Hat Inc. * All Rights Reserved. * * 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 * * Authors: * Steve Grubb * */ #include "config.h" #include #include #include #include #include #include #include "libaudit.h" #include "auditd-event.h" #include "auditd-config.h" #include "private.h" /* externs we need to know about */ extern void reconfig_ready(void); /* This is the configuration manager code */ static pthread_t config_thread; static pthread_mutex_t config_lock; // Only let one run at a time static void *config_thread_main(void *arg); void init_config_manager(void) { pthread_mutex_init(&config_lock, NULL); audit_msg(LOG_DEBUG, "config_manager init complete"); } int start_config_manager(struct auditd_event *e) { int retval, rc = 0; retval = pthread_mutex_trylock(&config_lock); if (retval == 0) { pthread_attr_t detached; pthread_attr_init(&detached); pthread_attr_setdetachstate(&detached, PTHREAD_CREATE_DETACHED); if (pthread_create(&config_thread, &detached, config_thread_main, e) > 0) { audit_msg(LOG_ERR, "Couldn't create config thread, no config changes"); free(e); pthread_mutex_unlock(&config_lock); rc = 1; } pthread_attr_destroy(&detached); } else { audit_msg(LOG_ERR, "Config thread already running, no config changes"); free(e); rc = 1; } return rc; } static void *config_thread_main(void *arg) { sigset_t sigs; struct auditd_event *e = (struct auditd_event *)arg; struct daemon_conf new_config; extern int send_audit_event(int type, const char *str); /* This is a worker thread. Don't handle signals. */ sigemptyset(&sigs); sigaddset(&sigs, SIGTERM); sigaddset(&sigs, SIGHUP); sigaddset(&sigs, SIGUSR1); sigaddset(&sigs, SIGUSR2); sigaddset(&sigs, SIGCHLD); sigaddset(&sigs, SIGCONT); pthread_sigmask(SIG_SETMASK, &sigs, NULL); if (load_config(&new_config, TEST_AUDITD) == 0) { /* We will re-use the current reply */ new_config.sender_uid = e->reply.signal_info->uid; new_config.sender_pid = e->reply.signal_info->pid; if (e->reply.len > 24) new_config.sender_ctx = strdup(e->reply.signal_info->ctx); else new_config.sender_ctx = strdup("?"); memcpy(e->reply.msg.data, &new_config, sizeof(new_config)); e->reply.conf = (struct daemon_conf *)e->reply.msg.data; e->reply.type = AUDIT_DAEMON_RECONFIG; reconfig_ready(); } else { // need to send a failed event message char txt[MAX_AUDIT_MESSAGE_LENGTH]; audit_format_signal_info(txt, sizeof(txt), "reconfigure state=no-change", &e->reply, "failed"); // FIXME: need to figure out sending this //send_audit_event(AUDIT_DAEMON_CONFIG, txt); free_config(&new_config); free(e); } pthread_mutex_unlock(&config_lock); return NULL; } audit-4.0.2/src/libev/0000755001034500103450000000000014655201457010265 5audit-4.0.2/src/libev/libev.m40000644001034500103450000000335714655201403011547 dnl this file is part of libev, do not make local modifications dnl http://software.schmorp.de/pkg/libev dnl libev support AC_CHECK_HEADERS(sys/inotify.h sys/epoll.h sys/event.h port.h poll.h sys/timerfd.h) AC_CHECK_HEADERS(sys/select.h sys/eventfd.h sys/signalfd.h linux/aio_abi.h linux/fs.h) AC_CHECK_FUNCS(inotify_init epoll_ctl kqueue port_create poll select eventfd signalfd) AC_CHECK_FUNCS(clock_gettime, [], [ dnl on linux, try syscall wrapper first if test $(uname) = Linux; then AC_MSG_CHECKING(for clock_gettime syscall) AC_LINK_IFELSE([AC_LANG_PROGRAM( [#include #include #include ], [struct timespec ts; int status = syscall (SYS_clock_gettime, CLOCK_REALTIME, &ts)])], [ac_have_clock_syscall=1 AC_DEFINE(HAVE_CLOCK_SYSCALL, 1, Define to 1 to use the syscall interface for clock_gettime) AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)]) fi if test -z "$LIBEV_M4_AVOID_LIBRT" && test -z "$ac_have_clock_syscall"; then AC_CHECK_LIB(rt, clock_gettime) unset ac_cv_func_clock_gettime AC_CHECK_FUNCS(clock_gettime) fi ]) AC_CHECK_FUNCS(nanosleep, [], [ if test -z "$LIBEV_M4_AVOID_LIBRT"; then AC_CHECK_LIB(rt, nanosleep) unset ac_cv_func_nanosleep AC_CHECK_FUNCS(nanosleep) fi ]) AC_CHECK_TYPE(__kernel_rwf_t, [ AC_DEFINE(HAVE_KERNEL_RWF_T, 1, Define to 1 if linux/fs.h defined kernel_rwf_t) ], [], [#include ]) if test -z "$LIBEV_M4_AVOID_LIBM"; then LIBM=m fi AC_SEARCH_LIBS(floor, $LIBM, [AC_DEFINE(HAVE_FLOOR, 1, Define to 1 if the floor function is available)]) audit-4.0.2/src/libev/Makefile.in0000644001034500103450000005013114655201425012245 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = src/libev ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prog_cc_for_build.m4 \ $(top_srcdir)/m4/cap-ng.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/src/libev/libev.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libev_la_LIBADD = am_libev_la_OBJECTS = ev.lo event.lo libev_la_OBJECTS = $(am_libev_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libev_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libev_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/ev.Plo ./$(DEPDIR)/event.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libev_la_SOURCES) DIST_SOURCES = $(libev_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILD_EXEEXT = @BUILD_EXEEXT@ BUILD_OBJEXT = @BUILD_OBJEXT@ CAPNG_LDADD = @CAPNG_LDADD@ CAPNG_PKG = @CAPNG_PKG@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_FOR_BUILD = @CC_FOR_BUILD@ CFLAGS = @CFLAGS@ CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ CPP_FOR_BUILD = @CPP_FOR_BUILD@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG = @DEBUG@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GOLANG = @GOLANG@ GOROOT = @GOROOT@ 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@ LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBWRAP_LIBS = @LIBWRAP_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PYTHON = @PYTHON@ PYTHON3_CFLAGS = @PYTHON3_CFLAGS@ PYTHON3_INCLUDES = @PYTHON3_INCLUDES@ PYTHON3_LIBS = @PYTHON3_LIBS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ VERSION = @VERSION@ WFLAGS = @WFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CC_FOR_BUILD = @ac_ct_CC_FOR_BUILD@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gss_libs = @gss_libs@ 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@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ use_python3 = @use_python3@ # Makefile.am-- # Copyright 2008,2011-12 Red Hat Inc. # All Rights Reserved. # # 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; see the file COPYING. If not, write to the # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor # Boston, MA 02110-1335, USA. # # Authors: # Steve Grubb # VERSION_INFO = 4:0:0 EXTRA_DIST = README ev_epoll.c ev_poll.c ev_select.c ev_linuxaio.c libev.m4 AM_CFLAGS = -fPIC -DPIC -g -fno-strict-aliasing ${DEBUG} noinst_HEADERS = ev.h ev_vars.h ev_wrap.h event.h noinst_LTLIBRARIES = libev.la libev_la_SOURCES = ev.c event.c libev_la_LDFLAGS = -no-undefined -static all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/libev/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/libev/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libev.la: $(libev_la_OBJECTS) $(libev_la_DEPENDENCIES) $(EXTRA_libev_la_DEPENDENCIES) $(AM_V_CCLD)$(libev_la_LINK) $(libev_la_OBJECTS) $(libev_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ev.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/event.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/ev.Plo -rm -f ./$(DEPDIR)/event.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/ev.Plo -rm -f ./$(DEPDIR)/event.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: audit-4.0.2/src/libev/Makefile.am0000644001034500103450000000222114655201403012225 # Makefile.am-- # Copyright 2008,2011-12 Red Hat Inc. # All Rights Reserved. # # 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; see the file COPYING. If not, write to the # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor # Boston, MA 02110-1335, USA. # # Authors: # Steve Grubb # VERSION_INFO = 4:0:0 EXTRA_DIST = README ev_epoll.c ev_poll.c ev_select.c ev_linuxaio.c libev.m4 AM_CFLAGS = -fPIC -DPIC -g -fno-strict-aliasing ${DEBUG} noinst_HEADERS = ev.h ev_vars.h ev_wrap.h event.h noinst_LTLIBRARIES = libev.la libev_la_SOURCES = ev.c event.c libev_la_LDFLAGS = -no-undefined -static audit-4.0.2/src/libev/ev_wrap.h0000644001034500103450000002006014655201403012006 /* DO NOT EDIT, automatically generated by update_ev_wrap */ #ifndef EV_WRAP_H #define EV_WRAP_H #define acquire_cb ((loop)->acquire_cb) #define activecnt ((loop)->activecnt) #define anfdmax ((loop)->anfdmax) #define anfds ((loop)->anfds) #define async_pending ((loop)->async_pending) #define asynccnt ((loop)->asynccnt) #define asyncmax ((loop)->asyncmax) #define asyncs ((loop)->asyncs) #define backend ((loop)->backend) #define backend_fd ((loop)->backend_fd) #define backend_mintime ((loop)->backend_mintime) #define backend_modify ((loop)->backend_modify) #define backend_poll ((loop)->backend_poll) #define checkcnt ((loop)->checkcnt) #define checkmax ((loop)->checkmax) #define checks ((loop)->checks) #define cleanupcnt ((loop)->cleanupcnt) #define cleanupmax ((loop)->cleanupmax) #define cleanups ((loop)->cleanups) #define curpid ((loop)->curpid) #define epoll_epermcnt ((loop)->epoll_epermcnt) #define epoll_epermmax ((loop)->epoll_epermmax) #define epoll_eperms ((loop)->epoll_eperms) #define epoll_eventmax ((loop)->epoll_eventmax) #define epoll_events ((loop)->epoll_events) #define evpipe ((loop)->evpipe) #define fdchangecnt ((loop)->fdchangecnt) #define fdchangemax ((loop)->fdchangemax) #define fdchanges ((loop)->fdchanges) #define forkcnt ((loop)->forkcnt) #define forkmax ((loop)->forkmax) #define forks ((loop)->forks) #define fs_2625 ((loop)->fs_2625) #define fs_fd ((loop)->fs_fd) #define fs_hash ((loop)->fs_hash) #define fs_w ((loop)->fs_w) #define idleall ((loop)->idleall) #define idlecnt ((loop)->idlecnt) #define idlemax ((loop)->idlemax) #define idles ((loop)->idles) #define invoke_cb ((loop)->invoke_cb) #define io_blocktime ((loop)->io_blocktime) #define iocp ((loop)->iocp) #define iouring_cq_cqes ((loop)->iouring_cq_cqes) #define iouring_cq_head ((loop)->iouring_cq_head) #define iouring_cq_overflow ((loop)->iouring_cq_overflow) #define iouring_cq_ring ((loop)->iouring_cq_ring) #define iouring_cq_ring_entries ((loop)->iouring_cq_ring_entries) #define iouring_cq_ring_mask ((loop)->iouring_cq_ring_mask) #define iouring_cq_ring_size ((loop)->iouring_cq_ring_size) #define iouring_cq_tail ((loop)->iouring_cq_tail) #define iouring_entries ((loop)->iouring_entries) #define iouring_fd ((loop)->iouring_fd) #define iouring_max_entries ((loop)->iouring_max_entries) #define iouring_sq_array ((loop)->iouring_sq_array) #define iouring_sq_dropped ((loop)->iouring_sq_dropped) #define iouring_sq_flags ((loop)->iouring_sq_flags) #define iouring_sq_head ((loop)->iouring_sq_head) #define iouring_sq_ring ((loop)->iouring_sq_ring) #define iouring_sq_ring_entries ((loop)->iouring_sq_ring_entries) #define iouring_sq_ring_mask ((loop)->iouring_sq_ring_mask) #define iouring_sq_ring_size ((loop)->iouring_sq_ring_size) #define iouring_sq_tail ((loop)->iouring_sq_tail) #define iouring_sqes ((loop)->iouring_sqes) #define iouring_sqes_size ((loop)->iouring_sqes_size) #define iouring_tfd ((loop)->iouring_tfd) #define iouring_tfd_to ((loop)->iouring_tfd_to) #define iouring_tfd_w ((loop)->iouring_tfd_w) #define iouring_to_submit ((loop)->iouring_to_submit) #define kqueue_changecnt ((loop)->kqueue_changecnt) #define kqueue_changemax ((loop)->kqueue_changemax) #define kqueue_changes ((loop)->kqueue_changes) #define kqueue_eventmax ((loop)->kqueue_eventmax) #define kqueue_events ((loop)->kqueue_events) #define kqueue_fd_pid ((loop)->kqueue_fd_pid) #define linuxaio_ctx ((loop)->linuxaio_ctx) #define linuxaio_epoll_w ((loop)->linuxaio_epoll_w) #define linuxaio_iocbpmax ((loop)->linuxaio_iocbpmax) #define linuxaio_iocbps ((loop)->linuxaio_iocbps) #define linuxaio_iteration ((loop)->linuxaio_iteration) #define linuxaio_submitcnt ((loop)->linuxaio_submitcnt) #define linuxaio_submitmax ((loop)->linuxaio_submitmax) #define linuxaio_submits ((loop)->linuxaio_submits) #define loop_count ((loop)->loop_count) #define loop_depth ((loop)->loop_depth) #define loop_done ((loop)->loop_done) #define mn_now ((loop)->mn_now) #define now_floor ((loop)->now_floor) #define origflags ((loop)->origflags) #define pending_w ((loop)->pending_w) #define pendingcnt ((loop)->pendingcnt) #define pendingmax ((loop)->pendingmax) #define pendingpri ((loop)->pendingpri) #define pendings ((loop)->pendings) #define periodiccnt ((loop)->periodiccnt) #define periodicmax ((loop)->periodicmax) #define periodics ((loop)->periodics) #define pipe_w ((loop)->pipe_w) #define pipe_write_skipped ((loop)->pipe_write_skipped) #define pipe_write_wanted ((loop)->pipe_write_wanted) #define pollcnt ((loop)->pollcnt) #define pollidxmax ((loop)->pollidxmax) #define pollidxs ((loop)->pollidxs) #define pollmax ((loop)->pollmax) #define polls ((loop)->polls) #define port_eventmax ((loop)->port_eventmax) #define port_events ((loop)->port_events) #define postfork ((loop)->postfork) #define preparecnt ((loop)->preparecnt) #define preparemax ((loop)->preparemax) #define prepares ((loop)->prepares) #define release_cb ((loop)->release_cb) #define rfeedcnt ((loop)->rfeedcnt) #define rfeedmax ((loop)->rfeedmax) #define rfeeds ((loop)->rfeeds) #define rtmn_diff ((loop)->rtmn_diff) #define sig_pending ((loop)->sig_pending) #define sigfd ((loop)->sigfd) #define sigfd_set ((loop)->sigfd_set) #define sigfd_w ((loop)->sigfd_w) #define timeout_blocktime ((loop)->timeout_blocktime) #define timercnt ((loop)->timercnt) #define timerfd ((loop)->timerfd) #define timerfd_w ((loop)->timerfd_w) #define timermax ((loop)->timermax) #define timers ((loop)->timers) #define userdata ((loop)->userdata) #define vec_eo ((loop)->vec_eo) #define vec_max ((loop)->vec_max) #define vec_ri ((loop)->vec_ri) #define vec_ro ((loop)->vec_ro) #define vec_wi ((loop)->vec_wi) #define vec_wo ((loop)->vec_wo) #else #undef EV_WRAP_H #undef acquire_cb #undef activecnt #undef anfdmax #undef anfds #undef async_pending #undef asynccnt #undef asyncmax #undef asyncs #undef backend #undef backend_fd #undef backend_mintime #undef backend_modify #undef backend_poll #undef checkcnt #undef checkmax #undef checks #undef cleanupcnt #undef cleanupmax #undef cleanups #undef curpid #undef epoll_epermcnt #undef epoll_epermmax #undef epoll_eperms #undef epoll_eventmax #undef epoll_events #undef evpipe #undef fdchangecnt #undef fdchangemax #undef fdchanges #undef forkcnt #undef forkmax #undef forks #undef fs_2625 #undef fs_fd #undef fs_hash #undef fs_w #undef idleall #undef idlecnt #undef idlemax #undef idles #undef invoke_cb #undef io_blocktime #undef iocp #undef iouring_cq_cqes #undef iouring_cq_head #undef iouring_cq_overflow #undef iouring_cq_ring #undef iouring_cq_ring_entries #undef iouring_cq_ring_mask #undef iouring_cq_ring_size #undef iouring_cq_tail #undef iouring_entries #undef iouring_fd #undef iouring_max_entries #undef iouring_sq_array #undef iouring_sq_dropped #undef iouring_sq_flags #undef iouring_sq_head #undef iouring_sq_ring #undef iouring_sq_ring_entries #undef iouring_sq_ring_mask #undef iouring_sq_ring_size #undef iouring_sq_tail #undef iouring_sqes #undef iouring_sqes_size #undef iouring_tfd #undef iouring_tfd_to #undef iouring_tfd_w #undef iouring_to_submit #undef kqueue_changecnt #undef kqueue_changemax #undef kqueue_changes #undef kqueue_eventmax #undef kqueue_events #undef kqueue_fd_pid #undef linuxaio_ctx #undef linuxaio_epoll_w #undef linuxaio_iocbpmax #undef linuxaio_iocbps #undef linuxaio_iteration #undef linuxaio_submitcnt #undef linuxaio_submitmax #undef linuxaio_submits #undef loop_count #undef loop_depth #undef loop_done #undef mn_now #undef now_floor #undef origflags #undef pending_w #undef pendingcnt #undef pendingmax #undef pendingpri #undef pendings #undef periodiccnt #undef periodicmax #undef periodics #undef pipe_w #undef pipe_write_skipped #undef pipe_write_wanted #undef pollcnt #undef pollidxmax #undef pollidxs #undef pollmax #undef polls #undef port_eventmax #undef port_events #undef postfork #undef preparecnt #undef preparemax #undef prepares #undef release_cb #undef rfeedcnt #undef rfeedmax #undef rfeeds #undef rtmn_diff #undef sig_pending #undef sigfd #undef sigfd_set #undef sigfd_w #undef timeout_blocktime #undef timercnt #undef timerfd #undef timerfd_w #undef timermax #undef timers #undef userdata #undef vec_eo #undef vec_max #undef vec_ri #undef vec_ro #undef vec_wi #undef vec_wo #endif audit-4.0.2/src/libev/ev_epoll.c0000644001034500103450000002412514655201403012151 /* * libev epoll fd activity backend * * Copyright (c) 2007,2008,2009,2010,2011,2016,2017,2019 Marc Alexander Lehmann * All rights reserved. * * Redistribution and use in source and binary forms, with or without modifica- * tion, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MER- * CHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPE- * CIAL, 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 OTH- * ERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, the contents of this file may be used under the terms of * the GNU General Public License ("GPL") version 2 or any later version, * in which case the provisions of the GPL are applicable instead of * the above. If you wish to allow the use of your version of this file * only under the terms of the GPL and not to allow others to use your * version of this file under the BSD license, indicate your decision * by deleting the provisions above and replace them with the notice * and other provisions required by the GPL. If you do not delete the * provisions above, a recipient may use your version of this file under * either the BSD or the GPL. */ /* * general notes about epoll: * * a) epoll silently removes fds from the fd set. as nothing tells us * that an fd has been removed otherwise, we have to continually * "rearm" fds that we suspect *might* have changed (same * problem with kqueue, but much less costly there). * b) the fact that ADD != MOD creates a lot of extra syscalls due to a) * and seems not to have any advantage. * c) the inability to handle fork or file descriptors (think dup) * limits the applicability over poll, so this is not a generic * poll replacement. * d) epoll doesn't work the same as select with many file descriptors * (such as files). while not critical, no other advanced interface * seems to share this (rather non-unixy) limitation. * e) epoll claims to be embeddable, but in practise you never get * a ready event for the epoll fd (broken: <=2.6.26, working: >=2.6.32). * f) epoll_ctl returning EPERM means the fd is always ready. * * lots of "weird code" and complication handling in this file is due * to these design problems with epoll, as we try very hard to avoid * epoll_ctl syscalls for common usage patterns and handle the breakage * ensuing from receiving events for closed and otherwise long gone * file descriptors. */ #include #define EV_EMASK_EPERM 0x80 static void epoll_modify (EV_P_ int fd, int oev, int nev) { struct epoll_event ev; unsigned char oldmask; /* * we handle EPOLL_CTL_DEL by ignoring it here * on the assumption that the fd is gone anyways * if that is wrong, we have to handle the spurious * event in epoll_poll. * if the fd is added again, we try to ADD it, and, if that * fails, we assume it still has the same eventmask. */ if (!nev) return; oldmask = anfds [fd].emask; anfds [fd].emask = nev; /* store the generation counter in the upper 32 bits, the fd in the lower 32 bits */ ev.data.u64 = (uint64_t)(uint32_t)fd | ((uint64_t)(uint32_t)++anfds [fd].egen << 32); ev.events = (nev & EV_READ ? EPOLLIN : 0) | (nev & EV_WRITE ? EPOLLOUT : 0); if (ecb_expect_true (!epoll_ctl (backend_fd, oev && oldmask != nev ? EPOLL_CTL_MOD : EPOLL_CTL_ADD, fd, &ev))) return; if (ecb_expect_true (errno == ENOENT)) { /* if ENOENT then the fd went away, so try to do the right thing */ if (!epoll_ctl (backend_fd, EPOLL_CTL_ADD, fd, &ev)) return; } else if (ecb_expect_true (errno == EEXIST)) { /* EEXIST means we ignored a previous DEL, but the fd is still active */ /* if the kernel mask is the same as the new mask, we assume it hasn't changed */ if (oldmask == nev) goto dec_egen; if (!epoll_ctl (backend_fd, EPOLL_CTL_MOD, fd, &ev)) return; } else if (ecb_expect_true (errno == EPERM)) { /* EPERM means the fd is always ready, but epoll is too snobbish */ /* to handle it, unlike select or poll. */ anfds [fd].emask = EV_EMASK_EPERM; /* add fd to epoll_eperms, if not already inside */ if (!(oldmask & EV_EMASK_EPERM)) { array_needsize (int, epoll_eperms, epoll_epermmax, epoll_epermcnt + 1, array_needsize_noinit); epoll_eperms [epoll_epermcnt++] = fd; } return; } else assert (("libev: I/O watcher with invalid fd found in epoll_ctl", errno != EBADF && errno != ELOOP && errno != EINVAL)); fd_kill (EV_A_ fd); dec_egen: /* we didn't successfully call epoll_ctl, so decrement the generation counter again */ --anfds [fd].egen; } static void epoll_poll (EV_P_ ev_tstamp timeout) { int i; int eventcnt; if (ecb_expect_false (epoll_epermcnt)) timeout = EV_TS_CONST (0.); /* epoll wait times cannot be larger than (LONG_MAX - 999UL) / HZ msecs, which is below */ /* the default libev max wait time, however. */ EV_RELEASE_CB; eventcnt = epoll_wait (backend_fd, epoll_events, epoll_eventmax, EV_TS_TO_MSEC (timeout)); EV_ACQUIRE_CB; if (ecb_expect_false (eventcnt < 0)) { if (errno != EINTR) ev_syserr ("(libev) epoll_wait"); return; } for (i = 0; i < eventcnt; ++i) { struct epoll_event *ev = epoll_events + i; int fd = (uint32_t)ev->data.u64; /* mask out the lower 32 bits */ int want = anfds [fd].events; int got = (ev->events & (EPOLLOUT | EPOLLERR | EPOLLHUP) ? EV_WRITE : 0) | (ev->events & (EPOLLIN | EPOLLERR | EPOLLHUP) ? EV_READ : 0); /* * check for spurious notification. * this only finds spurious notifications on egen updates * other spurious notifications will be found by epoll_ctl, below * we assume that fd is always in range, as we never shrink the anfds array */ if (ecb_expect_false ((uint32_t)anfds [fd].egen != (uint32_t)(ev->data.u64 >> 32))) { /* recreate kernel state */ postfork |= 2; continue; } if (ecb_expect_false (got & ~want)) { anfds [fd].emask = want; /* * we received an event but are not interested in it, try mod or del * this often happens because we optimistically do not unregister fds * when we are no longer interested in them, but also when we get spurious * notifications for fds from another process. this is partially handled * above with the gencounter check (== our fd is not the event fd), and * partially here, when epoll_ctl returns an error (== a child has the fd * but we closed it). * note: for events such as POLLHUP, where we can't know whether it refers * to EV_READ or EV_WRITE, we might issue redundant EPOLL_CTL_MOD calls. */ ev->events = (want & EV_READ ? EPOLLIN : 0) | (want & EV_WRITE ? EPOLLOUT : 0); /* pre-2.6.9 kernels require a non-null pointer with EPOLL_CTL_DEL, */ /* which is fortunately easy to do for us. */ if (epoll_ctl (backend_fd, want ? EPOLL_CTL_MOD : EPOLL_CTL_DEL, fd, ev)) { postfork |= 2; /* an error occurred, recreate kernel state */ continue; } } fd_event (EV_A_ fd, got); } /* if the receive array was full, increase its size */ if (ecb_expect_false (eventcnt == epoll_eventmax)) { ev_free (epoll_events); epoll_eventmax = array_nextsize (sizeof (struct epoll_event), epoll_eventmax, epoll_eventmax + 1); epoll_events = (struct epoll_event *)ev_malloc (sizeof (struct epoll_event) * epoll_eventmax); } /* now synthesize events for all fds where epoll fails, while select works... */ for (i = epoll_epermcnt; i--; ) { int fd = epoll_eperms [i]; unsigned char events = anfds [fd].events & (EV_READ | EV_WRITE); if (anfds [fd].emask & EV_EMASK_EPERM && events) fd_event (EV_A_ fd, events); else { epoll_eperms [i] = epoll_eperms [--epoll_epermcnt]; anfds [fd].emask = 0; } } } static int epoll_epoll_create (void) { int fd; #if defined EPOLL_CLOEXEC && !defined __ANDROID__ fd = epoll_create1 (EPOLL_CLOEXEC); if (fd < 0 && (errno == EINVAL || errno == ENOSYS)) #endif { fd = epoll_create (256); if (fd >= 0) fcntl (fd, F_SETFD, FD_CLOEXEC); } return fd; } inline_size int epoll_init (EV_P_ int flags) { if ((backend_fd = epoll_epoll_create ()) < 0) return 0; backend_mintime = EV_TS_CONST (1e-3); /* epoll does sometimes return early, this is just to avoid the worst */ backend_modify = epoll_modify; backend_poll = epoll_poll; epoll_eventmax = 64; /* initial number of events receivable per poll */ epoll_events = (struct epoll_event *)ev_malloc (sizeof (struct epoll_event) * epoll_eventmax); return EVBACKEND_EPOLL; } inline_size void epoll_destroy (EV_P) { ev_free (epoll_events); array_free (epoll_eperm, EMPTY); } ecb_cold static void epoll_fork (EV_P) { close (backend_fd); while ((backend_fd = epoll_epoll_create ()) < 0) ev_syserr ("(libev) epoll_create"); fd_rearm_all (EV_A); } audit-4.0.2/src/libev/ev_vars.h0000644001034500103450000001657514655201403012030 /* * loop member variable declarations * * Copyright (c) 2007,2008,2009,2010,2011,2012,2013,2019 Marc Alexander Lehmann * All rights reserved. * * Redistribution and use in source and binary forms, with or without modifica- * tion, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MER- * CHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPE- * CIAL, 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 OTH- * ERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, the contents of this file may be used under the terms of * the GNU General Public License ("GPL") version 2 or any later version, * in which case the provisions of the GPL are applicable instead of * the above. If you wish to allow the use of your version of this file * only under the terms of the GPL and not to allow others to use your * version of this file under the BSD license, indicate your decision * by deleting the provisions above and replace them with the notice * and other provisions required by the GPL. If you do not delete the * provisions above, a recipient may use your version of this file under * either the BSD or the GPL. */ #define VARx(type,name) VAR(name, type name) VARx(ev_tstamp, now_floor) /* last time we refreshed rt_time */ VARx(ev_tstamp, mn_now) /* monotonic clock "now" */ VARx(ev_tstamp, rtmn_diff) /* difference realtime - monotonic time */ /* for reverse feeding of events */ VARx(W *, rfeeds) VARx(int, rfeedmax) VARx(int, rfeedcnt) VAR (pendings, ANPENDING *pendings [NUMPRI]) VAR (pendingmax, int pendingmax [NUMPRI]) VAR (pendingcnt, int pendingcnt [NUMPRI]) VARx(int, pendingpri) /* highest priority currently pending */ VARx(ev_prepare, pending_w) /* dummy pending watcher */ VARx(ev_tstamp, io_blocktime) VARx(ev_tstamp, timeout_blocktime) VARx(int, backend) VARx(int, activecnt) /* total number of active events ("refcount") */ VARx(EV_ATOMIC_T, loop_done) /* signal by ev_break */ VARx(int, backend_fd) VARx(ev_tstamp, backend_mintime) /* assumed typical timer resolution */ VAR (backend_modify, void (*backend_modify)(EV_P_ int fd, int oev, int nev)) VAR (backend_poll , void (*backend_poll)(EV_P_ ev_tstamp timeout)) VARx(ANFD *, anfds) VARx(int, anfdmax) VAR (evpipe, int evpipe [2]) VARx(ev_io, pipe_w) VARx(EV_ATOMIC_T, pipe_write_wanted) VARx(EV_ATOMIC_T, pipe_write_skipped) #if !defined(_WIN32) || EV_GENWRAP VARx(pid_t, curpid) #endif VARx(char, postfork) /* true if we need to recreate kernel state after fork */ #if EV_USE_SELECT || EV_GENWRAP VARx(void *, vec_ri) VARx(void *, vec_ro) VARx(void *, vec_wi) VARx(void *, vec_wo) #if defined(_WIN32) || EV_GENWRAP VARx(void *, vec_eo) #endif VARx(int, vec_max) #endif #if EV_USE_POLL || EV_GENWRAP VARx(struct pollfd *, polls) VARx(int, pollmax) VARx(int, pollcnt) VARx(int *, pollidxs) /* maps fds into structure indices */ VARx(int, pollidxmax) #endif #if EV_USE_EPOLL || EV_GENWRAP VARx(struct epoll_event *, epoll_events) VARx(int, epoll_eventmax) VARx(int *, epoll_eperms) VARx(int, epoll_epermcnt) VARx(int, epoll_epermmax) #endif #if EV_USE_LINUXAIO || EV_GENWRAP VARx(aio_context_t, linuxaio_ctx) VARx(int, linuxaio_iteration) VARx(struct aniocb **, linuxaio_iocbps) VARx(int, linuxaio_iocbpmax) VARx(struct iocb **, linuxaio_submits) VARx(int, linuxaio_submitcnt) VARx(int, linuxaio_submitmax) VARx(ev_io, linuxaio_epoll_w) #endif #if EV_USE_IOURING || EV_GENWRAP VARx(int, iouring_fd) VARx(unsigned, iouring_to_submit); VARx(int, iouring_entries) VARx(int, iouring_max_entries) VARx(void *, iouring_sq_ring) VARx(void *, iouring_cq_ring) VARx(void *, iouring_sqes) VARx(uint32_t, iouring_sq_ring_size) VARx(uint32_t, iouring_cq_ring_size) VARx(uint32_t, iouring_sqes_size) VARx(uint32_t, iouring_sq_head) VARx(uint32_t, iouring_sq_tail) VARx(uint32_t, iouring_sq_ring_mask) VARx(uint32_t, iouring_sq_ring_entries) VARx(uint32_t, iouring_sq_flags) VARx(uint32_t, iouring_sq_dropped) VARx(uint32_t, iouring_sq_array) VARx(uint32_t, iouring_cq_head) VARx(uint32_t, iouring_cq_tail) VARx(uint32_t, iouring_cq_ring_mask) VARx(uint32_t, iouring_cq_ring_entries) VARx(uint32_t, iouring_cq_overflow) VARx(uint32_t, iouring_cq_cqes) VARx(ev_tstamp, iouring_tfd_to) VARx(int, iouring_tfd) VARx(ev_io, iouring_tfd_w) #endif #if EV_USE_KQUEUE || EV_GENWRAP VARx(pid_t, kqueue_fd_pid) VARx(struct kevent *, kqueue_changes) VARx(int, kqueue_changemax) VARx(int, kqueue_changecnt) VARx(struct kevent *, kqueue_events) VARx(int, kqueue_eventmax) #endif #if EV_USE_PORT || EV_GENWRAP VARx(struct port_event *, port_events) VARx(int, port_eventmax) #endif #if EV_USE_IOCP || EV_GENWRAP VARx(HANDLE, iocp) #endif VARx(int *, fdchanges) VARx(int, fdchangemax) VARx(int, fdchangecnt) VARx(ANHE *, timers) VARx(int, timermax) VARx(int, timercnt) #if EV_PERIODIC_ENABLE || EV_GENWRAP VARx(ANHE *, periodics) VARx(int, periodicmax) VARx(int, periodiccnt) #endif #if EV_IDLE_ENABLE || EV_GENWRAP VAR (idles, ev_idle **idles [NUMPRI]) VAR (idlemax, int idlemax [NUMPRI]) VAR (idlecnt, int idlecnt [NUMPRI]) #endif VARx(int, idleall) /* total number */ VARx(struct ev_prepare **, prepares) VARx(int, preparemax) VARx(int, preparecnt) VARx(struct ev_check **, checks) VARx(int, checkmax) VARx(int, checkcnt) #if EV_FORK_ENABLE || EV_GENWRAP VARx(struct ev_fork **, forks) VARx(int, forkmax) VARx(int, forkcnt) #endif #if EV_CLEANUP_ENABLE || EV_GENWRAP VARx(struct ev_cleanup **, cleanups) VARx(int, cleanupmax) VARx(int, cleanupcnt) #endif #if EV_ASYNC_ENABLE || EV_GENWRAP VARx(EV_ATOMIC_T, async_pending) VARx(struct ev_async **, asyncs) VARx(int, asyncmax) VARx(int, asynccnt) #endif #if EV_USE_INOTIFY || EV_GENWRAP VARx(int, fs_fd) VARx(ev_io, fs_w) VARx(char, fs_2625) /* whether we are running in linux 2.6.25 or newer */ VAR (fs_hash, ANFS fs_hash [EV_INOTIFY_HASHSIZE]) #endif VARx(EV_ATOMIC_T, sig_pending) #if EV_USE_SIGNALFD || EV_GENWRAP VARx(int, sigfd) VARx(ev_io, sigfd_w) VARx(sigset_t, sigfd_set) #endif #if EV_USE_TIMERFD || EV_GENWRAP VARx(int, timerfd) /* timerfd for time jump detection */ VARx(ev_io, timerfd_w) #endif VARx(unsigned int, origflags) /* original loop flags */ #if EV_FEATURE_API || EV_GENWRAP VARx(unsigned int, loop_count) /* total number of loop iterations/blocks */ VARx(unsigned int, loop_depth) /* #ev_run enters - #ev_run leaves */ VARx(void *, userdata) /* C++ doesn't support the ev_loop_callback typedef here. stinks. */ VAR (release_cb, void (*release_cb)(EV_P) EV_NOEXCEPT) VAR (acquire_cb, void (*acquire_cb)(EV_P) EV_NOEXCEPT) VAR (invoke_cb , ev_loop_callback invoke_cb) #endif #undef VARx audit-4.0.2/src/libev/ev.c0000644001034500103450000045103314655201403010760 /* * libev event processing core, watcher management * * Copyright (c) 2007-2019 Marc Alexander Lehmann * All rights reserved. * * Redistribution and use in source and binary forms, with or without modifica- * tion, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MER- * CHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPE- * CIAL, 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 OTH- * ERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, the contents of this file may be used under the terms of * the GNU General Public License ("GPL") version 2 or any later version, * in which case the provisions of the GPL are applicable instead of * the above. If you wish to allow the use of your version of this file * only under the terms of the GPL and not to allow others to use your * version of this file under the BSD license, indicate your decision * by deleting the provisions above and replace them with the notice * and other provisions required by the GPL. If you do not delete the * provisions above, a recipient may use your version of this file under * either the BSD or the GPL. */ /* this big block deduces configuration from config.h */ #ifndef EV_STANDALONE # ifdef EV_CONFIG_H # include EV_CONFIG_H # else # include "config.h" # endif # if HAVE_FLOOR # ifndef EV_USE_FLOOR # define EV_USE_FLOOR 1 # endif # endif # if HAVE_CLOCK_SYSCALL # ifndef EV_USE_CLOCK_SYSCALL # define EV_USE_CLOCK_SYSCALL 1 # ifndef EV_USE_REALTIME # define EV_USE_REALTIME 0 # endif # ifndef EV_USE_MONOTONIC # define EV_USE_MONOTONIC 1 # endif # endif # elif !defined EV_USE_CLOCK_SYSCALL # define EV_USE_CLOCK_SYSCALL 0 # endif # if HAVE_CLOCK_GETTIME # ifndef EV_USE_MONOTONIC # define EV_USE_MONOTONIC 1 # endif # ifndef EV_USE_REALTIME # define EV_USE_REALTIME 0 # endif # else # ifndef EV_USE_MONOTONIC # define EV_USE_MONOTONIC 0 # endif # ifndef EV_USE_REALTIME # define EV_USE_REALTIME 0 # endif # endif # if HAVE_NANOSLEEP # ifndef EV_USE_NANOSLEEP # define EV_USE_NANOSLEEP EV_FEATURE_OS # endif # else # undef EV_USE_NANOSLEEP # define EV_USE_NANOSLEEP 0 # endif # if HAVE_SELECT && HAVE_SYS_SELECT_H # ifndef EV_USE_SELECT # define EV_USE_SELECT EV_FEATURE_BACKENDS # endif # else # undef EV_USE_SELECT # define EV_USE_SELECT 0 # endif # if HAVE_POLL && HAVE_POLL_H # ifndef EV_USE_POLL # define EV_USE_POLL EV_FEATURE_BACKENDS # endif # else # undef EV_USE_POLL # define EV_USE_POLL 0 # endif # if HAVE_EPOLL_CTL && HAVE_SYS_EPOLL_H # ifndef EV_USE_EPOLL # define EV_USE_EPOLL EV_FEATURE_BACKENDS # endif # else # undef EV_USE_EPOLL # define EV_USE_EPOLL 0 # endif # if HAVE_LINUX_AIO_ABI_H # ifndef EV_USE_LINUXAIO # define EV_USE_LINUXAIO 0 /* was: EV_FEATURE_BACKENDS, always off by default */ # endif # else # undef EV_USE_LINUXAIO # define EV_USE_LINUXAIO 0 # endif # if HAVE_LINUX_FS_H && HAVE_SYS_TIMERFD_H && HAVE_KERNEL_RWF_T # ifndef EV_USE_IOURING # define EV_USE_IOURING 0 // Intentionally drop the io_uring backend # endif # else # undef EV_USE_IOURING # define EV_USE_IOURING 0 # endif # if HAVE_KQUEUE && HAVE_SYS_EVENT_H # ifndef EV_USE_KQUEUE # define EV_USE_KQUEUE EV_FEATURE_BACKENDS # endif # else # undef EV_USE_KQUEUE # define EV_USE_KQUEUE 0 # endif # if HAVE_PORT_H && HAVE_PORT_CREATE # ifndef EV_USE_PORT # define EV_USE_PORT EV_FEATURE_BACKENDS # endif # else # undef EV_USE_PORT # define EV_USE_PORT 0 # endif # if HAVE_INOTIFY_INIT && HAVE_SYS_INOTIFY_H # ifndef EV_USE_INOTIFY # define EV_USE_INOTIFY EV_FEATURE_OS # endif # else # undef EV_USE_INOTIFY # define EV_USE_INOTIFY 0 # endif # if HAVE_SIGNALFD && HAVE_SYS_SIGNALFD_H # ifndef EV_USE_SIGNALFD # define EV_USE_SIGNALFD EV_FEATURE_OS # endif # else # undef EV_USE_SIGNALFD # define EV_USE_SIGNALFD 0 # endif # if HAVE_EVENTFD # ifndef EV_USE_EVENTFD # define EV_USE_EVENTFD EV_FEATURE_OS # endif # else # undef EV_USE_EVENTFD # define EV_USE_EVENTFD 0 # endif # if HAVE_SYS_TIMERFD_H # ifndef EV_USE_TIMERFD # define EV_USE_TIMERFD EV_FEATURE_OS # endif # else # undef EV_USE_TIMERFD # define EV_USE_TIMERFD 0 # endif #endif /* OS X, in its infinite idiocy, actually HARDCODES * a limit of 1024 into their select. Where people have brains, * OS X engineers apparently have a vacuum. Or maybe they were * ordered to have a vacuum, or they do anything for money. * This might help. Or not. * Note that this must be defined early, as other include files * will rely on this define as well. */ #define _DARWIN_UNLIMITED_SELECT 1 #include #include #include #include #include #include #include #include #include #include #include #ifdef EV_H # include EV_H #else # include "ev.h" #endif #if EV_NO_THREADS # undef EV_NO_SMP # define EV_NO_SMP 1 # undef ECB_NO_THREADS # define ECB_NO_THREADS 1 #endif #if EV_NO_SMP # undef EV_NO_SMP # define ECB_NO_SMP 1 #endif #ifndef _WIN32 # include # include # include #else # include # define WIN32_LEAN_AND_MEAN # include # include # ifndef EV_SELECT_IS_WINSOCKET # define EV_SELECT_IS_WINSOCKET 1 # endif # undef EV_AVOID_STDIO #endif /* this block tries to deduce configuration from header-defined symbols and defaults */ /* try to deduce the maximum number of signals on this platform */ #if defined EV_NSIG /* use what's provided */ #elif defined NSIG # define EV_NSIG (NSIG) #elif defined _NSIG # define EV_NSIG (_NSIG) #elif defined SIGMAX # define EV_NSIG (SIGMAX+1) #elif defined SIG_MAX # define EV_NSIG (SIG_MAX+1) #elif defined _SIG_MAX # define EV_NSIG (_SIG_MAX+1) #elif defined MAXSIG # define EV_NSIG (MAXSIG+1) #elif defined MAX_SIG # define EV_NSIG (MAX_SIG+1) #elif defined SIGARRAYSIZE # define EV_NSIG (SIGARRAYSIZE) /* Assume ary[SIGARRAYSIZE] */ #elif defined _sys_nsig # define EV_NSIG (_sys_nsig) /* Solaris 2.5 */ #else # define EV_NSIG (8 * sizeof (sigset_t) + 1) #endif #ifndef EV_USE_FLOOR # define EV_USE_FLOOR 0 #endif #ifndef EV_USE_CLOCK_SYSCALL # if __linux && __GLIBC__ == 2 && __GLIBC_MINOR__ < 17 # define EV_USE_CLOCK_SYSCALL EV_FEATURE_OS # else # define EV_USE_CLOCK_SYSCALL 0 # endif #endif #if !(_POSIX_TIMERS > 0) # ifndef EV_USE_MONOTONIC # define EV_USE_MONOTONIC 0 # endif # ifndef EV_USE_REALTIME # define EV_USE_REALTIME 0 # endif #endif #ifndef EV_USE_MONOTONIC # if defined _POSIX_MONOTONIC_CLOCK && _POSIX_MONOTONIC_CLOCK >= 0 # define EV_USE_MONOTONIC EV_FEATURE_OS # else # define EV_USE_MONOTONIC 0 # endif #endif #ifndef EV_USE_REALTIME # define EV_USE_REALTIME !EV_USE_CLOCK_SYSCALL #endif #ifndef EV_USE_NANOSLEEP # if _POSIX_C_SOURCE >= 199309L # define EV_USE_NANOSLEEP EV_FEATURE_OS # else # define EV_USE_NANOSLEEP 0 # endif #endif #ifndef EV_USE_SELECT # define EV_USE_SELECT EV_FEATURE_BACKENDS #endif #ifndef EV_USE_POLL # ifdef _WIN32 # define EV_USE_POLL 0 # else # define EV_USE_POLL EV_FEATURE_BACKENDS # endif #endif #ifndef EV_USE_EPOLL # if __linux && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 4)) # define EV_USE_EPOLL EV_FEATURE_BACKENDS # else # define EV_USE_EPOLL 0 # endif #endif #ifndef EV_USE_KQUEUE # define EV_USE_KQUEUE 0 #endif #ifndef EV_USE_PORT # define EV_USE_PORT 0 #endif #ifndef EV_USE_LINUXAIO # if __linux /* libev currently assumes linux/aio_abi.h is always available on linux */ # define EV_USE_LINUXAIO 0 /* was: 1, always off by default */ # else # define EV_USE_LINUXAIO 0 # endif #endif #ifndef EV_USE_IOURING # if __linux /* later checks might disable again */ # define EV_USE_IOURING 1 # else # define EV_USE_IOURING 0 # endif #endif #ifndef EV_USE_INOTIFY # if __linux && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 4)) # define EV_USE_INOTIFY EV_FEATURE_OS # else # define EV_USE_INOTIFY 0 # endif #endif #ifndef EV_PID_HASHSIZE # define EV_PID_HASHSIZE EV_FEATURE_DATA ? 16 : 1 #endif #ifndef EV_INOTIFY_HASHSIZE # define EV_INOTIFY_HASHSIZE EV_FEATURE_DATA ? 16 : 1 #endif #ifndef EV_USE_EVENTFD # if __linux && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 7)) # define EV_USE_EVENTFD EV_FEATURE_OS # else # define EV_USE_EVENTFD 0 # endif #endif #ifndef EV_USE_SIGNALFD # if __linux && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 7)) # define EV_USE_SIGNALFD EV_FEATURE_OS # else # define EV_USE_SIGNALFD 0 # endif #endif #ifndef EV_USE_TIMERFD # if __linux && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8)) # define EV_USE_TIMERFD EV_FEATURE_OS # else # define EV_USE_TIMERFD 0 # endif #endif #if 0 /* debugging */ # define EV_VERIFY 3 # define EV_USE_4HEAP 1 # define EV_HEAP_CACHE_AT 1 #endif #ifndef EV_VERIFY # define EV_VERIFY (EV_FEATURE_API ? 1 : 0) #endif #ifndef EV_USE_4HEAP # define EV_USE_4HEAP EV_FEATURE_DATA #endif #ifndef EV_HEAP_CACHE_AT # define EV_HEAP_CACHE_AT EV_FEATURE_DATA #endif #ifdef __ANDROID__ /* supposedly, android doesn't typedef fd_mask */ # undef EV_USE_SELECT # define EV_USE_SELECT 0 /* supposedly, we need to include syscall.h, not sys/syscall.h, so just disable */ # undef EV_USE_CLOCK_SYSCALL # define EV_USE_CLOCK_SYSCALL 0 #endif /* aix's poll.h seems to cause lots of trouble */ #ifdef _AIX /* AIX has a completely broken poll.h header */ # undef EV_USE_POLL # define EV_USE_POLL 0 #endif /* on linux, we can use a (slow) syscall to avoid a dependency on pthread, */ /* which makes programs even slower. might work on other unices, too. */ #if EV_USE_CLOCK_SYSCALL # include # ifdef SYS_clock_gettime # define clock_gettime(id, ts) syscall (SYS_clock_gettime, (id), (ts)) # undef EV_USE_MONOTONIC # define EV_USE_MONOTONIC 1 # define EV_NEED_SYSCALL 1 # else # undef EV_USE_CLOCK_SYSCALL # define EV_USE_CLOCK_SYSCALL 0 # endif #endif /* this block fixes any misconfiguration where we know we run into trouble otherwise */ #ifndef CLOCK_MONOTONIC # undef EV_USE_MONOTONIC # define EV_USE_MONOTONIC 0 #endif #ifndef CLOCK_REALTIME # undef EV_USE_REALTIME # define EV_USE_REALTIME 0 #endif #if !EV_STAT_ENABLE # undef EV_USE_INOTIFY # define EV_USE_INOTIFY 0 #endif #if __linux && EV_USE_IOURING # include # if LINUX_VERSION_CODE < KERNEL_VERSION(4,14,0) # undef EV_USE_IOURING # define EV_USE_IOURING 0 # endif #endif #if !EV_USE_NANOSLEEP /* hp-ux has it in sys/time.h, which we unconditionally include above */ # if !defined _WIN32 && !defined __hpux # include # endif #endif #if EV_USE_LINUXAIO # include # if SYS_io_getevents && EV_USE_EPOLL /* linuxaio backend requires epoll backend */ # define EV_NEED_SYSCALL 1 # else # undef EV_USE_LINUXAIO # define EV_USE_LINUXAIO 0 # endif #endif #if EV_USE_IOURING # include # if !SYS_io_uring_setup && __linux && !__alpha # define SYS_io_uring_setup 425 # define SYS_io_uring_enter 426 # define SYS_io_uring_wregister 427 # endif # if SYS_io_uring_setup && EV_USE_EPOLL /* iouring backend requires epoll backend */ # define EV_NEED_SYSCALL 1 # else # undef EV_USE_IOURING # define EV_USE_IOURING 0 # endif #endif #if EV_USE_INOTIFY # include # include /* some very old inotify.h headers don't have IN_DONT_FOLLOW */ # ifndef IN_DONT_FOLLOW # undef EV_USE_INOTIFY # define EV_USE_INOTIFY 0 # endif #endif #if EV_USE_EVENTFD /* our minimum requirement is glibc 2.7 which has the stub, but not the full header */ # include # ifndef EFD_NONBLOCK # define EFD_NONBLOCK O_NONBLOCK # endif # ifndef EFD_CLOEXEC # ifdef O_CLOEXEC # define EFD_CLOEXEC O_CLOEXEC # else # define EFD_CLOEXEC 02000000 # endif # endif EV_CPP(extern "C") int (eventfd) (unsigned int initval, int flags); #endif #if EV_USE_SIGNALFD /* our minimum requirement is glibc 2.7 which has the stub, but not the full header */ # include # ifndef SFD_NONBLOCK # define SFD_NONBLOCK O_NONBLOCK # endif # ifndef SFD_CLOEXEC # ifdef O_CLOEXEC # define SFD_CLOEXEC O_CLOEXEC # else # define SFD_CLOEXEC 02000000 # endif # endif EV_CPP (extern "C") int (signalfd) (int fd, const sigset_t *mask, int flags); struct signalfd_siginfo { uint32_t ssi_signo; char pad[128 - sizeof (uint32_t)]; }; #endif /* for timerfd, libev core requires TFD_TIMER_CANCEL_ON_SET &c */ #if EV_USE_TIMERFD # include /* timerfd is only used for periodics */ # if !(defined (TFD_TIMER_CANCEL_ON_SET) && defined (TFD_CLOEXEC) && defined (TFD_NONBLOCK)) || !EV_PERIODIC_ENABLE # undef EV_USE_TIMERFD # define EV_USE_TIMERFD 0 # endif #endif /*****************************************************************************/ #if EV_VERIFY >= 3 # define EV_FREQUENT_CHECK ev_verify (EV_A) #else # define EV_FREQUENT_CHECK do { } while (0) #endif /* * This is used to work around floating point rounding problems. * This value is good at least till the year 4000. */ #define MIN_INTERVAL 0.0001220703125 /* 1/2**13, good till 4000 */ /*#define MIN_INTERVAL 0.00000095367431640625 * 1/2**20, good till 2200 */ #define MIN_TIMEJUMP 1. /* minimum timejump that gets detected (if monotonic clock available) */ #define MAX_BLOCKTIME 59.743 /* never wait longer than this time (to detect time jumps) */ #define MAX_BLOCKTIME2 1500001.07 /* same, but when timerfd is used to detect jumps, also safe delay to not overflow */ /* find a portable timestamp that is "always" in the future but fits into time_t. * this is quite hard, and we are mostly guessing - we handle 32 bit signed/unsigned time_t, * and sizes larger than 32 bit, and maybe the unlikely floating point time_t */ #define EV_TSTAMP_HUGE \ (sizeof (time_t) >= 8 ? 10000000000000. \ : 0 < (time_t)4294967295 ? 4294967295. \ : 2147483647.) \ #ifndef EV_TS_CONST # define EV_TS_CONST(nv) nv # define EV_TS_TO_MSEC(a) a * 1e3 + 0.9999 # define EV_TS_FROM_USEC(us) us * 1e-6 # define EV_TV_SET(tv,t) do { tv.tv_sec = (long)t; tv.tv_usec = (long)((t - tv.tv_sec) * 1e6); } while (0) # define EV_TS_SET(ts,t) do { ts.tv_sec = (long)t; ts.tv_nsec = (long)((t - ts.tv_sec) * 1e9); } while (0) # define EV_TV_GET(tv) ((tv).tv_sec + (tv).tv_usec * 1e-6) # define EV_TS_GET(ts) ((ts).tv_sec + (ts).tv_nsec * 1e-9) #endif /* the following is ecb.h embedded into libev - use update_ev_c to update from an external copy */ /* ECB.H BEGIN */ /* * libecb - http://software.schmorp.de/pkg/libecb * * Copyright (©) 2009-2015,2018-2020 Marc Alexander Lehmann * Copyright (©) 2011 Emanuele Giaquinta * All rights reserved. * * Redistribution and use in source and binary forms, with or without modifica- * tion, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MER- * CHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPE- * CIAL, 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 OTH- * ERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, the contents of this file may be used under the terms of * the GNU General Public License ("GPL") version 2 or any later version, * in which case the provisions of the GPL are applicable instead of * the above. If you wish to allow the use of your version of this file * only under the terms of the GPL and not to allow others to use your * version of this file under the BSD license, indicate your decision * by deleting the provisions above and replace them with the notice * and other provisions required by the GPL. If you do not delete the * provisions above, a recipient may use your version of this file under * either the BSD or the GPL. */ #ifndef ECB_H #define ECB_H /* 16 bits major, 16 bits minor */ #define ECB_VERSION 0x00010008 #include /* for memcpy */ #if defined (_WIN32) && !defined (__MINGW32__) typedef signed char int8_t; typedef unsigned char uint8_t; typedef signed char int_fast8_t; typedef unsigned char uint_fast8_t; typedef signed short int16_t; typedef unsigned short uint16_t; typedef signed int int_fast16_t; typedef unsigned int uint_fast16_t; typedef signed int int32_t; typedef unsigned int uint32_t; typedef signed int int_fast32_t; typedef unsigned int uint_fast32_t; #if __GNUC__ typedef signed long long int64_t; typedef unsigned long long uint64_t; #else /* _MSC_VER || __BORLANDC__ */ typedef signed __int64 int64_t; typedef unsigned __int64 uint64_t; #endif typedef int64_t int_fast64_t; typedef uint64_t uint_fast64_t; #ifdef _WIN64 #define ECB_PTRSIZE 8 typedef uint64_t uintptr_t; typedef int64_t intptr_t; #else #define ECB_PTRSIZE 4 typedef uint32_t uintptr_t; typedef int32_t intptr_t; #endif #else #include #if (defined INTPTR_MAX ? INTPTR_MAX : ULONG_MAX) > 0xffffffffU #define ECB_PTRSIZE 8 #else #define ECB_PTRSIZE 4 #endif #endif #define ECB_GCC_AMD64 (__amd64 || __amd64__ || __x86_64 || __x86_64__) #define ECB_MSVC_AMD64 (_M_AMD64 || _M_X64) #ifndef ECB_OPTIMIZE_SIZE #if __OPTIMIZE_SIZE__ #define ECB_OPTIMIZE_SIZE 1 #else #define ECB_OPTIMIZE_SIZE 0 #endif #endif /* work around x32 idiocy by defining proper macros */ #if ECB_GCC_AMD64 || ECB_MSVC_AMD64 #if _ILP32 #define ECB_AMD64_X32 1 #else #define ECB_AMD64 1 #endif #endif /* many compilers define _GNUC_ to some versions but then only implement * what their idiot authors think are the "more important" extensions, * causing enormous grief in return for some better fake benchmark numbers. * or so. * we try to detect these and simply assume they are not gcc - if they have * an issue with that they should have done it right in the first place. */ #if !defined __GNUC_MINOR__ || defined __INTEL_COMPILER || defined __SUNPRO_C || defined __SUNPRO_CC || defined __llvm__ || defined __clang__ #define ECB_GCC_VERSION(major,minor) 0 #else #define ECB_GCC_VERSION(major,minor) (__GNUC__ > (major) || (__GNUC__ == (major) && __GNUC_MINOR__ >= (minor))) #endif #define ECB_CLANG_VERSION(major,minor) (__clang_major__ > (major) || (__clang_major__ == (major) && __clang_minor__ >= (minor))) #if __clang__ && defined __has_builtin #define ECB_CLANG_BUILTIN(x) __has_builtin (x) #else #define ECB_CLANG_BUILTIN(x) 0 #endif #if __clang__ && defined __has_extension #define ECB_CLANG_EXTENSION(x) __has_extension (x) #else #define ECB_CLANG_EXTENSION(x) 0 #endif #define ECB_CPP (__cplusplus+0) #define ECB_CPP11 (__cplusplus >= 201103L) #define ECB_CPP14 (__cplusplus >= 201402L) #define ECB_CPP17 (__cplusplus >= 201703L) #if ECB_CPP #define ECB_C 0 #define ECB_STDC_VERSION 0 #else #define ECB_C 1 #define ECB_STDC_VERSION __STDC_VERSION__ #endif #define ECB_C99 (ECB_STDC_VERSION >= 199901L) #define ECB_C11 (ECB_STDC_VERSION >= 201112L) #define ECB_C17 (ECB_STDC_VERSION >= 201710L) #if ECB_CPP #define ECB_EXTERN_C extern "C" #define ECB_EXTERN_C_BEG ECB_EXTERN_C { #define ECB_EXTERN_C_END } #else #define ECB_EXTERN_C extern #define ECB_EXTERN_C_BEG #define ECB_EXTERN_C_END #endif /*****************************************************************************/ /* ECB_NO_THREADS - ecb is not used by multiple threads, ever */ /* ECB_NO_SMP - ecb might be used in multiple threads, but only on a single cpu */ #if ECB_NO_THREADS #define ECB_NO_SMP 1 #endif #if ECB_NO_SMP #define ECB_MEMORY_FENCE do { } while (0) #endif /* http://www-01.ibm.com/support/knowledgecenter/SSGH3R_13.1.0/com.ibm.xlcpp131.aix.doc/compiler_ref/compiler_builtins.html */ #if __xlC__ && ECB_CPP #include #endif #if 1400 <= _MSC_VER #include /* fence functions _ReadBarrier, also bit search functions _BitScanReverse */ #endif #ifndef ECB_MEMORY_FENCE #if ECB_GCC_VERSION(2,5) || defined __INTEL_COMPILER || (__llvm__ && __GNUC__) || __SUNPRO_C >= 0x5110 || __SUNPRO_CC >= 0x5110 #define ECB_MEMORY_FENCE_RELAXED __asm__ __volatile__ ("" : : : "memory") #if __i386 || __i386__ #define ECB_MEMORY_FENCE __asm__ __volatile__ ("lock; orb $0, -1(%%esp)" : : : "memory") #define ECB_MEMORY_FENCE_ACQUIRE __asm__ __volatile__ ("" : : : "memory") #define ECB_MEMORY_FENCE_RELEASE __asm__ __volatile__ ("" : : : "memory") #elif ECB_GCC_AMD64 #define ECB_MEMORY_FENCE __asm__ __volatile__ ("mfence" : : : "memory") #define ECB_MEMORY_FENCE_ACQUIRE __asm__ __volatile__ ("" : : : "memory") #define ECB_MEMORY_FENCE_RELEASE __asm__ __volatile__ ("" : : : "memory") #elif __powerpc__ || __ppc__ || __powerpc64__ || __ppc64__ #define ECB_MEMORY_FENCE __asm__ __volatile__ ("sync" : : : "memory") #elif defined __ARM_ARCH_2__ \ || defined __ARM_ARCH_3__ || defined __ARM_ARCH_3M__ \ || defined __ARM_ARCH_4__ || defined __ARM_ARCH_4T__ \ || defined __ARM_ARCH_5__ || defined __ARM_ARCH_5E__ \ || defined __ARM_ARCH_5T__ || defined __ARM_ARCH_5TE__ \ || defined __ARM_ARCH_5TEJ__ /* should not need any, unless running old code on newer cpu - arm doesn't support that */ #elif defined __ARM_ARCH_6__ || defined __ARM_ARCH_6J__ \ || defined __ARM_ARCH_6K__ || defined __ARM_ARCH_6ZK__ \ || defined __ARM_ARCH_6T2__ #define ECB_MEMORY_FENCE __asm__ __volatile__ ("mcr p15,0,%0,c7,c10,5" : : "r" (0) : "memory") #elif defined __ARM_ARCH_7__ || defined __ARM_ARCH_7A__ \ || defined __ARM_ARCH_7R__ || defined __ARM_ARCH_7M__ #define ECB_MEMORY_FENCE __asm__ __volatile__ ("dmb" : : : "memory") #elif __aarch64__ #define ECB_MEMORY_FENCE __asm__ __volatile__ ("dmb ish" : : : "memory") #elif (__sparc || __sparc__) && !(__sparc_v8__ || defined __sparcv8) #define ECB_MEMORY_FENCE __asm__ __volatile__ ("membar #LoadStore | #LoadLoad | #StoreStore | #StoreLoad" : : : "memory") #define ECB_MEMORY_FENCE_ACQUIRE __asm__ __volatile__ ("membar #LoadStore | #LoadLoad" : : : "memory") #define ECB_MEMORY_FENCE_RELEASE __asm__ __volatile__ ("membar #LoadStore | #StoreStore") #elif defined __s390__ || defined __s390x__ #define ECB_MEMORY_FENCE __asm__ __volatile__ ("bcr 15,0" : : : "memory") #elif defined __mips__ /* GNU/Linux emulates sync on mips1 architectures, so we force its use */ /* anybody else who still uses mips1 is supposed to send in their version, with detection code. */ #define ECB_MEMORY_FENCE __asm__ __volatile__ (".set mips2; sync; .set mips0" : : : "memory") #elif defined __alpha__ #define ECB_MEMORY_FENCE __asm__ __volatile__ ("mb" : : : "memory") #elif defined __hppa__ #define ECB_MEMORY_FENCE __asm__ __volatile__ ("" : : : "memory") #define ECB_MEMORY_FENCE_RELEASE __asm__ __volatile__ ("") #elif defined __ia64__ #define ECB_MEMORY_FENCE __asm__ __volatile__ ("mf" : : : "memory") #elif defined __m68k__ #define ECB_MEMORY_FENCE __asm__ __volatile__ ("" : : : "memory") #elif defined __m88k__ #define ECB_MEMORY_FENCE __asm__ __volatile__ ("tb1 0,%%r0,128" : : : "memory") #elif defined __sh__ #define ECB_MEMORY_FENCE __asm__ __volatile__ ("" : : : "memory") #endif #endif #endif #ifndef ECB_MEMORY_FENCE #if ECB_GCC_VERSION(4,7) /* see comment below (stdatomic.h) about the C11 memory model. */ #define ECB_MEMORY_FENCE __atomic_thread_fence (__ATOMIC_SEQ_CST) #define ECB_MEMORY_FENCE_ACQUIRE __atomic_thread_fence (__ATOMIC_ACQUIRE) #define ECB_MEMORY_FENCE_RELEASE __atomic_thread_fence (__ATOMIC_RELEASE) #define ECB_MEMORY_FENCE_RELAXED __atomic_thread_fence (__ATOMIC_RELAXED) #elif ECB_CLANG_EXTENSION(c_atomic) /* see comment below (stdatomic.h) about the C11 memory model. */ #define ECB_MEMORY_FENCE __c11_atomic_thread_fence (__ATOMIC_SEQ_CST) #define ECB_MEMORY_FENCE_ACQUIRE __c11_atomic_thread_fence (__ATOMIC_ACQUIRE) #define ECB_MEMORY_FENCE_RELEASE __c11_atomic_thread_fence (__ATOMIC_RELEASE) #define ECB_MEMORY_FENCE_RELAXED __c11_atomic_thread_fence (__ATOMIC_RELAXED) #elif ECB_GCC_VERSION(4,4) || defined __INTEL_COMPILER || defined __clang__ #define ECB_MEMORY_FENCE __sync_synchronize () #elif _MSC_VER >= 1500 /* VC++ 2008 */ /* apparently, microsoft broke all the memory barrier stuff in Visual Studio 2008... */ #pragma intrinsic(_ReadBarrier,_WriteBarrier,_ReadWriteBarrier) #define ECB_MEMORY_FENCE _ReadWriteBarrier (); MemoryBarrier() #define ECB_MEMORY_FENCE_ACQUIRE _ReadWriteBarrier (); MemoryBarrier() /* according to msdn, _ReadBarrier is not a load fence */ #define ECB_MEMORY_FENCE_RELEASE _WriteBarrier (); MemoryBarrier() #elif _MSC_VER >= 1400 /* VC++ 2005 */ #pragma intrinsic(_ReadBarrier,_WriteBarrier,_ReadWriteBarrier) #define ECB_MEMORY_FENCE _ReadWriteBarrier () #define ECB_MEMORY_FENCE_ACQUIRE _ReadWriteBarrier () /* according to msdn, _ReadBarrier is not a load fence */ #define ECB_MEMORY_FENCE_RELEASE _WriteBarrier () #elif defined _WIN32 #include #define ECB_MEMORY_FENCE MemoryBarrier () /* actually just xchg on x86... scary */ #elif __SUNPRO_C >= 0x5110 || __SUNPRO_CC >= 0x5110 #include #define ECB_MEMORY_FENCE __machine_rw_barrier () #define ECB_MEMORY_FENCE_ACQUIRE __machine_acq_barrier () #define ECB_MEMORY_FENCE_RELEASE __machine_rel_barrier () #define ECB_MEMORY_FENCE_RELAXED __compiler_barrier () #elif __xlC__ #define ECB_MEMORY_FENCE __sync () #endif #endif #ifndef ECB_MEMORY_FENCE #if ECB_C11 && !defined __STDC_NO_ATOMICS__ /* we assume that these memory fences work on all variables/all memory accesses, */ /* not just C11 atomics and atomic accesses */ #include #define ECB_MEMORY_FENCE atomic_thread_fence (memory_order_seq_cst) #define ECB_MEMORY_FENCE_ACQUIRE atomic_thread_fence (memory_order_acquire) #define ECB_MEMORY_FENCE_RELEASE atomic_thread_fence (memory_order_release) #endif #endif #ifndef ECB_MEMORY_FENCE #if !ECB_AVOID_PTHREADS /* * if you get undefined symbol references to pthread_mutex_lock, * or failure to find pthread.h, then you should implement * the ECB_MEMORY_FENCE operations for your cpu/compiler * OR provide pthread.h and link against the posix thread library * of your system. */ #include #define ECB_NEEDS_PTHREADS 1 #define ECB_MEMORY_FENCE_NEEDS_PTHREADS 1 static pthread_mutex_t ecb_mf_lock = PTHREAD_MUTEX_INITIALIZER; #define ECB_MEMORY_FENCE do { pthread_mutex_lock (&ecb_mf_lock); pthread_mutex_unlock (&ecb_mf_lock); } while (0) #endif #endif #if !defined ECB_MEMORY_FENCE_ACQUIRE && defined ECB_MEMORY_FENCE #define ECB_MEMORY_FENCE_ACQUIRE ECB_MEMORY_FENCE #endif #if !defined ECB_MEMORY_FENCE_RELEASE && defined ECB_MEMORY_FENCE #define ECB_MEMORY_FENCE_RELEASE ECB_MEMORY_FENCE #endif #if !defined ECB_MEMORY_FENCE_RELAXED && defined ECB_MEMORY_FENCE #define ECB_MEMORY_FENCE_RELAXED ECB_MEMORY_FENCE /* very heavy-handed */ #endif /*****************************************************************************/ #if ECB_CPP #define ecb_inline static inline #elif ECB_GCC_VERSION(2,5) #define ecb_inline static __inline__ #elif ECB_C99 #define ecb_inline static inline #else #define ecb_inline static #endif #if ECB_GCC_VERSION(3,3) #define ecb_restrict __restrict__ #elif ECB_C99 #define ecb_restrict restrict #else #define ecb_restrict #endif typedef int ecb_bool; #define ECB_CONCAT_(a, b) a ## b #define ECB_CONCAT(a, b) ECB_CONCAT_(a, b) #define ECB_STRINGIFY_(a) # a #define ECB_STRINGIFY(a) ECB_STRINGIFY_(a) #define ECB_STRINGIFY_EXPR(expr) ((expr), ECB_STRINGIFY_ (expr)) #define ecb_function_ ecb_inline #if ECB_GCC_VERSION(3,1) || ECB_CLANG_VERSION(2,8) #define ecb_attribute(attrlist) __attribute__ (attrlist) #else #define ecb_attribute(attrlist) #endif #if ECB_GCC_VERSION(3,1) || ECB_CLANG_BUILTIN(__builtin_constant_p) #define ecb_is_constant(expr) __builtin_constant_p (expr) #else /* possible C11 impl for integral types typedef struct ecb_is_constant_struct ecb_is_constant_struct; #define ecb_is_constant(expr) _Generic ((1 ? (struct ecb_is_constant_struct *)0 : (void *)((expr) - (expr)), ecb_is_constant_struct *: 0, default: 1)) */ #define ecb_is_constant(expr) 0 #endif #if ECB_GCC_VERSION(3,1) || ECB_CLANG_BUILTIN(__builtin_expect) #define ecb_expect(expr,value) __builtin_expect ((expr),(value)) #else #define ecb_expect(expr,value) (expr) #endif #if ECB_GCC_VERSION(3,1) || ECB_CLANG_BUILTIN(__builtin_prefetch) #define ecb_prefetch(addr,rw,locality) __builtin_prefetch (addr, rw, locality) #else #define ecb_prefetch(addr,rw,locality) #endif /* no emulation for ecb_decltype */ #if ECB_CPP11 // older implementations might have problems with decltype(x)::type, work around it template struct ecb_decltype_t { typedef T type; }; #define ecb_decltype(x) ecb_decltype_t::type #elif ECB_GCC_VERSION(3,0) || ECB_CLANG_VERSION(2,8) #define ecb_decltype(x) __typeof__ (x) #endif #if _MSC_VER >= 1300 #define ecb_deprecated __declspec (deprecated) #else #define ecb_deprecated ecb_attribute ((__deprecated__)) #endif #if _MSC_VER >= 1500 #define ecb_deprecated_message(msg) __declspec (deprecated (msg)) #elif ECB_GCC_VERSION(4,5) #define ecb_deprecated_message(msg) ecb_attribute ((__deprecated__ (msg)) #else #define ecb_deprecated_message(msg) ecb_deprecated #endif #if _MSC_VER >= 1400 #define ecb_noinline __declspec (noinline) #else #define ecb_noinline ecb_attribute ((__noinline__)) #endif #define ecb_unused ecb_attribute ((__unused__)) #define ecb_const ecb_attribute ((__const__)) #define ecb_pure ecb_attribute ((__pure__)) #if ECB_C11 || __IBMC_NORETURN /* http://www-01.ibm.com/support/knowledgecenter/SSGH3R_13.1.0/com.ibm.xlcpp131.aix.doc/language_ref/noreturn.html */ #define ecb_noreturn _Noreturn #elif ECB_CPP11 #define ecb_noreturn [[noreturn]] #elif _MSC_VER >= 1200 /* http://msdn.microsoft.com/en-us/library/k6ktzx3s.aspx */ #define ecb_noreturn __declspec (noreturn) #else #define ecb_noreturn ecb_attribute ((__noreturn__)) #endif #if ECB_GCC_VERSION(4,3) #define ecb_artificial ecb_attribute ((__artificial__)) #define ecb_hot ecb_attribute ((__hot__)) #define ecb_cold #else #define ecb_artificial #define ecb_hot #define ecb_cold #endif /* put around conditional expressions if you are very sure that the */ /* expression is mostly true or mostly false. note that these return */ /* booleans, not the expression. */ #define ecb_expect_false(expr) ecb_expect (!!(expr), 0) #define ecb_expect_true(expr) ecb_expect (!!(expr), 1) /* for compatibility to the rest of the world */ #define ecb_likely(expr) ecb_expect_true (expr) #define ecb_unlikely(expr) ecb_expect_false (expr) /* count trailing zero bits and count # of one bits */ #if ECB_GCC_VERSION(3,4) \ || (ECB_CLANG_BUILTIN(__builtin_clz) && ECB_CLANG_BUILTIN(__builtin_clzll) \ && ECB_CLANG_BUILTIN(__builtin_ctz) && ECB_CLANG_BUILTIN(__builtin_ctzll) \ && ECB_CLANG_BUILTIN(__builtin_popcount)) /* we assume int == 32 bit, long == 32 or 64 bit and long long == 64 bit */ #define ecb_ld32(x) (__builtin_clz (x) ^ 31) #define ecb_ld64(x) (__builtin_clzll (x) ^ 63) #define ecb_ctz32(x) __builtin_ctz (x) #define ecb_ctz64(x) __builtin_ctzll (x) #define ecb_popcount32(x) __builtin_popcount (x) /* no popcountll */ #else ecb_function_ ecb_const int ecb_ctz32 (uint32_t x); ecb_function_ ecb_const int ecb_ctz32 (uint32_t x) { #if 1400 <= _MSC_VER && (_M_IX86 || _M_X64 || _M_IA64 || _M_ARM) unsigned long r; _BitScanForward (&r, x); return (int)r; #else int r = 0; x &= ~x + 1; /* this isolates the lowest bit */ #if ECB_branchless_on_i386 r += !!(x & 0xaaaaaaaa) << 0; r += !!(x & 0xcccccccc) << 1; r += !!(x & 0xf0f0f0f0) << 2; r += !!(x & 0xff00ff00) << 3; r += !!(x & 0xffff0000) << 4; #else if (x & 0xaaaaaaaa) r += 1; if (x & 0xcccccccc) r += 2; if (x & 0xf0f0f0f0) r += 4; if (x & 0xff00ff00) r += 8; if (x & 0xffff0000) r += 16; #endif return r; #endif } ecb_function_ ecb_const int ecb_ctz64 (uint64_t x); ecb_function_ ecb_const int ecb_ctz64 (uint64_t x) { #if 1400 <= _MSC_VER && (_M_X64 || _M_IA64 || _M_ARM) unsigned long r; _BitScanForward64 (&r, x); return (int)r; #else int shift = x & 0xffffffff ? 0 : 32; return ecb_ctz32 (x >> shift) + shift; #endif } ecb_function_ ecb_const int ecb_popcount32 (uint32_t x); ecb_function_ ecb_const int ecb_popcount32 (uint32_t x) { x -= (x >> 1) & 0x55555555; x = ((x >> 2) & 0x33333333) + (x & 0x33333333); x = ((x >> 4) + x) & 0x0f0f0f0f; x *= 0x01010101; return x >> 24; } ecb_function_ ecb_const int ecb_ld32 (uint32_t x); ecb_function_ ecb_const int ecb_ld32 (uint32_t x) { #if 1400 <= _MSC_VER && (_M_IX86 || _M_X64 || _M_IA64 || _M_ARM) unsigned long r; _BitScanReverse (&r, x); return (int)r; #else int r = 0; if (x >> 16) { x >>= 16; r += 16; } if (x >> 8) { x >>= 8; r += 8; } if (x >> 4) { x >>= 4; r += 4; } if (x >> 2) { x >>= 2; r += 2; } if (x >> 1) { r += 1; } return r; #endif } ecb_function_ ecb_const int ecb_ld64 (uint64_t x); ecb_function_ ecb_const int ecb_ld64 (uint64_t x) { #if 1400 <= _MSC_VER && (_M_X64 || _M_IA64 || _M_ARM) unsigned long r; _BitScanReverse64 (&r, x); return (int)r; #else int r = 0; if (x >> 32) { x >>= 32; r += 32; } return r + ecb_ld32 (x); #endif } #endif ecb_function_ ecb_const ecb_bool ecb_is_pot32 (uint32_t x); ecb_function_ ecb_const ecb_bool ecb_is_pot32 (uint32_t x) { return !(x & (x - 1)); } ecb_function_ ecb_const ecb_bool ecb_is_pot64 (uint64_t x); ecb_function_ ecb_const ecb_bool ecb_is_pot64 (uint64_t x) { return !(x & (x - 1)); } ecb_function_ ecb_const uint8_t ecb_bitrev8 (uint8_t x); ecb_function_ ecb_const uint8_t ecb_bitrev8 (uint8_t x) { return ( (x * 0x0802U & 0x22110U) | (x * 0x8020U & 0x88440U)) * 0x10101U >> 16; } ecb_function_ ecb_const uint16_t ecb_bitrev16 (uint16_t x); ecb_function_ ecb_const uint16_t ecb_bitrev16 (uint16_t x) { x = ((x >> 1) & 0x5555) | ((x & 0x5555) << 1); x = ((x >> 2) & 0x3333) | ((x & 0x3333) << 2); x = ((x >> 4) & 0x0f0f) | ((x & 0x0f0f) << 4); x = ( x >> 8 ) | ( x << 8); return x; } ecb_function_ ecb_const uint32_t ecb_bitrev32 (uint32_t x); ecb_function_ ecb_const uint32_t ecb_bitrev32 (uint32_t x) { x = ((x >> 1) & 0x55555555) | ((x & 0x55555555) << 1); x = ((x >> 2) & 0x33333333) | ((x & 0x33333333) << 2); x = ((x >> 4) & 0x0f0f0f0f) | ((x & 0x0f0f0f0f) << 4); x = ((x >> 8) & 0x00ff00ff) | ((x & 0x00ff00ff) << 8); x = ( x >> 16 ) | ( x << 16); return x; } /* popcount64 is only available on 64 bit cpus as gcc builtin */ /* so for this version we are lazy */ ecb_function_ ecb_const int ecb_popcount64 (uint64_t x); ecb_function_ ecb_const int ecb_popcount64 (uint64_t x) { return ecb_popcount32 (x) + ecb_popcount32 (x >> 32); } ecb_inline ecb_const uint8_t ecb_rotl8 (uint8_t x, unsigned int count); ecb_inline ecb_const uint8_t ecb_rotr8 (uint8_t x, unsigned int count); ecb_inline ecb_const uint16_t ecb_rotl16 (uint16_t x, unsigned int count); ecb_inline ecb_const uint16_t ecb_rotr16 (uint16_t x, unsigned int count); ecb_inline ecb_const uint32_t ecb_rotl32 (uint32_t x, unsigned int count); ecb_inline ecb_const uint32_t ecb_rotr32 (uint32_t x, unsigned int count); ecb_inline ecb_const uint64_t ecb_rotl64 (uint64_t x, unsigned int count); ecb_inline ecb_const uint64_t ecb_rotr64 (uint64_t x, unsigned int count); ecb_inline ecb_const uint8_t ecb_rotl8 (uint8_t x, unsigned int count) { return (x >> ( 8 - count)) | (x << count); } ecb_inline ecb_const uint8_t ecb_rotr8 (uint8_t x, unsigned int count) { return (x << ( 8 - count)) | (x >> count); } ecb_inline ecb_const uint16_t ecb_rotl16 (uint16_t x, unsigned int count) { return (x >> (16 - count)) | (x << count); } ecb_inline ecb_const uint16_t ecb_rotr16 (uint16_t x, unsigned int count) { return (x << (16 - count)) | (x >> count); } ecb_inline ecb_const uint32_t ecb_rotl32 (uint32_t x, unsigned int count) { return (x >> (32 - count)) | (x << count); } ecb_inline ecb_const uint32_t ecb_rotr32 (uint32_t x, unsigned int count) { return (x << (32 - count)) | (x >> count); } ecb_inline ecb_const uint64_t ecb_rotl64 (uint64_t x, unsigned int count) { return (x >> (64 - count)) | (x << count); } ecb_inline ecb_const uint64_t ecb_rotr64 (uint64_t x, unsigned int count) { return (x << (64 - count)) | (x >> count); } #if ECB_CPP inline uint8_t ecb_ctz (uint8_t v) { return ecb_ctz32 (v); } inline uint16_t ecb_ctz (uint16_t v) { return ecb_ctz32 (v); } inline uint32_t ecb_ctz (uint32_t v) { return ecb_ctz32 (v); } inline uint64_t ecb_ctz (uint64_t v) { return ecb_ctz64 (v); } inline bool ecb_is_pot (uint8_t v) { return ecb_is_pot32 (v); } inline bool ecb_is_pot (uint16_t v) { return ecb_is_pot32 (v); } inline bool ecb_is_pot (uint32_t v) { return ecb_is_pot32 (v); } inline bool ecb_is_pot (uint64_t v) { return ecb_is_pot64 (v); } inline int ecb_ld (uint8_t v) { return ecb_ld32 (v); } inline int ecb_ld (uint16_t v) { return ecb_ld32 (v); } inline int ecb_ld (uint32_t v) { return ecb_ld32 (v); } inline int ecb_ld (uint64_t v) { return ecb_ld64 (v); } inline int ecb_popcount (uint8_t v) { return ecb_popcount32 (v); } inline int ecb_popcount (uint16_t v) { return ecb_popcount32 (v); } inline int ecb_popcount (uint32_t v) { return ecb_popcount32 (v); } inline int ecb_popcount (uint64_t v) { return ecb_popcount64 (v); } inline uint8_t ecb_bitrev (uint8_t v) { return ecb_bitrev8 (v); } inline uint16_t ecb_bitrev (uint16_t v) { return ecb_bitrev16 (v); } inline uint32_t ecb_bitrev (uint32_t v) { return ecb_bitrev32 (v); } inline uint8_t ecb_rotl (uint8_t v, unsigned int count) { return ecb_rotl8 (v, count); } inline uint16_t ecb_rotl (uint16_t v, unsigned int count) { return ecb_rotl16 (v, count); } inline uint32_t ecb_rotl (uint32_t v, unsigned int count) { return ecb_rotl32 (v, count); } inline uint64_t ecb_rotl (uint64_t v, unsigned int count) { return ecb_rotl64 (v, count); } inline uint8_t ecb_rotr (uint8_t v, unsigned int count) { return ecb_rotr8 (v, count); } inline uint16_t ecb_rotr (uint16_t v, unsigned int count) { return ecb_rotr16 (v, count); } inline uint32_t ecb_rotr (uint32_t v, unsigned int count) { return ecb_rotr32 (v, count); } inline uint64_t ecb_rotr (uint64_t v, unsigned int count) { return ecb_rotr64 (v, count); } #endif #if ECB_GCC_VERSION(4,3) || (ECB_CLANG_BUILTIN(__builtin_bswap32) && ECB_CLANG_BUILTIN(__builtin_bswap64)) #if ECB_GCC_VERSION(4,8) || ECB_CLANG_BUILTIN(__builtin_bswap16) #define ecb_bswap16(x) __builtin_bswap16 (x) #else #define ecb_bswap16(x) (__builtin_bswap32 (x) >> 16) #endif #define ecb_bswap32(x) __builtin_bswap32 (x) #define ecb_bswap64(x) __builtin_bswap64 (x) #elif _MSC_VER #include #define ecb_bswap16(x) ((uint16_t)_byteswap_ushort ((uint16_t)(x))) #define ecb_bswap32(x) ((uint32_t)_byteswap_ulong ((uint32_t)(x))) #define ecb_bswap64(x) ((uint64_t)_byteswap_uint64 ((uint64_t)(x))) #else ecb_function_ ecb_const uint16_t ecb_bswap16 (uint16_t x); ecb_function_ ecb_const uint16_t ecb_bswap16 (uint16_t x) { return ecb_rotl16 (x, 8); } ecb_function_ ecb_const uint32_t ecb_bswap32 (uint32_t x); ecb_function_ ecb_const uint32_t ecb_bswap32 (uint32_t x) { return (((uint32_t)ecb_bswap16 (x)) << 16) | ecb_bswap16 (x >> 16); } ecb_function_ ecb_const uint64_t ecb_bswap64 (uint64_t x); ecb_function_ ecb_const uint64_t ecb_bswap64 (uint64_t x) { return (((uint64_t)ecb_bswap32 (x)) << 32) | ecb_bswap32 (x >> 32); } #endif #if ECB_GCC_VERSION(4,5) || ECB_CLANG_BUILTIN(__builtin_unreachable) #define ecb_unreachable() __builtin_unreachable () #else /* this seems to work fine, but gcc always emits a warning for it :/ */ ecb_inline ecb_noreturn void ecb_unreachable (void); ecb_inline ecb_noreturn void ecb_unreachable (void) { } #endif /* try to tell the compiler that some condition is definitely true */ #define ecb_assume(cond) if (!(cond)) ecb_unreachable (); else 0 ecb_inline ecb_const uint32_t ecb_byteorder_helper (void); ecb_inline ecb_const uint32_t ecb_byteorder_helper (void) { /* the union code still generates code under pressure in gcc, */ /* but less than using pointers, and always seems to */ /* successfully return a constant. */ /* the reason why we have this horrible preprocessor mess */ /* is to avoid it in all cases, at least on common architectures */ /* or when using a recent enough gcc version (>= 4.6) */ #if (defined __BYTE_ORDER__ && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) \ || ((__i386 || __i386__ || _M_IX86 || ECB_GCC_AMD64 || ECB_MSVC_AMD64) && !__VOS__) #define ECB_LITTLE_ENDIAN 1 return 0x44332211; #elif (defined __BYTE_ORDER__ && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) \ || ((__AARCH64EB__ || __MIPSEB__ || __ARMEB__) && !__VOS__) #define ECB_BIG_ENDIAN 1 return 0x11223344; #else union { uint8_t c[4]; uint32_t u; } u = { 0x11, 0x22, 0x33, 0x44 }; return u.u; #endif } ecb_inline ecb_const ecb_bool ecb_big_endian (void); ecb_inline ecb_const ecb_bool ecb_big_endian (void) { return ecb_byteorder_helper () == 0x11223344; } ecb_inline ecb_const ecb_bool ecb_little_endian (void); ecb_inline ecb_const ecb_bool ecb_little_endian (void) { return ecb_byteorder_helper () == 0x44332211; } /*****************************************************************************/ /* unaligned load/store */ ecb_inline uint_fast16_t ecb_be_u16_to_host (uint_fast16_t v) { return ecb_little_endian () ? ecb_bswap16 (v) : v; } ecb_inline uint_fast32_t ecb_be_u32_to_host (uint_fast32_t v) { return ecb_little_endian () ? ecb_bswap32 (v) : v; } ecb_inline uint_fast64_t ecb_be_u64_to_host (uint_fast64_t v) { return ecb_little_endian () ? ecb_bswap64 (v) : v; } ecb_inline uint_fast16_t ecb_le_u16_to_host (uint_fast16_t v) { return ecb_big_endian () ? ecb_bswap16 (v) : v; } ecb_inline uint_fast32_t ecb_le_u32_to_host (uint_fast32_t v) { return ecb_big_endian () ? ecb_bswap32 (v) : v; } ecb_inline uint_fast64_t ecb_le_u64_to_host (uint_fast64_t v) { return ecb_big_endian () ? ecb_bswap64 (v) : v; } ecb_inline uint_fast16_t ecb_peek_u16_u (const void *ptr) { uint16_t v; memcpy (&v, ptr, sizeof (v)); return v; } ecb_inline uint_fast32_t ecb_peek_u32_u (const void *ptr) { uint32_t v; memcpy (&v, ptr, sizeof (v)); return v; } ecb_inline uint_fast64_t ecb_peek_u64_u (const void *ptr) { uint64_t v; memcpy (&v, ptr, sizeof (v)); return v; } ecb_inline uint_fast16_t ecb_peek_be_u16_u (const void *ptr) { return ecb_be_u16_to_host (ecb_peek_u16_u (ptr)); } ecb_inline uint_fast32_t ecb_peek_be_u32_u (const void *ptr) { return ecb_be_u32_to_host (ecb_peek_u32_u (ptr)); } ecb_inline uint_fast64_t ecb_peek_be_u64_u (const void *ptr) { return ecb_be_u64_to_host (ecb_peek_u64_u (ptr)); } ecb_inline uint_fast16_t ecb_peek_le_u16_u (const void *ptr) { return ecb_le_u16_to_host (ecb_peek_u16_u (ptr)); } ecb_inline uint_fast32_t ecb_peek_le_u32_u (const void *ptr) { return ecb_le_u32_to_host (ecb_peek_u32_u (ptr)); } ecb_inline uint_fast64_t ecb_peek_le_u64_u (const void *ptr) { return ecb_le_u64_to_host (ecb_peek_u64_u (ptr)); } ecb_inline uint_fast16_t ecb_host_to_be_u16 (uint_fast16_t v) { return ecb_little_endian () ? ecb_bswap16 (v) : v; } ecb_inline uint_fast32_t ecb_host_to_be_u32 (uint_fast32_t v) { return ecb_little_endian () ? ecb_bswap32 (v) : v; } ecb_inline uint_fast64_t ecb_host_to_be_u64 (uint_fast64_t v) { return ecb_little_endian () ? ecb_bswap64 (v) : v; } ecb_inline uint_fast16_t ecb_host_to_le_u16 (uint_fast16_t v) { return ecb_big_endian () ? ecb_bswap16 (v) : v; } ecb_inline uint_fast32_t ecb_host_to_le_u32 (uint_fast32_t v) { return ecb_big_endian () ? ecb_bswap32 (v) : v; } ecb_inline uint_fast64_t ecb_host_to_le_u64 (uint_fast64_t v) { return ecb_big_endian () ? ecb_bswap64 (v) : v; } ecb_inline void ecb_poke_u16_u (void *ptr, uint16_t v) { memcpy (ptr, &v, sizeof (v)); } ecb_inline void ecb_poke_u32_u (void *ptr, uint32_t v) { memcpy (ptr, &v, sizeof (v)); } ecb_inline void ecb_poke_u64_u (void *ptr, uint64_t v) { memcpy (ptr, &v, sizeof (v)); } ecb_inline void ecb_poke_be_u16_u (void *ptr, uint_fast16_t v) { ecb_poke_u16_u (ptr, ecb_host_to_be_u16 (v)); } ecb_inline void ecb_poke_be_u32_u (void *ptr, uint_fast32_t v) { ecb_poke_u32_u (ptr, ecb_host_to_be_u32 (v)); } ecb_inline void ecb_poke_be_u64_u (void *ptr, uint_fast64_t v) { ecb_poke_u64_u (ptr, ecb_host_to_be_u64 (v)); } ecb_inline void ecb_poke_le_u16_u (void *ptr, uint_fast16_t v) { ecb_poke_u16_u (ptr, ecb_host_to_le_u16 (v)); } ecb_inline void ecb_poke_le_u32_u (void *ptr, uint_fast32_t v) { ecb_poke_u32_u (ptr, ecb_host_to_le_u32 (v)); } ecb_inline void ecb_poke_le_u64_u (void *ptr, uint_fast64_t v) { ecb_poke_u64_u (ptr, ecb_host_to_le_u64 (v)); } #if ECB_CPP inline uint8_t ecb_bswap (uint8_t v) { return v; } inline uint16_t ecb_bswap (uint16_t v) { return ecb_bswap16 (v); } inline uint32_t ecb_bswap (uint32_t v) { return ecb_bswap32 (v); } inline uint64_t ecb_bswap (uint64_t v) { return ecb_bswap64 (v); } template inline T ecb_be_to_host (T v) { return ecb_little_endian () ? ecb_bswap (v) : v; } template inline T ecb_le_to_host (T v) { return ecb_big_endian () ? ecb_bswap (v) : v; } template inline T ecb_peek (const void *ptr) { return *(const T *)ptr; } template inline T ecb_peek_be (const void *ptr) { return ecb_be_to_host (ecb_peek (ptr)); } template inline T ecb_peek_le (const void *ptr) { return ecb_le_to_host (ecb_peek (ptr)); } template inline T ecb_peek_u (const void *ptr) { T v; memcpy (&v, ptr, sizeof (v)); return v; } template inline T ecb_peek_be_u (const void *ptr) { return ecb_be_to_host (ecb_peek_u (ptr)); } template inline T ecb_peek_le_u (const void *ptr) { return ecb_le_to_host (ecb_peek_u (ptr)); } template inline T ecb_host_to_be (T v) { return ecb_little_endian () ? ecb_bswap (v) : v; } template inline T ecb_host_to_le (T v) { return ecb_big_endian () ? ecb_bswap (v) : v; } template inline void ecb_poke (void *ptr, T v) { *(T *)ptr = v; } template inline void ecb_poke_be (void *ptr, T v) { return ecb_poke (ptr, ecb_host_to_be (v)); } template inline void ecb_poke_le (void *ptr, T v) { return ecb_poke (ptr, ecb_host_to_le (v)); } template inline void ecb_poke_u (void *ptr, T v) { memcpy (ptr, &v, sizeof (v)); } template inline void ecb_poke_be_u (void *ptr, T v) { return ecb_poke_u (ptr, ecb_host_to_be (v)); } template inline void ecb_poke_le_u (void *ptr, T v) { return ecb_poke_u (ptr, ecb_host_to_le (v)); } #endif /*****************************************************************************/ #if ECB_GCC_VERSION(3,0) || ECB_C99 #define ecb_mod(m,n) ((m) % (n) + ((m) % (n) < 0 ? (n) : 0)) #else #define ecb_mod(m,n) ((m) < 0 ? ((n) - 1 - ((-1 - (m)) % (n))) : ((m) % (n))) #endif #if ECB_CPP template static inline T ecb_div_rd (T val, T div) { return val < 0 ? - ((-val + div - 1) / div) : (val ) / div; } template static inline T ecb_div_ru (T val, T div) { return val < 0 ? - ((-val ) / div) : (val + div - 1) / div; } #else #define ecb_div_rd(val,div) ((val) < 0 ? - ((-(val) + (div) - 1) / (div)) : ((val) ) / (div)) #define ecb_div_ru(val,div) ((val) < 0 ? - ((-(val) ) / (div)) : ((val) + (div) - 1) / (div)) #endif #if ecb_cplusplus_does_not_suck /* does not work for local types (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2657.htm) */ template static inline int ecb_array_length (const T (&arr)[N]) { return N; } #else #define ecb_array_length(name) (sizeof (name) / sizeof (name [0])) #endif /*****************************************************************************/ ecb_function_ ecb_const uint32_t ecb_binary16_to_binary32 (uint32_t x); ecb_function_ ecb_const uint32_t ecb_binary16_to_binary32 (uint32_t x) { unsigned int s = (x & 0x8000) << (31 - 15); int e = (x >> 10) & 0x001f; unsigned int m = x & 0x03ff; if (ecb_expect_false (e == 31)) /* infinity or NaN */ e = 255 - (127 - 15); else if (ecb_expect_false (!e)) { if (ecb_expect_true (!m)) /* zero, handled by code below by forcing e to 0 */ e = 0 - (127 - 15); else { /* subnormal, renormalise */ unsigned int s = 10 - ecb_ld32 (m); m = (m << s) & 0x3ff; /* mask implicit bit */ e -= s - 1; } } /* e and m now are normalised, or zero, (or inf or nan) */ e += 127 - 15; return s | (e << 23) | (m << (23 - 10)); } ecb_function_ ecb_const uint16_t ecb_binary32_to_binary16 (uint32_t x); ecb_function_ ecb_const uint16_t ecb_binary32_to_binary16 (uint32_t x) { unsigned int s = (x >> 16) & 0x00008000; /* sign bit, the easy part */ unsigned int e = ((x >> 23) & 0x000000ff) - (127 - 15); /* the desired exponent */ unsigned int m = x & 0x007fffff; x &= 0x7fffffff; /* if it's within range of binary16 normals, use fast path */ if (ecb_expect_true (0x38800000 <= x && x <= 0x477fefff)) { /* mantissa round-to-even */ m += 0x00000fff + ((m >> (23 - 10)) & 1); /* handle overflow */ if (ecb_expect_false (m >= 0x00800000)) { m >>= 1; e += 1; } return s | (e << 10) | (m >> (23 - 10)); } /* handle large numbers and infinity */ if (ecb_expect_true (0x477fefff < x && x <= 0x7f800000)) return s | 0x7c00; /* handle zero, subnormals and small numbers */ if (ecb_expect_true (x < 0x38800000)) { /* zero */ if (ecb_expect_true (!x)) return s; /* handle subnormals */ /* too small, will be zero */ if (e < (14 - 24)) /* might not be sharp, but is good enough */ return s; m |= 0x00800000; /* make implicit bit explicit */ /* very tricky - we need to round to the nearest e (+10) bit value */ { unsigned int bits = 14 - e; unsigned int half = (1 << (bits - 1)) - 1; unsigned int even = (m >> bits) & 1; /* if this overflows, we will end up with a normalised number */ m = (m + half + even) >> bits; } return s | m; } /* handle NaNs, preserve leftmost nan bits, but make sure we don't turn them into infinities */ m >>= 13; return s | 0x7c00 | m | !m; } /*******************************************************************************/ /* floating point stuff, can be disabled by defining ECB_NO_LIBM */ /* basically, everything uses "ieee pure-endian" floating point numbers */ /* the only noteworthy exception is ancient armle, which uses order 43218765 */ #if 0 \ || __i386 || __i386__ \ || ECB_GCC_AMD64 \ || __powerpc__ || __ppc__ || __powerpc64__ || __ppc64__ \ || defined __s390__ || defined __s390x__ \ || defined __mips__ \ || defined __alpha__ \ || defined __hppa__ \ || defined __ia64__ \ || defined __m68k__ \ || defined __m88k__ \ || defined __sh__ \ || defined _M_IX86 || defined ECB_MSVC_AMD64 || defined _M_IA64 \ || (defined __arm__ && (defined __ARM_EABI__ || defined __EABI__ || defined __VFP_FP__ || defined _WIN32_WCE || defined __ANDROID__)) \ || defined __aarch64__ #define ECB_STDFP 1 #else #define ECB_STDFP 0 #endif #ifndef ECB_NO_LIBM #include /* for frexp*, ldexp*, INFINITY, NAN */ /* only the oldest of old doesn't have this one. solaris. */ #ifdef INFINITY #define ECB_INFINITY INFINITY #else #define ECB_INFINITY HUGE_VAL #endif #ifdef NAN #define ECB_NAN NAN #else #define ECB_NAN ECB_INFINITY #endif #if ECB_C99 || _XOPEN_VERSION >= 600 || _POSIX_VERSION >= 200112L #define ecb_ldexpf(x,e) ldexpf ((x), (e)) #define ecb_frexpf(x,e) frexpf ((x), (e)) #else #define ecb_ldexpf(x,e) (float) ldexp ((double) (x), (e)) #define ecb_frexpf(x,e) (float) frexp ((double) (x), (e)) #endif /* convert a float to ieee single/binary32 */ ecb_function_ ecb_const uint32_t ecb_float_to_binary32 (float x); ecb_function_ ecb_const uint32_t ecb_float_to_binary32 (float x) { uint32_t r; #if ECB_STDFP memcpy (&r, &x, 4); #else /* slow emulation, works for anything but -0 */ uint32_t m; int e; if (x == 0e0f ) return 0x00000000U; if (x > +3.40282346638528860e+38f) return 0x7f800000U; if (x < -3.40282346638528860e+38f) return 0xff800000U; if (x != x ) return 0x7fbfffffU; m = ecb_frexpf (x, &e) * 0x1000000U; r = m & 0x80000000U; if (r) m = -m; if (e <= -126) { m &= 0xffffffU; m >>= (-125 - e); e = -126; } r |= (e + 126) << 23; r |= m & 0x7fffffU; #endif return r; } /* converts an ieee single/binary32 to a float */ ecb_function_ ecb_const float ecb_binary32_to_float (uint32_t x); ecb_function_ ecb_const float ecb_binary32_to_float (uint32_t x) { float r; #if ECB_STDFP memcpy (&r, &x, 4); #else /* emulation, only works for normals and subnormals and +0 */ int neg = x >> 31; int e = (x >> 23) & 0xffU; x &= 0x7fffffU; if (e) x |= 0x800000U; else e = 1; /* we distrust ldexpf a bit and do the 2**-24 scaling by an extra multiply */ r = ecb_ldexpf (x * (0.5f / 0x800000U), e - 126); r = neg ? -r : r; #endif return r; } /* convert a double to ieee double/binary64 */ ecb_function_ ecb_const uint64_t ecb_double_to_binary64 (double x); ecb_function_ ecb_const uint64_t ecb_double_to_binary64 (double x) { uint64_t r; #if ECB_STDFP memcpy (&r, &x, 8); #else /* slow emulation, works for anything but -0 */ uint64_t m; int e; if (x == 0e0 ) return 0x0000000000000000U; if (x > +1.79769313486231470e+308) return 0x7ff0000000000000U; if (x < -1.79769313486231470e+308) return 0xfff0000000000000U; if (x != x ) return 0X7ff7ffffffffffffU; m = frexp (x, &e) * 0x20000000000000U; r = m & 0x8000000000000000;; if (r) m = -m; if (e <= -1022) { m &= 0x1fffffffffffffU; m >>= (-1021 - e); e = -1022; } r |= ((uint64_t)(e + 1022)) << 52; r |= m & 0xfffffffffffffU; #endif return r; } /* converts an ieee double/binary64 to a double */ ecb_function_ ecb_const double ecb_binary64_to_double (uint64_t x); ecb_function_ ecb_const double ecb_binary64_to_double (uint64_t x) { double r; #if ECB_STDFP memcpy (&r, &x, 8); #else /* emulation, only works for normals and subnormals and +0 */ int neg = x >> 63; int e = (x >> 52) & 0x7ffU; x &= 0xfffffffffffffU; if (e) x |= 0x10000000000000U; else e = 1; /* we distrust ldexp a bit and do the 2**-53 scaling by an extra multiply */ r = ldexp (x * (0.5 / 0x10000000000000U), e - 1022); r = neg ? -r : r; #endif return r; } /* convert a float to ieee half/binary16 */ ecb_function_ ecb_const uint16_t ecb_float_to_binary16 (float x); ecb_function_ ecb_const uint16_t ecb_float_to_binary16 (float x) { return ecb_binary32_to_binary16 (ecb_float_to_binary32 (x)); } /* convert an ieee half/binary16 to float */ ecb_function_ ecb_const float ecb_binary16_to_float (uint16_t x); ecb_function_ ecb_const float ecb_binary16_to_float (uint16_t x) { return ecb_binary32_to_float (ecb_binary16_to_binary32 (x)); } #endif #endif /* ECB.H END */ #if ECB_MEMORY_FENCE_NEEDS_PTHREADS /* if your architecture doesn't need memory fences, e.g. because it is * single-cpu/core, or if you use libev in a project that doesn't use libev * from multiple threads, then you can define ECB_NO_THREADS when compiling * libev, in which cases the memory fences become nops. * alternatively, you can remove this #error and link against libpthread, * which will then provide the memory fences. */ # error "memory fences not defined for your architecture, please report" #endif #ifndef ECB_MEMORY_FENCE # define ECB_MEMORY_FENCE do { } while (0) # define ECB_MEMORY_FENCE_ACQUIRE ECB_MEMORY_FENCE # define ECB_MEMORY_FENCE_RELEASE ECB_MEMORY_FENCE #endif #define inline_size ecb_inline #if EV_FEATURE_CODE # define inline_speed ecb_inline #else # define inline_speed ecb_noinline static #endif /*****************************************************************************/ /* raw syscall wrappers */ #if EV_NEED_SYSCALL #include /* * define some syscall wrappers for common architectures * this is mostly for nice looks during debugging, not performance. * our syscalls return < 0, not == -1, on error. which is good * enough for linux aio. * TODO: arm is also common nowadays, maybe even mips and x86 * TODO: after implementing this, it suddenly looks like overkill, but its hard to remove... */ #if __GNUC__ && __linux && ECB_AMD64 && !EV_FEATURE_CODE /* the costly errno access probably kills this for size optimisation */ #define ev_syscall(nr,narg,arg1,arg2,arg3,arg4,arg5,arg6) \ ({ \ long res; \ register unsigned long r6 __asm__ ("r9" ); \ register unsigned long r5 __asm__ ("r8" ); \ register unsigned long r4 __asm__ ("r10"); \ register unsigned long r3 __asm__ ("rdx"); \ register unsigned long r2 __asm__ ("rsi"); \ register unsigned long r1 __asm__ ("rdi"); \ if (narg >= 6) r6 = (unsigned long)(arg6); \ if (narg >= 5) r5 = (unsigned long)(arg5); \ if (narg >= 4) r4 = (unsigned long)(arg4); \ if (narg >= 3) r3 = (unsigned long)(arg3); \ if (narg >= 2) r2 = (unsigned long)(arg2); \ if (narg >= 1) r1 = (unsigned long)(arg1); \ __asm__ __volatile__ ( \ "syscall\n\t" \ : "=a" (res) \ : "0" (nr), "r" (r1), "r" (r2), "r" (r3), "r" (r4), "r" (r5) \ : "cc", "r11", "cx", "memory"); \ errno = -res; \ res; \ }) #endif #ifdef ev_syscall #define ev_syscall0(nr) ev_syscall (nr, 0, 0, 0, 0, 0, 0, 0) #define ev_syscall1(nr,arg1) ev_syscall (nr, 1, arg1, 0, 0, 0, 0, 0) #define ev_syscall2(nr,arg1,arg2) ev_syscall (nr, 2, arg1, arg2, 0, 0, 0, 0) #define ev_syscall3(nr,arg1,arg2,arg3) ev_syscall (nr, 3, arg1, arg2, arg3, 0, 0, 0) #define ev_syscall4(nr,arg1,arg2,arg3,arg4) ev_syscall (nr, 3, arg1, arg2, arg3, arg4, 0, 0) #define ev_syscall5(nr,arg1,arg2,arg3,arg4,arg5) ev_syscall (nr, 5, arg1, arg2, arg3, arg4, arg5, 0) #define ev_syscall6(nr,arg1,arg2,arg3,arg4,arg5,arg6) ev_syscall (nr, 6, arg1, arg2, arg3, arg4, arg5,arg6) #else #define ev_syscall0(nr) syscall (nr) #define ev_syscall1(nr,arg1) syscall (nr, arg1) #define ev_syscall2(nr,arg1,arg2) syscall (nr, arg1, arg2) #define ev_syscall3(nr,arg1,arg2,arg3) syscall (nr, arg1, arg2, arg3) #define ev_syscall4(nr,arg1,arg2,arg3,arg4) syscall (nr, arg1, arg2, arg3, arg4) #define ev_syscall5(nr,arg1,arg2,arg3,arg4,arg5) syscall (nr, arg1, arg2, arg3, arg4, arg5) #define ev_syscall6(nr,arg1,arg2,arg3,arg4,arg5,arg6) syscall (nr, arg1, arg2, arg3, arg4, arg5,arg6) #endif #endif /*****************************************************************************/ #define NUMPRI (EV_MAXPRI - EV_MINPRI + 1) #if EV_MINPRI == EV_MAXPRI # define ABSPRI(w) (((W)w), 0) #else # define ABSPRI(w) (((W)w)->priority - EV_MINPRI) #endif #define EMPTY /* required for microsofts broken pseudo-c compiler */ typedef ev_watcher *W; typedef ev_watcher_list *WL; typedef ev_watcher_time *WT; #define ev_active(w) ((W)(w))->active #define ev_at(w) ((WT)(w))->at #if EV_USE_REALTIME /* sig_atomic_t is used to avoid per-thread variables or locking but still */ /* giving it a reasonably high chance of working on typical architectures */ static EV_ATOMIC_T have_realtime; /* did clock_gettime (CLOCK_REALTIME) work? */ #endif #if EV_USE_MONOTONIC static EV_ATOMIC_T have_monotonic; /* did clock_gettime (CLOCK_MONOTONIC) work? */ #endif #ifndef EV_FD_TO_WIN32_HANDLE # define EV_FD_TO_WIN32_HANDLE(fd) _get_osfhandle (fd) #endif #ifndef EV_WIN32_HANDLE_TO_FD # define EV_WIN32_HANDLE_TO_FD(handle) _open_osfhandle (handle, 0) #endif #ifndef EV_WIN32_CLOSE_FD # define EV_WIN32_CLOSE_FD(fd) close (fd) #endif #ifdef _WIN32 # include "ev_win32.c" #endif /*****************************************************************************/ #if EV_USE_LINUXAIO # include /* probably only needed for aio_context_t */ #endif /* define a suitable floor function (only used by periodics atm) */ #if EV_USE_FLOOR # include # define ev_floor(v) floor (v) #else #include /* a floor() replacement function, should be independent of ev_tstamp type */ ecb_noinline static ev_tstamp ev_floor (ev_tstamp v) { /* the choice of shift factor is not terribly important */ #if FLT_RADIX != 2 /* assume FLT_RADIX == 10 */ const ev_tstamp shift = sizeof (unsigned long) >= 8 ? 10000000000000000000. : 1000000000.; #else const ev_tstamp shift = sizeof (unsigned long) >= 8 ? 18446744073709551616. : 4294967296.; #endif /* special treatment for negative arguments */ if (ecb_expect_false (v < 0.)) { ev_tstamp f = -ev_floor (-v); return f - (f == v ? 0 : 1); } /* argument too large for an unsigned long? then reduce it */ if (ecb_expect_false (v >= shift)) { ev_tstamp f; if (v == v - 1.) return v; /* very large numbers are assumed to be integer */ f = shift * ev_floor (v * (1. / shift)); return f + ev_floor (v - f); } /* fits into an unsigned long */ return (unsigned long)v; } #endif /*****************************************************************************/ #ifdef __linux # include #endif ecb_noinline ecb_cold static unsigned int ev_linux_version (void) { #ifdef __linux unsigned int v = 0; struct utsname buf; int i; char *p = buf.release; if (uname (&buf)) return 0; for (i = 3+1; --i; ) { unsigned int c = 0; for (;;) { if (*p >= '0' && *p <= '9') c = c * 10 + *p++ - '0'; else { p += *p == '.'; break; } } v = (v << 8) | c; } return v; #else return 0; #endif } /*****************************************************************************/ #if EV_AVOID_STDIO ecb_noinline ecb_cold static void ev_printerr (const char *msg) { int rc; do { rc = write (STDERR_FILENO, msg, strlen (msg)); } while (errno == EINTR && rc < 0); } #endif static void (*syserr_cb)(const char *msg) EV_NOEXCEPT; ecb_cold void ev_set_syserr_cb (void (*cb)(const char *msg) EV_NOEXCEPT) EV_NOEXCEPT { syserr_cb = cb; } ecb_noinline ecb_cold static void ev_syserr (const char *msg) { if (!msg) msg = "(libev) system error"; if (syserr_cb) syserr_cb (msg); else { #if EV_AVOID_STDIO ev_printerr (msg); ev_printerr (": "); ev_printerr (strerror (errno)); ev_printerr ("\n"); #else perror (msg); #endif abort (); } } static void * ev_realloc_emul (void *ptr, long size) EV_NOEXCEPT { /* some systems, notably openbsd and darwin, fail to properly * implement realloc (x, 0) (as required by both ansi c-89 and * the single unix specification, so work around them here. * recently, also (at least) fedora and debian started breaking it, * despite documenting it otherwise. */ if (size) return realloc (ptr, size); free (ptr); return 0; } static void *(*alloc)(void *ptr, long size) EV_NOEXCEPT = ev_realloc_emul; ecb_cold void ev_set_allocator (void *(*cb)(void *ptr, long size) EV_NOEXCEPT) EV_NOEXCEPT { alloc = cb; } inline_speed void * ev_realloc (void *ptr, long size) { ptr = alloc (ptr, size); if (!ptr && size) { #if EV_AVOID_STDIO ev_printerr ("(libev) memory allocation failed, aborting.\n"); #else fprintf (stderr, "(libev) cannot allocate %ld bytes, aborting.", size); #endif abort (); } return ptr; } #define ev_malloc(size) ev_realloc (0, (size)) #define ev_free(ptr) free (ptr) /*****************************************************************************/ /* set in reify when reification needed */ #define EV_ANFD_REIFY 1 /* file descriptor info structure */ typedef struct { WL head; unsigned char events; /* the events watched for */ unsigned char reify; /* flag set when this ANFD needs reification (EV_ANFD_REIFY, EV__IOFDSET) */ unsigned char emask; /* some backends store the actual kernel mask in here */ unsigned char eflags; /* flags field for use by backends */ #if EV_USE_EPOLL unsigned int egen; /* generation counter to counter epoll bugs */ #endif #if EV_SELECT_IS_WINSOCKET || EV_USE_IOCP SOCKET handle; #endif #if EV_USE_IOCP OVERLAPPED or, ow; #endif } ANFD; /* stores the pending event set for a given watcher */ typedef struct { W w; int events; /* the pending event set for the given watcher */ } ANPENDING; #if EV_USE_INOTIFY /* hash table entry per inotify-id */ typedef struct { WL head; } ANFS; #endif /* Heap Entry */ #if EV_HEAP_CACHE_AT /* a heap element */ typedef struct { ev_tstamp at; WT w; } ANHE; #define ANHE_w(he) (he).w /* access watcher, read-write */ #define ANHE_at(he) (he).at /* access cached at, read-only */ #define ANHE_at_cache(he) (he).at = (he).w->at /* update at from watcher */ #else /* a heap element */ typedef WT ANHE; #define ANHE_w(he) (he) #define ANHE_at(he) (he)->at #define ANHE_at_cache(he) #endif #if EV_MULTIPLICITY struct ev_loop { ev_tstamp ev_rt_now; #define ev_rt_now ((loop)->ev_rt_now) #define VAR(name,decl) decl; #include "ev_vars.h" #undef VAR }; #include "ev_wrap.h" static struct ev_loop default_loop_struct; EV_API_DECL struct ev_loop *ev_default_loop_ptr = 0; /* needs to be initialised to make it a definition despite extern */ #else EV_API_DECL ev_tstamp ev_rt_now = EV_TS_CONST (0.); /* needs to be initialised to make it a definition despite extern */ #define VAR(name,decl) static decl; #include "ev_vars.h" #undef VAR static int ev_default_loop_ptr; #endif #if EV_FEATURE_API # define EV_RELEASE_CB if (ecb_expect_false (release_cb)) release_cb (EV_A) # define EV_ACQUIRE_CB if (ecb_expect_false (acquire_cb)) acquire_cb (EV_A) # define EV_INVOKE_PENDING invoke_cb (EV_A) #else # define EV_RELEASE_CB (void)0 # define EV_ACQUIRE_CB (void)0 # define EV_INVOKE_PENDING ev_invoke_pending (EV_A) #endif #define EVBREAK_RECURSE 0x80 /*****************************************************************************/ #ifndef EV_HAVE_EV_TIME ev_tstamp ev_time (void) EV_NOEXCEPT { #if EV_USE_REALTIME if (ecb_expect_true (have_realtime)) { struct timespec ts; clock_gettime (CLOCK_REALTIME, &ts); return EV_TS_GET (ts); } #endif { struct timeval tv; gettimeofday (&tv, 0); return EV_TV_GET (tv); } } #endif inline_size ev_tstamp get_clock (void) { #if EV_USE_MONOTONIC if (ecb_expect_true (have_monotonic)) { struct timespec ts; clock_gettime (CLOCK_MONOTONIC, &ts); return EV_TS_GET (ts); } #endif return ev_time (); } #if EV_MULTIPLICITY ev_tstamp ev_now (EV_P) EV_NOEXCEPT { return ev_rt_now; } #endif void ev_sleep (ev_tstamp delay) EV_NOEXCEPT { if (delay > EV_TS_CONST (0.)) { #if EV_USE_NANOSLEEP struct timespec ts; EV_TS_SET (ts, delay); nanosleep (&ts, 0); #elif defined _WIN32 /* maybe this should round up, as ms is very low resolution */ /* compared to select (µs) or nanosleep (ns) */ Sleep ((unsigned long)(EV_TS_TO_MSEC (delay))); #else struct timeval tv; /* here we rely on sys/time.h + sys/types.h + unistd.h providing select */ /* something not guaranteed by newer posix versions, but guaranteed */ /* by older ones */ EV_TV_SET (tv, delay); select (0, 0, 0, 0, &tv); #endif } } /*****************************************************************************/ #define MALLOC_ROUND 4096 /* prefer to allocate in chunks of this size, must be 2**n and >> 4 longs */ /* find a suitable new size for the given array, */ /* hopefully by rounding to a nice-to-malloc size */ inline_size int array_nextsize (int elem, int cur, int cnt) { int ncur = cur + 1; do ncur <<= 1; while (cnt > ncur); /* if size is large, round to MALLOC_ROUND - 4 * longs to accommodate malloc overhead */ if (elem * ncur > MALLOC_ROUND - sizeof (void *) * 4) { ncur *= elem; ncur = (ncur + elem + (MALLOC_ROUND - 1) + sizeof (void *) * 4) & ~(MALLOC_ROUND - 1); ncur = ncur - sizeof (void *) * 4; ncur /= elem; } return ncur; } ecb_noinline ecb_cold static void * array_realloc (int elem, void *base, int *cur, int cnt) { *cur = array_nextsize (elem, *cur, cnt); return ev_realloc (base, elem * *cur); } #define array_needsize_noinit(base,offset,count) #define array_needsize_zerofill(base,offset,count) \ memset ((void *)(base + offset), 0, sizeof (*(base)) * (count)) #define array_needsize(type,base,cur,cnt,init) \ if (ecb_expect_false ((cnt) > (cur))) \ { \ ecb_unused int ocur_ = (cur); \ (base) = (type *)array_realloc \ (sizeof (type), (base), &(cur), (cnt)); \ init ((base), ocur_, ((cur) - ocur_)); \ } #if 0 #define array_slim(type,stem) \ if (stem ## max < array_roundsize (stem ## cnt >> 2)) \ { \ stem ## max = array_roundsize (stem ## cnt >> 1); \ base = (type *)ev_realloc (base, sizeof (type) * (stem ## max));\ fprintf (stderr, "slimmed down " # stem " to %d\n", stem ## max);/*D*/\ } #endif #define array_free(stem, idx) \ ev_free (stem ## s idx); stem ## cnt idx = stem ## max idx = 0; stem ## s idx = 0 /*****************************************************************************/ /* dummy callback for pending events */ ecb_noinline static void pendingcb (EV_P_ ev_prepare *w, int revents) { } ecb_noinline void ev_feed_event (EV_P_ void *w, int revents) EV_NOEXCEPT { W w_ = (W)w; int pri = ABSPRI (w_); if (ecb_expect_false (w_->pending)) pendings [pri][w_->pending - 1].events |= revents; else { w_->pending = ++pendingcnt [pri]; array_needsize (ANPENDING, pendings [pri], pendingmax [pri], w_->pending, array_needsize_noinit); pendings [pri][w_->pending - 1].w = w_; pendings [pri][w_->pending - 1].events = revents; } pendingpri = NUMPRI - 1; } inline_speed void feed_reverse (EV_P_ W w) { array_needsize (W, rfeeds, rfeedmax, rfeedcnt + 1, array_needsize_noinit); rfeeds [rfeedcnt++] = w; } inline_size void feed_reverse_done (EV_P_ int revents) { do ev_feed_event (EV_A_ rfeeds [--rfeedcnt], revents); while (rfeedcnt); } inline_speed void queue_events (EV_P_ W *events, int eventcnt, int type) { int i; for (i = 0; i < eventcnt; ++i) ev_feed_event (EV_A_ events [i], type); } /*****************************************************************************/ inline_speed void fd_event_nocheck (EV_P_ int fd, int revents) { ANFD *anfd = anfds + fd; ev_io *w; for (w = (ev_io *)anfd->head; w; w = (ev_io *)((WL)w)->next) { int ev = w->events & revents; if (ev) ev_feed_event (EV_A_ (W)w, ev); } } /* do not submit kernel events for fds that have reify set */ /* because that means they changed while we were polling for new events */ inline_speed void fd_event (EV_P_ int fd, int revents) { ANFD *anfd = anfds + fd; if (ecb_expect_true (!anfd->reify)) fd_event_nocheck (EV_A_ fd, revents); } void ev_feed_fd_event (EV_P_ int fd, int revents) EV_NOEXCEPT { if (fd >= 0 && fd < anfdmax) fd_event_nocheck (EV_A_ fd, revents); } /* make sure the external fd watch events are in-sync */ /* with the kernel/libev internal state */ inline_size void fd_reify (EV_P) { int i; /* most backends do not modify the fdchanges list in backend_modfiy. * except io_uring, which has fixed-size buffers which might force us * to handle events in backend_modify, causing fdchanges to be amended, * which could result in an endless loop. * to avoid this, we do not dynamically handle fds that were added * during fd_reify. that means that for those backends, fdchangecnt * might be non-zero during poll, which must cause them to not block. * to not put too much of a burden on other backends, this detail * needs to be handled in the backend. */ int changecnt = fdchangecnt; #if EV_SELECT_IS_WINSOCKET || EV_USE_IOCP for (i = 0; i < changecnt; ++i) { int fd = fdchanges [i]; ANFD *anfd = anfds + fd; if (anfd->reify & EV__IOFDSET && anfd->head) { SOCKET handle = EV_FD_TO_WIN32_HANDLE (fd); if (handle != anfd->handle) { unsigned long arg; assert (("libev: only socket fds supported in this configuration", ioctlsocket (handle, FIONREAD, &arg) == 0)); /* handle changed, but fd didn't - we need to do it in two steps */ backend_modify (EV_A_ fd, anfd->events, 0); anfd->events = 0; anfd->handle = handle; } } } #endif for (i = 0; i < changecnt; ++i) { int fd = fdchanges [i]; ANFD *anfd = anfds + fd; ev_io *w; unsigned char o_events = anfd->events; unsigned char o_reify = anfd->reify; anfd->reify = 0; /*if (ecb_expect_true (o_reify & EV_ANFD_REIFY)) probably a deoptimisation */ { anfd->events = 0; for (w = (ev_io *)anfd->head; w; w = (ev_io *)((WL)w)->next) anfd->events |= (unsigned char)w->events; if (o_events != anfd->events) o_reify = EV__IOFDSET; /* actually |= */ } if (o_reify & EV__IOFDSET) backend_modify (EV_A_ fd, o_events, anfd->events); } /* normally, fdchangecnt hasn't changed. if it has, then new fds have been added. * this is a rare case (see beginning comment in this function), so we copy them to the * front and hope the backend handles this case. */ if (ecb_expect_false (fdchangecnt != changecnt)) memmove (fdchanges, fdchanges + changecnt, (fdchangecnt - changecnt) * sizeof (*fdchanges)); fdchangecnt -= changecnt; } /* something about the given fd changed */ inline_size void fd_change (EV_P_ int fd, int flags) { unsigned char reify = anfds [fd].reify; anfds [fd].reify = reify | flags; if (ecb_expect_true (!reify)) { ++fdchangecnt; array_needsize (int, fdchanges, fdchangemax, fdchangecnt, array_needsize_noinit); fdchanges [fdchangecnt - 1] = fd; } } /* the given fd is invalid/unusable, so make sure it doesn't hurt us anymore */ inline_speed ecb_cold void fd_kill (EV_P_ int fd) { ev_io *w; while ((w = (ev_io *)anfds [fd].head)) { ev_io_stop (EV_A_ w); ev_feed_event (EV_A_ (W)w, EV_ERROR | EV_READ | EV_WRITE); } } /* check whether the given fd is actually valid, for error recovery */ inline_size ecb_cold int fd_valid (int fd) { #ifdef _WIN32 return EV_FD_TO_WIN32_HANDLE (fd) != -1; #else return fcntl (fd, F_GETFD) != -1; #endif } /* called on EBADF to verify fds */ ecb_noinline ecb_cold static void fd_ebadf (EV_P) { int fd; for (fd = 0; fd < anfdmax; ++fd) if (anfds [fd].events) if (!fd_valid (fd) && errno == EBADF) fd_kill (EV_A_ fd); } /* called on ENOMEM in select/poll to kill some fds and retry */ ecb_noinline ecb_cold static void fd_enomem (EV_P) { int fd; for (fd = anfdmax; fd--; ) if (anfds [fd].events) { fd_kill (EV_A_ fd); break; } } /* usually called after fork if backend needs to re-arm all fds from scratch */ ecb_noinline static void fd_rearm_all (EV_P) { int fd; for (fd = 0; fd < anfdmax; ++fd) if (anfds [fd].events) { anfds [fd].events = 0; anfds [fd].emask = 0; fd_change (EV_A_ fd, EV__IOFDSET | EV_ANFD_REIFY); } } /* used to prepare libev internal fd's */ /* this is not fork-safe */ inline_speed void fd_intern (int fd) { #ifdef _WIN32 unsigned long arg = 1; ioctlsocket (EV_FD_TO_WIN32_HANDLE (fd), FIONBIO, &arg); #else fcntl (fd, F_SETFD, FD_CLOEXEC); fcntl (fd, F_SETFL, O_NONBLOCK); #endif } /*****************************************************************************/ /* * the heap functions want a real array index. array index 0 is guaranteed to not * be in-use at any time. the first heap entry is at array [HEAP0]. DHEAP gives * the branching factor of the d-tree. */ /* * at the moment we allow libev the luxury of two heaps, * a small-code-size 2-heap one and a ~1.5kb larger 4-heap * which is more cache-efficient. * the difference is about 5% with 50000+ watchers. */ #if EV_USE_4HEAP #define DHEAP 4 #define HEAP0 (DHEAP - 1) /* index of first element in heap */ #define HPARENT(k) ((((k) - HEAP0 - 1) / DHEAP) + HEAP0) #define UPHEAP_DONE(p,k) ((p) == (k)) /* away from the root */ inline_speed void downheap (ANHE *heap, int N, int k) { ANHE he = heap [k]; ANHE *E = heap + N + HEAP0; for (;;) { ev_tstamp minat; ANHE *minpos; ANHE *pos = heap + DHEAP * (k - HEAP0) + HEAP0 + 1; /* find minimum child */ if (ecb_expect_true (pos + DHEAP - 1 < E)) { /* fast path */ (minpos = pos + 0), (minat = ANHE_at (*minpos)); if ( minat > ANHE_at (pos [1])) (minpos = pos + 1), (minat = ANHE_at (*minpos)); if ( minat > ANHE_at (pos [2])) (minpos = pos + 2), (minat = ANHE_at (*minpos)); if ( minat > ANHE_at (pos [3])) (minpos = pos + 3), (minat = ANHE_at (*minpos)); } else if (pos < E) { /* slow path */ (minpos = pos + 0), (minat = ANHE_at (*minpos)); if (pos + 1 < E && minat > ANHE_at (pos [1])) (minpos = pos + 1), (minat = ANHE_at (*minpos)); if (pos + 2 < E && minat > ANHE_at (pos [2])) (minpos = pos + 2), (minat = ANHE_at (*minpos)); if (pos + 3 < E && minat > ANHE_at (pos [3])) (minpos = pos + 3), (minat = ANHE_at (*minpos)); } else break; if (ANHE_at (he) <= minat) break; heap [k] = *minpos; ev_active (ANHE_w (*minpos)) = k; k = minpos - heap; } heap [k] = he; ev_active (ANHE_w (he)) = k; } #else /* not 4HEAP */ #define HEAP0 1 #define HPARENT(k) ((k) >> 1) #define UPHEAP_DONE(p,k) (!(p)) /* away from the root */ inline_speed void downheap (ANHE *heap, int N, int k) { ANHE he = heap [k]; for (;;) { int c = k << 1; if (c >= N + HEAP0) break; c += c + 1 < N + HEAP0 && ANHE_at (heap [c]) > ANHE_at (heap [c + 1]) ? 1 : 0; if (ANHE_at (he) <= ANHE_at (heap [c])) break; heap [k] = heap [c]; ev_active (ANHE_w (heap [k])) = k; k = c; } heap [k] = he; ev_active (ANHE_w (he)) = k; } #endif /* towards the root */ inline_speed void upheap (ANHE *heap, int k) { ANHE he = heap [k]; for (;;) { int p = HPARENT (k); if (UPHEAP_DONE (p, k) || ANHE_at (heap [p]) <= ANHE_at (he)) break; heap [k] = heap [p]; ev_active (ANHE_w (heap [k])) = k; k = p; } heap [k] = he; ev_active (ANHE_w (he)) = k; } /* move an element suitably so it is in a correct place */ inline_size void adjustheap (ANHE *heap, int N, int k) { if (k > HEAP0 && ANHE_at (heap [k]) <= ANHE_at (heap [HPARENT (k)])) upheap (heap, k); else downheap (heap, N, k); } /* rebuild the heap: this function is used only once and executed rarely */ inline_size void reheap (ANHE *heap, int N) { int i; /* we don't use floyds algorithm, upheap is simpler and is more cache-efficient */ /* also, this is easy to implement and correct for both 2-heaps and 4-heaps */ for (i = 0; i < N; ++i) upheap (heap, i + HEAP0); } /*****************************************************************************/ /* associate signal watchers to a signal */ typedef struct { EV_ATOMIC_T pending; #if EV_MULTIPLICITY EV_P; #endif WL head; } ANSIG; static ANSIG signals [EV_NSIG]; /*****************************************************************************/ #if EV_SIGNAL_ENABLE || EV_ASYNC_ENABLE ecb_noinline ecb_cold static void evpipe_init (EV_P) { if (!ev_is_active (&pipe_w)) { int fds [2]; # if EV_USE_EVENTFD fds [0] = -1; fds [1] = eventfd (0, EFD_NONBLOCK | EFD_CLOEXEC); if (fds [1] < 0 && errno == EINVAL) fds [1] = eventfd (0, 0); if (fds [1] < 0) # endif { while (pipe (fds)) ev_syserr ("(libev) error creating signal/async pipe"); fd_intern (fds [0]); } evpipe [0] = fds [0]; if (evpipe [1] < 0) evpipe [1] = fds [1]; /* first call, set write fd */ else { /* on subsequent calls, do not change evpipe [1] */ /* so that evpipe_write can always rely on its value. */ /* this branch does not do anything sensible on windows, */ /* so must not be executed on windows */ dup2 (fds [1], evpipe [1]); close (fds [1]); } fd_intern (evpipe [1]); ev_io_set (&pipe_w, evpipe [0] < 0 ? evpipe [1] : evpipe [0], EV_READ); ev_io_start (EV_A_ &pipe_w); ev_unref (EV_A); /* watcher should not keep loop alive */ } } inline_speed void evpipe_write (EV_P_ EV_ATOMIC_T *flag) { ECB_MEMORY_FENCE; /* push out the write before this function was called, acquire flag */ if (ecb_expect_true (*flag)) return; *flag = 1; ECB_MEMORY_FENCE_RELEASE; /* make sure flag is visible before the wakeup */ pipe_write_skipped = 1; ECB_MEMORY_FENCE; /* make sure pipe_write_skipped is visible before we check pipe_write_wanted */ if (pipe_write_wanted) { int old_errno, rc; pipe_write_skipped = 0; ECB_MEMORY_FENCE_RELEASE; old_errno = errno; /* save errno because write will clobber it */ #if EV_USE_EVENTFD if (evpipe [0] < 0) { uint64_t counter = 1; do { rc = write (evpipe [1], &counter, sizeof (uint64_t)); } while (errno == EINTR && rc < 0); } else #endif { #ifdef _WIN32 WSABUF buf; DWORD sent; buf.buf = (char *)&buf; buf.len = 1; WSASend (EV_FD_TO_WIN32_HANDLE (evpipe [1]), &buf, 1, &sent, 0, 0, 0); #else do { rc = write (evpipe [1], &(evpipe [1]), 1); } while (errno == EINTR && rc < 0); #endif } errno = old_errno; } } /* called whenever the libev signal pipe */ /* got some events (signal, async) */ static void pipecb (EV_P_ ev_io *iow, int revents) { int i; if (revents & EV_READ) { int rc; #if EV_USE_EVENTFD if (evpipe [0] < 0) { uint64_t counter; do { rc = read (evpipe [1], &counter, sizeof (uint64_t)); } while (errno == EINTR && rc < 0); } else #endif { char dummy[4]; #ifdef _WIN32 WSABUF buf; DWORD recvd; DWORD flags = 0; buf.buf = dummy; buf.len = sizeof (dummy); WSARecv (EV_FD_TO_WIN32_HANDLE (evpipe [0]), &buf, 1, &recvd, &flags, 0, 0); #else do { rc = read (evpipe [0], &dummy, sizeof (dummy)); } while (errno == EINTR && rc < 0); #endif } } pipe_write_skipped = 0; ECB_MEMORY_FENCE; /* push out skipped, acquire flags */ #if EV_SIGNAL_ENABLE if (sig_pending) { sig_pending = 0; ECB_MEMORY_FENCE; for (i = EV_NSIG - 1; i--; ) if (ecb_expect_false (signals [i].pending)) ev_feed_signal_event (EV_A_ i + 1); } #endif #if EV_ASYNC_ENABLE if (async_pending) { async_pending = 0; ECB_MEMORY_FENCE; for (i = asynccnt; i--; ) if (asyncs [i]->sent) { asyncs [i]->sent = 0; ECB_MEMORY_FENCE_RELEASE; ev_feed_event (EV_A_ asyncs [i], EV_ASYNC); } } #endif } /*****************************************************************************/ void ev_feed_signal (int signum) EV_NOEXCEPT { #if EV_MULTIPLICITY EV_P; ECB_MEMORY_FENCE_ACQUIRE; EV_A = signals [signum - 1].loop; if (!EV_A) return; #endif signals [signum - 1].pending = 1; evpipe_write (EV_A_ &sig_pending); } static void ev_sighandler (int signum) { #ifdef _WIN32 signal (signum, ev_sighandler); #endif ev_feed_signal (signum); } ecb_noinline void ev_feed_signal_event (EV_P_ int signum) EV_NOEXCEPT { WL w; if (ecb_expect_false (signum <= 0 || signum >= EV_NSIG)) return; --signum; #if EV_MULTIPLICITY /* it is permissible to try to feed a signal to the wrong loop */ /* or, likely more useful, feeding a signal nobody is waiting for */ if (ecb_expect_false (signals [signum].loop != EV_A)) return; #endif signals [signum].pending = 0; ECB_MEMORY_FENCE_RELEASE; for (w = signals [signum].head; w; w = w->next) ev_feed_event (EV_A_ (W)w, EV_SIGNAL); } #if EV_USE_SIGNALFD static void sigfdcb (EV_P_ ev_io *iow, int revents) { struct signalfd_siginfo si[2], *sip; /* these structs are big */ for (;;) { ssize_t res = read (sigfd, si, sizeof (si)); /* not ISO-C, as res might be -1, but works with SuS */ for (sip = si; (char *)sip < (char *)si + res; ++sip) ev_feed_signal_event (EV_A_ sip->ssi_signo); if (res < (ssize_t)sizeof (si)) break; } } #endif #endif /*****************************************************************************/ #if EV_CHILD_ENABLE static WL childs [EV_PID_HASHSIZE]; static ev_signal childev; #ifndef WIFCONTINUED # define WIFCONTINUED(status) 0 #endif /* handle a single child status event */ inline_speed void child_reap (EV_P_ int chain, int pid, int status) { ev_child *w; int traced = WIFSTOPPED (status) || WIFCONTINUED (status); for (w = (ev_child *)childs [chain & ((EV_PID_HASHSIZE) - 1)]; w; w = (ev_child *)((WL)w)->next) { if ((w->pid == pid || !w->pid) && (!traced || (w->flags & 1))) { ev_set_priority (w, EV_MAXPRI); /* need to do it *now*, this *must* be the same prio as the signal watcher itself */ w->rpid = pid; w->rstatus = status; ev_feed_event (EV_A_ (W)w, EV_CHILD); } } } #ifndef WCONTINUED # define WCONTINUED 0 #endif /* called on sigchld etc., calls waitpid */ static void childcb (EV_P_ ev_signal *sw, int revents) { int pid, status; /* some systems define WCONTINUED but then fail to support it (linux 2.4) */ if (0 >= (pid = waitpid (-1, &status, WNOHANG | WUNTRACED | WCONTINUED))) if (!WCONTINUED || errno != EINVAL || 0 >= (pid = waitpid (-1, &status, WNOHANG | WUNTRACED))) return; /* make sure we are called again until all children have been reaped */ /* we need to do it this way so that the callback gets called before we continue */ ev_feed_event (EV_A_ (W)sw, EV_SIGNAL); child_reap (EV_A_ pid, pid, status); if ((EV_PID_HASHSIZE) > 1) child_reap (EV_A_ 0, pid, status); /* this might trigger a watcher twice, but feed_event catches that */ } #endif /*****************************************************************************/ #if EV_USE_TIMERFD static void periodics_reschedule (EV_P); static void timerfdcb (EV_P_ ev_io *iow, int revents) { struct itimerspec its = { 0 }; its.it_value.tv_sec = ev_rt_now + (int)MAX_BLOCKTIME2; timerfd_settime (timerfd, TFD_TIMER_ABSTIME | TFD_TIMER_CANCEL_ON_SET, &its, 0); ev_rt_now = ev_time (); /* periodics_reschedule only needs ev_rt_now */ /* but maybe in the future we want the full treatment. */ /* now_floor = EV_TS_CONST (0.); time_update (EV_A_ EV_TSTAMP_HUGE); */ #if EV_PERIODIC_ENABLE periodics_reschedule (EV_A); #endif } ecb_noinline ecb_cold static void evtimerfd_init (EV_P) { if (!ev_is_active (&timerfd_w)) { timerfd = timerfd_create (CLOCK_REALTIME, TFD_NONBLOCK | TFD_CLOEXEC); if (timerfd >= 0) { fd_intern (timerfd); /* just to be sure */ ev_io_init (&timerfd_w, timerfdcb, timerfd, EV_READ); ev_set_priority (&timerfd_w, EV_MINPRI); ev_io_start (EV_A_ &timerfd_w); ev_unref (EV_A); /* watcher should not keep loop alive */ /* (re-) arm timer */ timerfdcb (EV_A_ 0, 0); } } } #endif /*****************************************************************************/ #if EV_USE_IOCP # include "ev_iocp.c" #endif #if EV_USE_PORT # include "ev_port.c" #endif #if EV_USE_KQUEUE # include "ev_kqueue.c" #endif #if EV_USE_EPOLL # include "ev_epoll.c" #endif #if EV_USE_LINUXAIO # include "ev_linuxaio.c" #endif #if EV_USE_IOURING # include "ev_iouring.c" #endif #if EV_USE_POLL # include "ev_poll.c" #endif #if EV_USE_SELECT # include "ev_select.c" #endif ecb_cold int ev_version_major (void) EV_NOEXCEPT { return EV_VERSION_MAJOR; } ecb_cold int ev_version_minor (void) EV_NOEXCEPT { return EV_VERSION_MINOR; } /* return true if we are running with elevated privileges and should ignore env variables */ inline_size ecb_cold int enable_secure (void) { #ifdef _WIN32 return 0; #else return getuid () != geteuid () || getgid () != getegid (); #endif } ecb_cold unsigned int ev_supported_backends (void) EV_NOEXCEPT { unsigned int flags = 0; if (EV_USE_PORT ) flags |= EVBACKEND_PORT; if (EV_USE_KQUEUE ) flags |= EVBACKEND_KQUEUE; if (EV_USE_EPOLL ) flags |= EVBACKEND_EPOLL; if (EV_USE_LINUXAIO ) flags |= EVBACKEND_LINUXAIO; if (EV_USE_IOURING && ev_linux_version () >= 0x050601) flags |= EVBACKEND_IOURING; /* 5.6.1+ */ if (EV_USE_POLL ) flags |= EVBACKEND_POLL; if (EV_USE_SELECT ) flags |= EVBACKEND_SELECT; return flags; } ecb_cold unsigned int ev_recommended_backends (void) EV_NOEXCEPT { unsigned int flags = ev_supported_backends (); #ifndef __NetBSD__ /* kqueue is borked on everything but netbsd apparently */ /* it usually doesn't work correctly on anything but sockets and pipes */ flags &= ~EVBACKEND_KQUEUE; #endif #ifdef __APPLE__ /* only select works correctly on that "unix-certified" platform */ flags &= ~EVBACKEND_KQUEUE; /* horribly broken, even for sockets */ flags &= ~EVBACKEND_POLL; /* poll is based on kqueue from 10.5 onwards */ #endif #ifdef __FreeBSD__ flags &= ~EVBACKEND_POLL; /* poll return value is unusable (http://forums.freebsd.org/archive/index.php/t-10270.html) */ #endif /* TODO: linuxaio is very experimental */ #if !EV_RECOMMEND_LINUXAIO flags &= ~EVBACKEND_LINUXAIO; #endif /* TODO: linuxaio is super experimental */ #if !EV_RECOMMEND_IOURING flags &= ~EVBACKEND_IOURING; #endif return flags; } ecb_cold unsigned int ev_embeddable_backends (void) EV_NOEXCEPT { int flags = EVBACKEND_EPOLL | EVBACKEND_KQUEUE | EVBACKEND_PORT | EVBACKEND_IOURING; /* epoll embeddability broken on all linux versions up to at least 2.6.23 */ if (ev_linux_version () < 0x020620) /* disable it on linux < 2.6.32 */ flags &= ~EVBACKEND_EPOLL; /* EVBACKEND_LINUXAIO is theoretically embeddable, but suffers from a performance overhead */ return flags; } unsigned int ev_backend (EV_P) EV_NOEXCEPT { return backend; } #if EV_FEATURE_API unsigned int ev_iteration (EV_P) EV_NOEXCEPT { return loop_count; } unsigned int ev_depth (EV_P) EV_NOEXCEPT { return loop_depth; } void ev_set_io_collect_interval (EV_P_ ev_tstamp interval) EV_NOEXCEPT { io_blocktime = interval; } void ev_set_timeout_collect_interval (EV_P_ ev_tstamp interval) EV_NOEXCEPT { timeout_blocktime = interval; } void ev_set_userdata (EV_P_ void *data) EV_NOEXCEPT { userdata = data; } void * ev_userdata (EV_P) EV_NOEXCEPT { return userdata; } void ev_set_invoke_pending_cb (EV_P_ ev_loop_callback invoke_pending_cb) EV_NOEXCEPT { invoke_cb = invoke_pending_cb; } void ev_set_loop_release_cb (EV_P_ void (*release)(EV_P) EV_NOEXCEPT, void (*acquire)(EV_P) EV_NOEXCEPT) EV_NOEXCEPT { release_cb = release; acquire_cb = acquire; } #endif /* initialise a loop structure, must be zero-initialised */ ecb_noinline ecb_cold static void loop_init (EV_P_ unsigned int flags) EV_NOEXCEPT { if (!backend) { origflags = flags; #if EV_USE_REALTIME if (!have_realtime) { struct timespec ts; if (!clock_gettime (CLOCK_REALTIME, &ts)) have_realtime = 1; } #endif #if EV_USE_MONOTONIC if (!have_monotonic) { struct timespec ts; if (!clock_gettime (CLOCK_MONOTONIC, &ts)) have_monotonic = 1; } #endif /* pid check not overridable via env */ #ifndef _WIN32 if (flags & EVFLAG_FORKCHECK) curpid = getpid (); #endif if (!(flags & EVFLAG_NOENV) && !enable_secure () && getenv ("LIBEV_FLAGS")) flags = atoi (getenv ("LIBEV_FLAGS")); ev_rt_now = ev_time (); mn_now = get_clock (); now_floor = mn_now; rtmn_diff = ev_rt_now - mn_now; #if EV_FEATURE_API invoke_cb = ev_invoke_pending; #endif io_blocktime = 0.; timeout_blocktime = 0.; backend = 0; backend_fd = -1; sig_pending = 0; #if EV_ASYNC_ENABLE async_pending = 0; #endif pipe_write_skipped = 0; pipe_write_wanted = 0; evpipe [0] = -1; evpipe [1] = -1; #if EV_USE_INOTIFY fs_fd = flags & EVFLAG_NOINOTIFY ? -1 : -2; #endif #if EV_USE_SIGNALFD sigfd = flags & EVFLAG_SIGNALFD ? -2 : -1; #endif #if EV_USE_TIMERFD timerfd = flags & EVFLAG_NOTIMERFD ? -1 : -2; #endif if (!(flags & EVBACKEND_MASK)) flags |= ev_recommended_backends (); #if EV_USE_IOCP if (!backend && (flags & EVBACKEND_IOCP )) backend = iocp_init (EV_A_ flags); #endif #if EV_USE_PORT if (!backend && (flags & EVBACKEND_PORT )) backend = port_init (EV_A_ flags); #endif #if EV_USE_KQUEUE if (!backend && (flags & EVBACKEND_KQUEUE )) backend = kqueue_init (EV_A_ flags); #endif #if EV_USE_IOURING if (!backend && (flags & EVBACKEND_IOURING )) backend = iouring_init (EV_A_ flags); #endif #if EV_USE_LINUXAIO if (!backend && (flags & EVBACKEND_LINUXAIO)) backend = linuxaio_init (EV_A_ flags); #endif #if EV_USE_EPOLL if (!backend && (flags & EVBACKEND_EPOLL )) backend = epoll_init (EV_A_ flags); #endif #if EV_USE_POLL if (!backend && (flags & EVBACKEND_POLL )) backend = poll_init (EV_A_ flags); #endif #if EV_USE_SELECT if (!backend && (flags & EVBACKEND_SELECT )) backend = select_init (EV_A_ flags); #endif ev_prepare_init (&pending_w, pendingcb); #if EV_SIGNAL_ENABLE || EV_ASYNC_ENABLE ev_init (&pipe_w, pipecb); ev_set_priority (&pipe_w, EV_MAXPRI); #endif } } /* free up a loop structure */ ecb_cold void ev_loop_destroy (EV_P) { int i; #if EV_MULTIPLICITY /* mimic free (0) */ if (!EV_A) return; #endif #if EV_CLEANUP_ENABLE /* queue cleanup watchers (and execute them) */ if (ecb_expect_false (cleanupcnt)) { queue_events (EV_A_ (W *)cleanups, cleanupcnt, EV_CLEANUP); EV_INVOKE_PENDING; } #endif #if EV_CHILD_ENABLE if (ev_is_default_loop (EV_A) && ev_is_active (&childev)) { ev_ref (EV_A); /* child watcher */ ev_signal_stop (EV_A_ &childev); } #endif if (ev_is_active (&pipe_w)) { /*ev_ref (EV_A);*/ /*ev_io_stop (EV_A_ &pipe_w);*/ if (evpipe [0] >= 0) EV_WIN32_CLOSE_FD (evpipe [0]); if (evpipe [1] >= 0) EV_WIN32_CLOSE_FD (evpipe [1]); } #if EV_USE_SIGNALFD if (ev_is_active (&sigfd_w)) close (sigfd); #endif #if EV_USE_TIMERFD if (ev_is_active (&timerfd_w)) close (timerfd); #endif #if EV_USE_INOTIFY if (fs_fd >= 0) close (fs_fd); #endif if (backend_fd >= 0) close (backend_fd); #if EV_USE_IOCP if (backend == EVBACKEND_IOCP ) iocp_destroy (EV_A); #endif #if EV_USE_PORT if (backend == EVBACKEND_PORT ) port_destroy (EV_A); #endif #if EV_USE_KQUEUE if (backend == EVBACKEND_KQUEUE ) kqueue_destroy (EV_A); #endif #if EV_USE_IOURING if (backend == EVBACKEND_IOURING ) iouring_destroy (EV_A); #endif #if EV_USE_LINUXAIO if (backend == EVBACKEND_LINUXAIO) linuxaio_destroy (EV_A); #endif #if EV_USE_EPOLL if (backend == EVBACKEND_EPOLL ) epoll_destroy (EV_A); #endif #if EV_USE_POLL if (backend == EVBACKEND_POLL ) poll_destroy (EV_A); #endif #if EV_USE_SELECT if (backend == EVBACKEND_SELECT ) select_destroy (EV_A); #endif for (i = NUMPRI; i--; ) { array_free (pending, [i]); #if EV_IDLE_ENABLE array_free (idle, [i]); #endif } ev_free (anfds); anfds = 0; anfdmax = 0; /* have to use the microsoft-never-gets-it-right macro */ array_free (rfeed, EMPTY); array_free (fdchange, EMPTY); array_free (timer, EMPTY); #if EV_PERIODIC_ENABLE array_free (periodic, EMPTY); #endif #if EV_FORK_ENABLE array_free (fork, EMPTY); #endif #if EV_CLEANUP_ENABLE array_free (cleanup, EMPTY); #endif array_free (prepare, EMPTY); array_free (check, EMPTY); #if EV_ASYNC_ENABLE array_free (async, EMPTY); #endif backend = 0; #if EV_MULTIPLICITY if (ev_is_default_loop (EV_A)) #endif ev_default_loop_ptr = 0; #if EV_MULTIPLICITY else ev_free (EV_A); #endif } #if EV_USE_INOTIFY inline_size void infy_fork (EV_P); #endif inline_size void loop_fork (EV_P) { #if EV_USE_PORT if (backend == EVBACKEND_PORT ) port_fork (EV_A); #endif #if EV_USE_KQUEUE if (backend == EVBACKEND_KQUEUE ) kqueue_fork (EV_A); #endif #if EV_USE_IOURING if (backend == EVBACKEND_IOURING ) iouring_fork (EV_A); #endif #if EV_USE_LINUXAIO if (backend == EVBACKEND_LINUXAIO) linuxaio_fork (EV_A); #endif #if EV_USE_EPOLL if (backend == EVBACKEND_EPOLL ) epoll_fork (EV_A); #endif #if EV_USE_INOTIFY infy_fork (EV_A); #endif if (postfork != 2) { #if EV_USE_SIGNALFD /* surprisingly, nothing needs to be done for signalfd, accoridng to docs, it does the right thing on fork */ #endif #if EV_USE_TIMERFD if (ev_is_active (&timerfd_w)) { ev_ref (EV_A); ev_io_stop (EV_A_ &timerfd_w); close (timerfd); timerfd = -2; evtimerfd_init (EV_A); /* reschedule periodics, in case we missed something */ ev_feed_event (EV_A_ &timerfd_w, EV_CUSTOM); } #endif #if EV_SIGNAL_ENABLE || EV_ASYNC_ENABLE if (ev_is_active (&pipe_w)) { /* pipe_write_wanted must be false now, so modifying fd vars should be safe */ ev_ref (EV_A); ev_io_stop (EV_A_ &pipe_w); if (evpipe [0] >= 0) EV_WIN32_CLOSE_FD (evpipe [0]); evpipe_init (EV_A); /* iterate over everything, in case we missed something before */ ev_feed_event (EV_A_ &pipe_w, EV_CUSTOM); } #endif } postfork = 0; } #if EV_MULTIPLICITY ecb_cold struct ev_loop * ev_loop_new (unsigned int flags) EV_NOEXCEPT { EV_P = (struct ev_loop *)ev_malloc (sizeof (struct ev_loop)); memset (EV_A, 0, sizeof (struct ev_loop)); loop_init (EV_A_ flags); if (ev_backend (EV_A)) return EV_A; ev_free (EV_A); return 0; } #endif /* multiplicity */ #if EV_VERIFY ecb_noinline ecb_cold static void verify_watcher (EV_P_ W w) { assert (("libev: watcher has invalid priority", ABSPRI (w) >= 0 && ABSPRI (w) < NUMPRI)); if (w->pending) assert (("libev: pending watcher not on pending queue", pendings [ABSPRI (w)][w->pending - 1].w == w)); } ecb_noinline ecb_cold static void verify_heap (EV_P_ ANHE *heap, int N) { int i; for (i = HEAP0; i < N + HEAP0; ++i) { assert (("libev: active index mismatch in heap", ev_active (ANHE_w (heap [i])) == i)); assert (("libev: heap condition violated", i == HEAP0 || ANHE_at (heap [HPARENT (i)]) <= ANHE_at (heap [i]))); assert (("libev: heap at cache mismatch", ANHE_at (heap [i]) == ev_at (ANHE_w (heap [i])))); verify_watcher (EV_A_ (W)ANHE_w (heap [i])); } } ecb_noinline ecb_cold static void array_verify (EV_P_ W *ws, int cnt) { while (cnt--) { assert (("libev: active index mismatch", ev_active (ws [cnt]) == cnt + 1)); verify_watcher (EV_A_ ws [cnt]); } } #endif #if EV_FEATURE_API void ecb_cold ev_verify (EV_P) EV_NOEXCEPT { #if EV_VERIFY int i; WL w, w2; assert (activecnt >= -1); assert (fdchangemax >= fdchangecnt); for (i = 0; i < fdchangecnt; ++i) assert (("libev: negative fd in fdchanges", fdchanges [i] >= 0)); assert (anfdmax >= 0); for (i = 0; i < anfdmax; ++i) { int j = 0; for (w = w2 = anfds [i].head; w; w = w->next) { verify_watcher (EV_A_ (W)w); if (j++ & 1) { assert (("libev: io watcher list contains a loop", w != w2)); w2 = w2->next; } assert (("libev: inactive fd watcher on anfd list", ev_active (w) == 1)); assert (("libev: fd mismatch between watcher and anfd", ((ev_io *)w)->fd == i)); } } assert (timermax >= timercnt); verify_heap (EV_A_ timers, timercnt); #if EV_PERIODIC_ENABLE assert (periodicmax >= periodiccnt); verify_heap (EV_A_ periodics, periodiccnt); #endif for (i = NUMPRI; i--; ) { assert (pendingmax [i] >= pendingcnt [i]); #if EV_IDLE_ENABLE assert (idleall >= 0); assert (idlemax [i] >= idlecnt [i]); array_verify (EV_A_ (W *)idles [i], idlecnt [i]); #endif } #if EV_FORK_ENABLE assert (forkmax >= forkcnt); array_verify (EV_A_ (W *)forks, forkcnt); #endif #if EV_CLEANUP_ENABLE assert (cleanupmax >= cleanupcnt); array_verify (EV_A_ (W *)cleanups, cleanupcnt); #endif #if EV_ASYNC_ENABLE assert (asyncmax >= asynccnt); array_verify (EV_A_ (W *)asyncs, asynccnt); #endif #if EV_PREPARE_ENABLE assert (preparemax >= preparecnt); array_verify (EV_A_ (W *)prepares, preparecnt); #endif #if EV_CHECK_ENABLE assert (checkmax >= checkcnt); array_verify (EV_A_ (W *)checks, checkcnt); #endif # if 0 #if EV_CHILD_ENABLE for (w = (ev_child *)childs [chain & ((EV_PID_HASHSIZE) - 1)]; w; w = (ev_child *)((WL)w)->next) for (signum = EV_NSIG - 1; signum--; ) if (signals [signum].pending) #endif # endif #endif } #endif #if EV_MULTIPLICITY ecb_cold struct ev_loop * #else int #endif ev_default_loop (unsigned int flags) EV_NOEXCEPT { if (!ev_default_loop_ptr) { #if EV_MULTIPLICITY EV_P = ev_default_loop_ptr = &default_loop_struct; #else ev_default_loop_ptr = 1; #endif loop_init (EV_A_ flags); if (ev_backend (EV_A)) { #if EV_CHILD_ENABLE ev_signal_init (&childev, childcb, SIGCHLD); ev_set_priority (&childev, EV_MAXPRI); ev_signal_start (EV_A_ &childev); ev_unref (EV_A); /* child watcher should not keep loop alive */ #endif } else ev_default_loop_ptr = 0; } return ev_default_loop_ptr; } void ev_loop_fork (EV_P) EV_NOEXCEPT { postfork = 1; } /*****************************************************************************/ void ev_invoke (EV_P_ void *w, int revents) { EV_CB_INVOKE ((W)w, revents); } unsigned int ev_pending_count (EV_P) EV_NOEXCEPT { int pri; unsigned int count = 0; for (pri = NUMPRI; pri--; ) count += pendingcnt [pri]; return count; } ecb_noinline void ev_invoke_pending (EV_P) { pendingpri = NUMPRI; do { --pendingpri; /* pendingpri possibly gets modified in the inner loop */ while (pendingcnt [pendingpri]) { ANPENDING *p = pendings [pendingpri] + --pendingcnt [pendingpri]; p->w->pending = 0; EV_CB_INVOKE (p->w, p->events); EV_FREQUENT_CHECK; } } while (pendingpri); } #if EV_IDLE_ENABLE /* make idle watchers pending. this handles the "call-idle */ /* only when higher priorities are idle" logic */ inline_size void idle_reify (EV_P) { if (ecb_expect_false (idleall)) { int pri; for (pri = NUMPRI; pri--; ) { if (pendingcnt [pri]) break; if (idlecnt [pri]) { queue_events (EV_A_ (W *)idles [pri], idlecnt [pri], EV_IDLE); break; } } } } #endif /* make timers pending */ inline_size void timers_reify (EV_P) { EV_FREQUENT_CHECK; if (timercnt && ANHE_at (timers [HEAP0]) < mn_now) { do { ev_timer *w = (ev_timer *)ANHE_w (timers [HEAP0]); /*assert (("libev: inactive timer on timer heap detected", ev_is_active (w)));*/ /* first reschedule or stop timer */ if (w->repeat) { ev_at (w) += w->repeat; if (ev_at (w) < mn_now) ev_at (w) = mn_now; assert (("libev: negative ev_timer repeat value found while processing timers", w->repeat > EV_TS_CONST (0.))); ANHE_at_cache (timers [HEAP0]); downheap (timers, timercnt, HEAP0); } else ev_timer_stop (EV_A_ w); /* nonrepeating: stop timer */ EV_FREQUENT_CHECK; feed_reverse (EV_A_ (W)w); } while (timercnt && ANHE_at (timers [HEAP0]) < mn_now); feed_reverse_done (EV_A_ EV_TIMER); } } #if EV_PERIODIC_ENABLE ecb_noinline static void periodic_recalc (EV_P_ ev_periodic *w) { ev_tstamp interval = w->interval > MIN_INTERVAL ? w->interval : MIN_INTERVAL; ev_tstamp at = w->offset + interval * ev_floor ((ev_rt_now - w->offset) / interval); /* the above almost always errs on the low side */ while (at <= ev_rt_now) { ev_tstamp nat = at + w->interval; /* when resolution fails us, we use ev_rt_now */ if (ecb_expect_false (nat == at)) { at = ev_rt_now; break; } at = nat; } ev_at (w) = at; } /* make periodics pending */ inline_size void periodics_reify (EV_P) { EV_FREQUENT_CHECK; while (periodiccnt && ANHE_at (periodics [HEAP0]) < ev_rt_now) { do { ev_periodic *w = (ev_periodic *)ANHE_w (periodics [HEAP0]); /*assert (("libev: inactive timer on periodic heap detected", ev_is_active (w)));*/ /* first reschedule or stop timer */ if (w->reschedule_cb) { ev_at (w) = w->reschedule_cb (w, ev_rt_now); assert (("libev: ev_periodic reschedule callback returned time in the past", ev_at (w) >= ev_rt_now)); ANHE_at_cache (periodics [HEAP0]); downheap (periodics, periodiccnt, HEAP0); } else if (w->interval) { periodic_recalc (EV_A_ w); ANHE_at_cache (periodics [HEAP0]); downheap (periodics, periodiccnt, HEAP0); } else ev_periodic_stop (EV_A_ w); /* nonrepeating: stop timer */ EV_FREQUENT_CHECK; feed_reverse (EV_A_ (W)w); } while (periodiccnt && ANHE_at (periodics [HEAP0]) < ev_rt_now); feed_reverse_done (EV_A_ EV_PERIODIC); } } /* simply recalculate all periodics */ /* TODO: maybe ensure that at least one event happens when jumping forward? */ ecb_noinline ecb_cold static void periodics_reschedule (EV_P) { int i; /* adjust periodics after time jump */ for (i = HEAP0; i < periodiccnt + HEAP0; ++i) { ev_periodic *w = (ev_periodic *)ANHE_w (periodics [i]); if (w->reschedule_cb) ev_at (w) = w->reschedule_cb (w, ev_rt_now); else if (w->interval) periodic_recalc (EV_A_ w); ANHE_at_cache (periodics [i]); } reheap (periodics, periodiccnt); } #endif /* adjust all timers by a given offset */ ecb_noinline ecb_cold static void timers_reschedule (EV_P_ ev_tstamp adjust) { int i; for (i = 0; i < timercnt; ++i) { ANHE *he = timers + i + HEAP0; ANHE_w (*he)->at += adjust; ANHE_at_cache (*he); } } /* fetch new monotonic and realtime times from the kernel */ /* also detect if there was a timejump, and act accordingly */ inline_speed void time_update (EV_P_ ev_tstamp max_block) { #if EV_USE_MONOTONIC if (ecb_expect_true (have_monotonic)) { int i; ev_tstamp odiff = rtmn_diff; mn_now = get_clock (); /* only fetch the realtime clock every 0.5*MIN_TIMEJUMP seconds */ /* interpolate in the meantime */ if (ecb_expect_true (mn_now - now_floor < EV_TS_CONST (MIN_TIMEJUMP * .5))) { ev_rt_now = rtmn_diff + mn_now; return; } now_floor = mn_now; ev_rt_now = ev_time (); /* loop a few times, before making important decisions. * on the choice of "4": one iteration isn't enough, * in case we get preempted during the calls to * ev_time and get_clock. a second call is almost guaranteed * to succeed in that case, though. and looping a few more times * doesn't hurt either as we only do this on time-jumps or * in the unlikely event of having been preempted here. */ for (i = 4; --i; ) { ev_tstamp diff; rtmn_diff = ev_rt_now - mn_now; diff = odiff - rtmn_diff; if (ecb_expect_true ((diff < EV_TS_CONST (0.) ? -diff : diff) < EV_TS_CONST (MIN_TIMEJUMP))) return; /* all is well */ ev_rt_now = ev_time (); mn_now = get_clock (); now_floor = mn_now; } /* no timer adjustment, as the monotonic clock doesn't jump */ /* timers_reschedule (EV_A_ rtmn_diff - odiff) */ # if EV_PERIODIC_ENABLE periodics_reschedule (EV_A); # endif } else #endif { ev_rt_now = ev_time (); if (ecb_expect_false (mn_now > ev_rt_now || ev_rt_now > mn_now + max_block + EV_TS_CONST (MIN_TIMEJUMP))) { /* adjust timers. this is easy, as the offset is the same for all of them */ timers_reschedule (EV_A_ ev_rt_now - mn_now); #if EV_PERIODIC_ENABLE periodics_reschedule (EV_A); #endif } mn_now = ev_rt_now; } } int ev_run (EV_P_ int flags) { #if EV_FEATURE_API ++loop_depth; #endif assert (("libev: ev_loop recursion during release detected", loop_done != EVBREAK_RECURSE)); loop_done = EVBREAK_CANCEL; EV_INVOKE_PENDING; /* in case we recurse, ensure ordering stays nice and clean */ do { #if EV_VERIFY >= 2 ev_verify (EV_A); #endif #ifndef _WIN32 if (ecb_expect_false (curpid)) /* penalise the forking check even more */ if (ecb_expect_false (getpid () != curpid)) { curpid = getpid (); postfork = 1; } #endif #if EV_FORK_ENABLE /* we might have forked, so queue fork handlers */ if (ecb_expect_false (postfork)) if (forkcnt) { queue_events (EV_A_ (W *)forks, forkcnt, EV_FORK); EV_INVOKE_PENDING; } #endif #if EV_PREPARE_ENABLE /* queue prepare watchers (and execute them) */ if (ecb_expect_false (preparecnt)) { queue_events (EV_A_ (W *)prepares, preparecnt, EV_PREPARE); EV_INVOKE_PENDING; } #endif if (ecb_expect_false (loop_done)) break; /* we might have forked, so reify kernel state if necessary */ if (ecb_expect_false (postfork)) loop_fork (EV_A); /* update fd-related kernel structures */ fd_reify (EV_A); /* calculate blocking time */ { ev_tstamp waittime = 0.; ev_tstamp sleeptime = 0.; /* remember old timestamp for io_blocktime calculation */ ev_tstamp prev_mn_now = mn_now; /* update time to cancel out callback processing overhead */ time_update (EV_A_ EV_TS_CONST (EV_TSTAMP_HUGE)); /* from now on, we want a pipe-wake-up */ pipe_write_wanted = 1; ECB_MEMORY_FENCE; /* make sure pipe_write_wanted is visible before we check for potential skips */ if (ecb_expect_true (!(flags & EVRUN_NOWAIT || idleall || !activecnt || pipe_write_skipped))) { waittime = EV_TS_CONST (MAX_BLOCKTIME); #if EV_USE_TIMERFD /* sleep a lot longer when we can reliably detect timejumps */ if (ecb_expect_true (timerfd >= 0)) waittime = EV_TS_CONST (MAX_BLOCKTIME2); #endif #if !EV_PERIODIC_ENABLE /* without periodics but with monotonic clock there is no need */ /* for any time jump detection, so sleep longer */ if (ecb_expect_true (have_monotonic)) waittime = EV_TS_CONST (MAX_BLOCKTIME2); #endif if (timercnt) { ev_tstamp to = ANHE_at (timers [HEAP0]) - mn_now; if (waittime > to) waittime = to; } #if EV_PERIODIC_ENABLE if (periodiccnt) { ev_tstamp to = ANHE_at (periodics [HEAP0]) - ev_rt_now; if (waittime > to) waittime = to; } #endif /* don't let timeouts decrease the waittime below timeout_blocktime */ if (ecb_expect_false (waittime < timeout_blocktime)) waittime = timeout_blocktime; /* now there are two more special cases left, either we have * already-expired timers, so we should not sleep, or we have timers * that expire very soon, in which case we need to wait for a minimum * amount of time for some event loop backends. */ if (ecb_expect_false (waittime < backend_mintime)) waittime = waittime <= EV_TS_CONST (0.) ? EV_TS_CONST (0.) : backend_mintime; /* extra check because io_blocktime is commonly 0 */ if (ecb_expect_false (io_blocktime)) { sleeptime = io_blocktime - (mn_now - prev_mn_now); if (sleeptime > waittime - backend_mintime) sleeptime = waittime - backend_mintime; if (ecb_expect_true (sleeptime > EV_TS_CONST (0.))) { ev_sleep (sleeptime); waittime -= sleeptime; } } } #if EV_FEATURE_API ++loop_count; #endif assert ((loop_done = EVBREAK_RECURSE, 1)); /* assert for side effect */ backend_poll (EV_A_ waittime); assert ((loop_done = EVBREAK_CANCEL, 1)); /* assert for side effect */ pipe_write_wanted = 0; /* just an optimisation, no fence needed */ ECB_MEMORY_FENCE_ACQUIRE; if (pipe_write_skipped) { assert (("libev: pipe_w not active, but pipe not written", ev_is_active (&pipe_w))); ev_feed_event (EV_A_ &pipe_w, EV_CUSTOM); } /* update ev_rt_now, do magic */ time_update (EV_A_ waittime + sleeptime); } /* queue pending timers and reschedule them */ timers_reify (EV_A); /* relative timers called last */ #if EV_PERIODIC_ENABLE periodics_reify (EV_A); /* absolute timers called first */ #endif #if EV_IDLE_ENABLE /* queue idle watchers unless other events are pending */ idle_reify (EV_A); #endif #if EV_CHECK_ENABLE /* queue check watchers, to be executed first */ if (ecb_expect_false (checkcnt)) queue_events (EV_A_ (W *)checks, checkcnt, EV_CHECK); #endif EV_INVOKE_PENDING; } while (ecb_expect_true ( activecnt && !loop_done && !(flags & (EVRUN_ONCE | EVRUN_NOWAIT)) )); if (loop_done == EVBREAK_ONE) loop_done = EVBREAK_CANCEL; #if EV_FEATURE_API --loop_depth; #endif return activecnt; } void ev_break (EV_P_ int how) EV_NOEXCEPT { loop_done = how; } void ev_ref (EV_P) EV_NOEXCEPT { ++activecnt; } void ev_unref (EV_P) EV_NOEXCEPT { --activecnt; } void ev_now_update (EV_P) EV_NOEXCEPT { time_update (EV_A_ EV_TSTAMP_HUGE); } void ev_suspend (EV_P) EV_NOEXCEPT { ev_now_update (EV_A); } void ev_resume (EV_P) EV_NOEXCEPT { ev_tstamp mn_prev = mn_now; ev_now_update (EV_A); timers_reschedule (EV_A_ mn_now - mn_prev); #if EV_PERIODIC_ENABLE /* TODO: really do this? */ periodics_reschedule (EV_A); #endif } /*****************************************************************************/ /* singly-linked list management, used when the expected list length is short */ inline_size void wlist_add (WL *head, WL elem) { elem->next = *head; *head = elem; } inline_size void wlist_del (WL *head, WL elem) { while (*head) { if (ecb_expect_true (*head == elem)) { *head = elem->next; break; } head = &(*head)->next; } } /* internal, faster, version of ev_clear_pending */ inline_speed void clear_pending (EV_P_ W w) { if (w->pending) { pendings [ABSPRI (w)][w->pending - 1].w = (W)&pending_w; w->pending = 0; } } int ev_clear_pending (EV_P_ void *w) EV_NOEXCEPT { W w_ = (W)w; int pending = w_->pending; if (ecb_expect_true (pending)) { ANPENDING *p = pendings [ABSPRI (w_)] + pending - 1; p->w = (W)&pending_w; w_->pending = 0; return p->events; } else return 0; } inline_size void pri_adjust (EV_P_ W w) { int pri = ev_priority (w); pri = pri < EV_MINPRI ? EV_MINPRI : pri; pri = pri > EV_MAXPRI ? EV_MAXPRI : pri; ev_set_priority (w, pri); } inline_speed void ev_start (EV_P_ W w, int active) { pri_adjust (EV_A_ w); w->active = active; ev_ref (EV_A); } inline_size void ev_stop (EV_P_ W w) { ev_unref (EV_A); w->active = 0; } /*****************************************************************************/ ecb_noinline void ev_io_start (EV_P_ ev_io *w) EV_NOEXCEPT { int fd = w->fd; if (ecb_expect_false (ev_is_active (w))) return; assert (("libev: ev_io_start called with negative fd", fd >= 0)); assert (("libev: ev_io_start called with illegal event mask", !(w->events & ~(EV__IOFDSET | EV_READ | EV_WRITE)))); #if EV_VERIFY >= 2 assert (("libev: ev_io_start called on watcher with invalid fd", fd_valid (fd))); #endif EV_FREQUENT_CHECK; ev_start (EV_A_ (W)w, 1); array_needsize (ANFD, anfds, anfdmax, fd + 1, array_needsize_zerofill); wlist_add (&anfds[fd].head, (WL)w); /* common bug, apparently */ assert (("libev: ev_io_start called with corrupted watcher", ((WL)w)->next != (WL)w)); fd_change (EV_A_ fd, (w->events & EV__IOFDSET) | EV_ANFD_REIFY); w->events &= ~EV__IOFDSET; EV_FREQUENT_CHECK; } ecb_noinline void ev_io_stop (EV_P_ ev_io *w) EV_NOEXCEPT { clear_pending (EV_A_ (W)w); if (ecb_expect_false (!ev_is_active (w))) return; assert (("libev: ev_io_stop called with illegal fd (must stay constant after start!)", w->fd >= 0 && w->fd < anfdmax)); #if EV_VERIFY >= 2 assert (("libev: ev_io_stop called on watcher with invalid fd", fd_valid (w->fd))); #endif EV_FREQUENT_CHECK; wlist_del (&anfds[w->fd].head, (WL)w); ev_stop (EV_A_ (W)w); fd_change (EV_A_ w->fd, EV_ANFD_REIFY); EV_FREQUENT_CHECK; } ecb_noinline void ev_timer_start (EV_P_ ev_timer *w) EV_NOEXCEPT { if (ecb_expect_false (ev_is_active (w))) return; ev_at (w) += mn_now; assert (("libev: ev_timer_start called with negative timer repeat value", w->repeat >= 0.)); EV_FREQUENT_CHECK; ++timercnt; ev_start (EV_A_ (W)w, timercnt + HEAP0 - 1); array_needsize (ANHE, timers, timermax, ev_active (w) + 1, array_needsize_noinit); ANHE_w (timers [ev_active (w)]) = (WT)w; ANHE_at_cache (timers [ev_active (w)]); upheap (timers, ev_active (w)); EV_FREQUENT_CHECK; /*assert (("libev: internal timer heap corruption", timers [ev_active (w)] == (WT)w));*/ } ecb_noinline void ev_timer_stop (EV_P_ ev_timer *w) EV_NOEXCEPT { clear_pending (EV_A_ (W)w); if (ecb_expect_false (!ev_is_active (w))) return; EV_FREQUENT_CHECK; { int active = ev_active (w); assert (("libev: internal timer heap corruption", ANHE_w (timers [active]) == (WT)w)); --timercnt; if (ecb_expect_true (active < timercnt + HEAP0)) { timers [active] = timers [timercnt + HEAP0]; adjustheap (timers, timercnt, active); } } ev_at (w) -= mn_now; ev_stop (EV_A_ (W)w); EV_FREQUENT_CHECK; } ecb_noinline void ev_timer_again (EV_P_ ev_timer *w) EV_NOEXCEPT { EV_FREQUENT_CHECK; clear_pending (EV_A_ (W)w); if (ev_is_active (w)) { if (w->repeat) { ev_at (w) = mn_now + w->repeat; ANHE_at_cache (timers [ev_active (w)]); adjustheap (timers, timercnt, ev_active (w)); } else ev_timer_stop (EV_A_ w); } else if (w->repeat) { ev_at (w) = w->repeat; ev_timer_start (EV_A_ w); } EV_FREQUENT_CHECK; } ev_tstamp ev_timer_remaining (EV_P_ ev_timer *w) EV_NOEXCEPT { return ev_at (w) - (ev_is_active (w) ? mn_now : EV_TS_CONST (0.)); } #if EV_PERIODIC_ENABLE ecb_noinline void ev_periodic_start (EV_P_ ev_periodic *w) EV_NOEXCEPT { if (ecb_expect_false (ev_is_active (w))) return; #if EV_USE_TIMERFD if (timerfd == -2) evtimerfd_init (EV_A); #endif if (w->reschedule_cb) ev_at (w) = w->reschedule_cb (w, ev_rt_now); else if (w->interval) { assert (("libev: ev_periodic_start called with negative interval value", w->interval >= 0.)); periodic_recalc (EV_A_ w); } else ev_at (w) = w->offset; EV_FREQUENT_CHECK; ++periodiccnt; ev_start (EV_A_ (W)w, periodiccnt + HEAP0 - 1); array_needsize (ANHE, periodics, periodicmax, ev_active (w) + 1, array_needsize_noinit); ANHE_w (periodics [ev_active (w)]) = (WT)w; ANHE_at_cache (periodics [ev_active (w)]); upheap (periodics, ev_active (w)); EV_FREQUENT_CHECK; /*assert (("libev: internal periodic heap corruption", ANHE_w (periodics [ev_active (w)]) == (WT)w));*/ } ecb_noinline void ev_periodic_stop (EV_P_ ev_periodic *w) EV_NOEXCEPT { clear_pending (EV_A_ (W)w); if (ecb_expect_false (!ev_is_active (w))) return; EV_FREQUENT_CHECK; { int active = ev_active (w); assert (("libev: internal periodic heap corruption", ANHE_w (periodics [active]) == (WT)w)); --periodiccnt; if (ecb_expect_true (active < periodiccnt + HEAP0)) { periodics [active] = periodics [periodiccnt + HEAP0]; adjustheap (periodics, periodiccnt, active); } } ev_stop (EV_A_ (W)w); EV_FREQUENT_CHECK; } ecb_noinline void ev_periodic_again (EV_P_ ev_periodic *w) EV_NOEXCEPT { /* TODO: use adjustheap and recalculation */ ev_periodic_stop (EV_A_ w); ev_periodic_start (EV_A_ w); } #endif #ifndef SA_RESTART # define SA_RESTART 0 #endif #if EV_SIGNAL_ENABLE ecb_noinline void ev_signal_start (EV_P_ ev_signal *w) EV_NOEXCEPT { if (ecb_expect_false (ev_is_active (w))) return; assert (("libev: ev_signal_start called with illegal signal number", w->signum > 0 && w->signum < EV_NSIG)); #if EV_MULTIPLICITY assert (("libev: a signal must not be attached to two different loops", !signals [w->signum - 1].loop || signals [w->signum - 1].loop == loop)); signals [w->signum - 1].loop = EV_A; ECB_MEMORY_FENCE_RELEASE; #endif EV_FREQUENT_CHECK; #if EV_USE_SIGNALFD if (sigfd == -2) { sigfd = signalfd (-1, &sigfd_set, SFD_NONBLOCK | SFD_CLOEXEC); if (sigfd < 0 && errno == EINVAL) sigfd = signalfd (-1, &sigfd_set, 0); /* retry without flags */ if (sigfd >= 0) { fd_intern (sigfd); /* doing it twice will not hurt */ sigemptyset (&sigfd_set); ev_io_init (&sigfd_w, sigfdcb, sigfd, EV_READ); ev_set_priority (&sigfd_w, EV_MAXPRI); ev_io_start (EV_A_ &sigfd_w); ev_unref (EV_A); /* signalfd watcher should not keep loop alive */ } } if (sigfd >= 0) { /* TODO: check .head */ sigaddset (&sigfd_set, w->signum); sigprocmask (SIG_BLOCK, &sigfd_set, 0); signalfd (sigfd, &sigfd_set, 0); } #endif ev_start (EV_A_ (W)w, 1); wlist_add (&signals [w->signum - 1].head, (WL)w); if (!((WL)w)->next) # if EV_USE_SIGNALFD if (sigfd < 0) /*TODO*/ # endif { # ifdef _WIN32 evpipe_init (EV_A); signal (w->signum, ev_sighandler); # else struct sigaction sa; evpipe_init (EV_A); sa.sa_handler = ev_sighandler; sigfillset (&sa.sa_mask); sa.sa_flags = SA_RESTART; /* if restarting works we save one iteration */ sigaction (w->signum, &sa, 0); if (origflags & EVFLAG_NOSIGMASK) { sigemptyset (&sa.sa_mask); sigaddset (&sa.sa_mask, w->signum); sigprocmask (SIG_UNBLOCK, &sa.sa_mask, 0); } #endif } EV_FREQUENT_CHECK; } ecb_noinline void ev_signal_stop (EV_P_ ev_signal *w) EV_NOEXCEPT { clear_pending (EV_A_ (W)w); if (ecb_expect_false (!ev_is_active (w))) return; EV_FREQUENT_CHECK; wlist_del (&signals [w->signum - 1].head, (WL)w); ev_stop (EV_A_ (W)w); if (!signals [w->signum - 1].head) { #if EV_MULTIPLICITY signals [w->signum - 1].loop = 0; /* unattach from signal */ #endif #if EV_USE_SIGNALFD if (sigfd >= 0) { sigset_t ss; sigemptyset (&ss); sigaddset (&ss, w->signum); sigdelset (&sigfd_set, w->signum); signalfd (sigfd, &sigfd_set, 0); sigprocmask (SIG_UNBLOCK, &ss, 0); } else #endif signal (w->signum, SIG_DFL); } EV_FREQUENT_CHECK; } #endif #if EV_CHILD_ENABLE void ev_child_start (EV_P_ ev_child *w) EV_NOEXCEPT { #if EV_MULTIPLICITY assert (("libev: child watchers are only supported in the default loop", loop == ev_default_loop_ptr)); #endif if (ecb_expect_false (ev_is_active (w))) return; EV_FREQUENT_CHECK; ev_start (EV_A_ (W)w, 1); wlist_add (&childs [w->pid & ((EV_PID_HASHSIZE) - 1)], (WL)w); EV_FREQUENT_CHECK; } void ev_child_stop (EV_P_ ev_child *w) EV_NOEXCEPT { clear_pending (EV_A_ (W)w); if (ecb_expect_false (!ev_is_active (w))) return; EV_FREQUENT_CHECK; wlist_del (&childs [w->pid & ((EV_PID_HASHSIZE) - 1)], (WL)w); ev_stop (EV_A_ (W)w); EV_FREQUENT_CHECK; } #endif #if EV_STAT_ENABLE # ifdef _WIN32 # undef lstat # define lstat(a,b) _stati64 (a,b) # endif #define DEF_STAT_INTERVAL 5.0074891 #define NFS_STAT_INTERVAL 30.1074891 /* for filesystems potentially failing inotify */ #define MIN_STAT_INTERVAL 0.1074891 ecb_noinline static void stat_timer_cb (EV_P_ ev_timer *w_, int revents); #if EV_USE_INOTIFY /* the * 2 is to allow for alignment padding, which for some reason is >> 8 */ # define EV_INOTIFY_BUFSIZE (sizeof (struct inotify_event) * 2 + NAME_MAX) ecb_noinline static void infy_add (EV_P_ ev_stat *w) { w->wd = inotify_add_watch (fs_fd, w->path, IN_ATTRIB | IN_DELETE_SELF | IN_MOVE_SELF | IN_MODIFY | IN_CREATE | IN_DELETE | IN_MOVED_FROM | IN_MOVED_TO | IN_DONT_FOLLOW | IN_MASK_ADD); if (w->wd >= 0) { struct statfs sfs; /* now local changes will be tracked by inotify, but remote changes won't */ /* unless the filesystem is known to be local, we therefore still poll */ /* also do poll on <2.6.25, but with normal frequency */ if (!fs_2625) w->timer.repeat = w->interval ? w->interval : DEF_STAT_INTERVAL; else if (!statfs (w->path, &sfs) && (sfs.f_type == 0x1373 /* devfs */ || sfs.f_type == 0x4006 /* fat */ || sfs.f_type == 0x4d44 /* msdos */ || sfs.f_type == 0xEF53 /* ext2/3 */ || sfs.f_type == 0x72b6 /* jffs2 */ || sfs.f_type == 0x858458f6 /* ramfs */ || sfs.f_type == 0x5346544e /* ntfs */ || sfs.f_type == 0x3153464a /* jfs */ || sfs.f_type == 0x9123683e /* btrfs */ || sfs.f_type == 0x52654973 /* reiser3 */ || sfs.f_type == 0x01021994 /* tmpfs */ || sfs.f_type == 0x58465342 /* xfs */)) w->timer.repeat = 0.; /* filesystem is local, kernel new enough */ else w->timer.repeat = w->interval ? w->interval : NFS_STAT_INTERVAL; /* remote, use reduced frequency */ } else { /* can't use inotify, continue to stat */ w->timer.repeat = w->interval ? w->interval : DEF_STAT_INTERVAL; /* if path is not there, monitor some parent directory for speedup hints */ /* note that exceeding the hardcoded path limit is not a correctness issue, */ /* but an efficiency issue only */ if ((errno == ENOENT || errno == EACCES) && strlen (w->path) < 4096) { char path [4096]; strcpy (path, w->path); do { int mask = IN_MASK_ADD | IN_DELETE_SELF | IN_MOVE_SELF | (errno == EACCES ? IN_ATTRIB : IN_CREATE | IN_MOVED_TO); char *pend = strrchr (path, '/'); if (!pend || pend == path) break; *pend = 0; w->wd = inotify_add_watch (fs_fd, path, mask); } while (w->wd < 0 && (errno == ENOENT || errno == EACCES)); } } if (w->wd >= 0) wlist_add (&fs_hash [w->wd & ((EV_INOTIFY_HASHSIZE) - 1)].head, (WL)w); /* now re-arm timer, if required */ if (ev_is_active (&w->timer)) ev_ref (EV_A); ev_timer_again (EV_A_ &w->timer); if (ev_is_active (&w->timer)) ev_unref (EV_A); } ecb_noinline static void infy_del (EV_P_ ev_stat *w) { int slot; int wd = w->wd; if (wd < 0) return; w->wd = -2; slot = wd & ((EV_INOTIFY_HASHSIZE) - 1); wlist_del (&fs_hash [slot].head, (WL)w); /* remove this watcher, if others are watching it, they will rearm */ inotify_rm_watch (fs_fd, wd); } ecb_noinline static void infy_wd (EV_P_ int slot, int wd, struct inotify_event *ev) { if (slot < 0) /* overflow, need to check for all hash slots */ for (slot = 0; slot < (EV_INOTIFY_HASHSIZE); ++slot) infy_wd (EV_A_ slot, wd, ev); else { WL w_; for (w_ = fs_hash [slot & ((EV_INOTIFY_HASHSIZE) - 1)].head; w_; ) { ev_stat *w = (ev_stat *)w_; w_ = w_->next; /* lets us remove this watcher and all before it */ if (w->wd == wd || wd == -1) { if (ev->mask & (IN_IGNORED | IN_UNMOUNT | IN_DELETE_SELF)) { wlist_del (&fs_hash [slot & ((EV_INOTIFY_HASHSIZE) - 1)].head, (WL)w); w->wd = -1; infy_add (EV_A_ w); /* re-add, no matter what */ } stat_timer_cb (EV_A_ &w->timer, 0); } } } } static void infy_cb (EV_P_ ev_io *w, int revents) { char buf [EV_INOTIFY_BUFSIZE]; int ofs; int len = read (fs_fd, buf, sizeof (buf)); if (len < 0) return; for (ofs = 0; ofs < len; ) { struct inotify_event *ev = (struct inotify_event *)(buf + ofs); infy_wd (EV_A_ ev->wd, ev->wd, ev); ofs += sizeof (struct inotify_event) + ev->len; } } inline_size ecb_cold void ev_check_2625 (EV_P) { /* kernels < 2.6.25 are borked * http://www.ussg.indiana.edu/hypermail/linux/kernel/0711.3/1208.html */ if (ev_linux_version () < 0x020619) return; fs_2625 = 1; } inline_size int infy_newfd (void) { #if defined IN_CLOEXEC && defined IN_NONBLOCK int fd = inotify_init1 (IN_CLOEXEC | IN_NONBLOCK); if (fd >= 0) return fd; #endif return inotify_init (); } inline_size void infy_init (EV_P) { if (fs_fd != -2) return; fs_fd = -1; ev_check_2625 (EV_A); fs_fd = infy_newfd (); if (fs_fd >= 0) { fd_intern (fs_fd); ev_io_init (&fs_w, infy_cb, fs_fd, EV_READ); ev_set_priority (&fs_w, EV_MAXPRI); ev_io_start (EV_A_ &fs_w); ev_unref (EV_A); } } inline_size void infy_fork (EV_P) { int slot; if (fs_fd < 0) return; ev_ref (EV_A); ev_io_stop (EV_A_ &fs_w); close (fs_fd); fs_fd = infy_newfd (); if (fs_fd >= 0) { fd_intern (fs_fd); ev_io_set (&fs_w, fs_fd, EV_READ); ev_io_start (EV_A_ &fs_w); ev_unref (EV_A); } for (slot = 0; slot < (EV_INOTIFY_HASHSIZE); ++slot) { WL w_ = fs_hash [slot].head; fs_hash [slot].head = 0; while (w_) { ev_stat *w = (ev_stat *)w_; w_ = w_->next; /* lets us add this watcher */ w->wd = -1; if (fs_fd >= 0) infy_add (EV_A_ w); /* re-add, no matter what */ else { w->timer.repeat = w->interval ? w->interval : DEF_STAT_INTERVAL; if (ev_is_active (&w->timer)) ev_ref (EV_A); ev_timer_again (EV_A_ &w->timer); if (ev_is_active (&w->timer)) ev_unref (EV_A); } } } } #endif #ifdef _WIN32 # define EV_LSTAT(p,b) _stati64 (p, b) #else # define EV_LSTAT(p,b) lstat (p, b) #endif void ev_stat_stat (EV_P_ ev_stat *w) EV_NOEXCEPT { if (lstat (w->path, &w->attr) < 0) w->attr.st_nlink = 0; else if (!w->attr.st_nlink) w->attr.st_nlink = 1; } ecb_noinline static void stat_timer_cb (EV_P_ ev_timer *w_, int revents) { ev_stat *w = (ev_stat *)(((char *)w_) - offsetof (ev_stat, timer)); ev_statdata prev = w->attr; ev_stat_stat (EV_A_ w); /* memcmp doesn't work on netbsd, they.... do stuff to their struct stat */ if ( prev.st_dev != w->attr.st_dev || prev.st_ino != w->attr.st_ino || prev.st_mode != w->attr.st_mode || prev.st_nlink != w->attr.st_nlink || prev.st_uid != w->attr.st_uid || prev.st_gid != w->attr.st_gid || prev.st_rdev != w->attr.st_rdev || prev.st_size != w->attr.st_size || prev.st_atime != w->attr.st_atime || prev.st_mtime != w->attr.st_mtime || prev.st_ctime != w->attr.st_ctime ) { /* we only update w->prev on actual differences */ /* in case we test more often than invoke the callback, */ /* to ensure that prev is always different to attr */ w->prev = prev; #if EV_USE_INOTIFY if (fs_fd >= 0) { infy_del (EV_A_ w); infy_add (EV_A_ w); ev_stat_stat (EV_A_ w); /* avoid race... */ } #endif ev_feed_event (EV_A_ w, EV_STAT); } } void ev_stat_start (EV_P_ ev_stat *w) EV_NOEXCEPT { if (ecb_expect_false (ev_is_active (w))) return; ev_stat_stat (EV_A_ w); if (w->interval < MIN_STAT_INTERVAL && w->interval) w->interval = MIN_STAT_INTERVAL; ev_timer_init (&w->timer, stat_timer_cb, 0., w->interval ? w->interval : DEF_STAT_INTERVAL); ev_set_priority (&w->timer, ev_priority (w)); #if EV_USE_INOTIFY infy_init (EV_A); if (fs_fd >= 0) infy_add (EV_A_ w); else #endif { ev_timer_again (EV_A_ &w->timer); ev_unref (EV_A); } ev_start (EV_A_ (W)w, 1); EV_FREQUENT_CHECK; } void ev_stat_stop (EV_P_ ev_stat *w) EV_NOEXCEPT { clear_pending (EV_A_ (W)w); if (ecb_expect_false (!ev_is_active (w))) return; EV_FREQUENT_CHECK; #if EV_USE_INOTIFY infy_del (EV_A_ w); #endif if (ev_is_active (&w->timer)) { ev_ref (EV_A); ev_timer_stop (EV_A_ &w->timer); } ev_stop (EV_A_ (W)w); EV_FREQUENT_CHECK; } #endif #if EV_IDLE_ENABLE void ev_idle_start (EV_P_ ev_idle *w) EV_NOEXCEPT { if (ecb_expect_false (ev_is_active (w))) return; pri_adjust (EV_A_ (W)w); EV_FREQUENT_CHECK; { int active = ++idlecnt [ABSPRI (w)]; ++idleall; ev_start (EV_A_ (W)w, active); array_needsize (ev_idle *, idles [ABSPRI (w)], idlemax [ABSPRI (w)], active, array_needsize_noinit); idles [ABSPRI (w)][active - 1] = w; } EV_FREQUENT_CHECK; } void ev_idle_stop (EV_P_ ev_idle *w) EV_NOEXCEPT { clear_pending (EV_A_ (W)w); if (ecb_expect_false (!ev_is_active (w))) return; EV_FREQUENT_CHECK; { int active = ev_active (w); idles [ABSPRI (w)][active - 1] = idles [ABSPRI (w)][--idlecnt [ABSPRI (w)]]; ev_active (idles [ABSPRI (w)][active - 1]) = active; ev_stop (EV_A_ (W)w); --idleall; } EV_FREQUENT_CHECK; } #endif #if EV_PREPARE_ENABLE void ev_prepare_start (EV_P_ ev_prepare *w) EV_NOEXCEPT { if (ecb_expect_false (ev_is_active (w))) return; EV_FREQUENT_CHECK; ev_start (EV_A_ (W)w, ++preparecnt); array_needsize (ev_prepare *, prepares, preparemax, preparecnt, array_needsize_noinit); prepares [preparecnt - 1] = w; EV_FREQUENT_CHECK; } void ev_prepare_stop (EV_P_ ev_prepare *w) EV_NOEXCEPT { clear_pending (EV_A_ (W)w); if (ecb_expect_false (!ev_is_active (w))) return; EV_FREQUENT_CHECK; { int active = ev_active (w); prepares [active - 1] = prepares [--preparecnt]; ev_active (prepares [active - 1]) = active; } ev_stop (EV_A_ (W)w); EV_FREQUENT_CHECK; } #endif #if EV_CHECK_ENABLE void ev_check_start (EV_P_ ev_check *w) EV_NOEXCEPT { if (ecb_expect_false (ev_is_active (w))) return; EV_FREQUENT_CHECK; ev_start (EV_A_ (W)w, ++checkcnt); array_needsize (ev_check *, checks, checkmax, checkcnt, array_needsize_noinit); checks [checkcnt - 1] = w; EV_FREQUENT_CHECK; } void ev_check_stop (EV_P_ ev_check *w) EV_NOEXCEPT { clear_pending (EV_A_ (W)w); if (ecb_expect_false (!ev_is_active (w))) return; EV_FREQUENT_CHECK; { int active = ev_active (w); checks [active - 1] = checks [--checkcnt]; ev_active (checks [active - 1]) = active; } ev_stop (EV_A_ (W)w); EV_FREQUENT_CHECK; } #endif #if EV_EMBED_ENABLE ecb_noinline void ev_embed_sweep (EV_P_ ev_embed *w) EV_NOEXCEPT { ev_run (w->other, EVRUN_NOWAIT); } static void embed_io_cb (EV_P_ ev_io *io, int revents) { ev_embed *w = (ev_embed *)(((char *)io) - offsetof (ev_embed, io)); if (ev_cb (w)) ev_feed_event (EV_A_ (W)w, EV_EMBED); else ev_run (w->other, EVRUN_NOWAIT); } static void embed_prepare_cb (EV_P_ ev_prepare *prepare, int revents) { ev_embed *w = (ev_embed *)(((char *)prepare) - offsetof (ev_embed, prepare)); { EV_P = w->other; while (fdchangecnt) { fd_reify (EV_A); ev_run (EV_A_ EVRUN_NOWAIT); } } } #if EV_FORK_ENABLE static void embed_fork_cb (EV_P_ ev_fork *fork_w, int revents) { ev_embed *w = (ev_embed *)(((char *)fork_w) - offsetof (ev_embed, fork)); ev_embed_stop (EV_A_ w); { EV_P = w->other; ev_loop_fork (EV_A); ev_run (EV_A_ EVRUN_NOWAIT); } ev_embed_start (EV_A_ w); } #endif #if 0 static void embed_idle_cb (EV_P_ ev_idle *idle, int revents) { ev_idle_stop (EV_A_ idle); } #endif void ev_embed_start (EV_P_ ev_embed *w) EV_NOEXCEPT { if (ecb_expect_false (ev_is_active (w))) return; { EV_P = w->other; assert (("libev: loop to be embedded is not embeddable", backend & ev_embeddable_backends ())); ev_io_init (&w->io, embed_io_cb, backend_fd, EV_READ); } EV_FREQUENT_CHECK; ev_set_priority (&w->io, ev_priority (w)); ev_io_start (EV_A_ &w->io); ev_prepare_init (&w->prepare, embed_prepare_cb); ev_set_priority (&w->prepare, EV_MINPRI); ev_prepare_start (EV_A_ &w->prepare); #if EV_FORK_ENABLE ev_fork_init (&w->fork, embed_fork_cb); ev_fork_start (EV_A_ &w->fork); #endif /*ev_idle_init (&w->idle, e,bed_idle_cb);*/ ev_start (EV_A_ (W)w, 1); EV_FREQUENT_CHECK; } void ev_embed_stop (EV_P_ ev_embed *w) EV_NOEXCEPT { clear_pending (EV_A_ (W)w); if (ecb_expect_false (!ev_is_active (w))) return; EV_FREQUENT_CHECK; ev_io_stop (EV_A_ &w->io); ev_prepare_stop (EV_A_ &w->prepare); #if EV_FORK_ENABLE ev_fork_stop (EV_A_ &w->fork); #endif ev_stop (EV_A_ (W)w); EV_FREQUENT_CHECK; } #endif #if EV_FORK_ENABLE void ev_fork_start (EV_P_ ev_fork *w) EV_NOEXCEPT { if (ecb_expect_false (ev_is_active (w))) return; EV_FREQUENT_CHECK; ev_start (EV_A_ (W)w, ++forkcnt); array_needsize (ev_fork *, forks, forkmax, forkcnt, array_needsize_noinit); forks [forkcnt - 1] = w; EV_FREQUENT_CHECK; } void ev_fork_stop (EV_P_ ev_fork *w) EV_NOEXCEPT { clear_pending (EV_A_ (W)w); if (ecb_expect_false (!ev_is_active (w))) return; EV_FREQUENT_CHECK; { int active = ev_active (w); forks [active - 1] = forks [--forkcnt]; ev_active (forks [active - 1]) = active; } ev_stop (EV_A_ (W)w); EV_FREQUENT_CHECK; } #endif #if EV_CLEANUP_ENABLE void ev_cleanup_start (EV_P_ ev_cleanup *w) EV_NOEXCEPT { if (ecb_expect_false (ev_is_active (w))) return; EV_FREQUENT_CHECK; ev_start (EV_A_ (W)w, ++cleanupcnt); array_needsize (ev_cleanup *, cleanups, cleanupmax, cleanupcnt, array_needsize_noinit); cleanups [cleanupcnt - 1] = w; /* cleanup watchers should never keep a refcount on the loop */ ev_unref (EV_A); EV_FREQUENT_CHECK; } void ev_cleanup_stop (EV_P_ ev_cleanup *w) EV_NOEXCEPT { clear_pending (EV_A_ (W)w); if (ecb_expect_false (!ev_is_active (w))) return; EV_FREQUENT_CHECK; ev_ref (EV_A); { int active = ev_active (w); cleanups [active - 1] = cleanups [--cleanupcnt]; ev_active (cleanups [active - 1]) = active; } ev_stop (EV_A_ (W)w); EV_FREQUENT_CHECK; } #endif #if EV_ASYNC_ENABLE void ev_async_start (EV_P_ ev_async *w) EV_NOEXCEPT { if (ecb_expect_false (ev_is_active (w))) return; w->sent = 0; evpipe_init (EV_A); EV_FREQUENT_CHECK; ev_start (EV_A_ (W)w, ++asynccnt); array_needsize (ev_async *, asyncs, asyncmax, asynccnt, array_needsize_noinit); asyncs [asynccnt - 1] = w; EV_FREQUENT_CHECK; } void ev_async_stop (EV_P_ ev_async *w) EV_NOEXCEPT { clear_pending (EV_A_ (W)w); if (ecb_expect_false (!ev_is_active (w))) return; EV_FREQUENT_CHECK; { int active = ev_active (w); asyncs [active - 1] = asyncs [--asynccnt]; ev_active (asyncs [active - 1]) = active; } ev_stop (EV_A_ (W)w); EV_FREQUENT_CHECK; } void ev_async_send (EV_P_ ev_async *w) EV_NOEXCEPT { w->sent = 1; evpipe_write (EV_A_ &async_pending); } #endif /*****************************************************************************/ struct ev_once { ev_io io; ev_timer to; void (*cb)(int revents, void *arg); void *arg; }; static void once_cb (EV_P_ struct ev_once *once, int revents) { void (*cb)(int revents, void *arg) = once->cb; void *arg = once->arg; ev_io_stop (EV_A_ &once->io); ev_timer_stop (EV_A_ &once->to); ev_free (once); cb (revents, arg); } static void once_cb_io (EV_P_ ev_io *w, int revents) { struct ev_once *once = (struct ev_once *)(((char *)w) - offsetof (struct ev_once, io)); once_cb (EV_A_ once, revents | ev_clear_pending (EV_A_ &once->to)); } static void once_cb_to (EV_P_ ev_timer *w, int revents) { struct ev_once *once = (struct ev_once *)(((char *)w) - offsetof (struct ev_once, to)); once_cb (EV_A_ once, revents | ev_clear_pending (EV_A_ &once->io)); } void ev_once (EV_P_ int fd, int events, ev_tstamp timeout, void (*cb)(int revents, void *arg), void *arg) EV_NOEXCEPT { struct ev_once *once = (struct ev_once *)ev_malloc (sizeof (struct ev_once)); once->cb = cb; once->arg = arg; ev_init (&once->io, once_cb_io); if (fd >= 0) { ev_io_set (&once->io, fd, events); ev_io_start (EV_A_ &once->io); } ev_init (&once->to, once_cb_to); if (timeout >= 0.) { ev_timer_set (&once->to, timeout, 0.); ev_timer_start (EV_A_ &once->to); } } /*****************************************************************************/ #if EV_WALK_ENABLE ecb_cold void ev_walk (EV_P_ int types, void (*cb)(EV_P_ int type, void *w)) EV_NOEXCEPT { int i, j; ev_watcher_list *wl, *wn; if (types & (EV_IO | EV_EMBED)) for (i = 0; i < anfdmax; ++i) for (wl = anfds [i].head; wl; ) { wn = wl->next; #if EV_EMBED_ENABLE if (ev_cb ((ev_io *)wl) == embed_io_cb) { if (types & EV_EMBED) cb (EV_A_ EV_EMBED, ((char *)wl) - offsetof (struct ev_embed, io)); } else #endif #if EV_USE_INOTIFY if (ev_cb ((ev_io *)wl) == infy_cb) ; else #endif if ((ev_io *)wl != &pipe_w) if (types & EV_IO) cb (EV_A_ EV_IO, wl); wl = wn; } if (types & (EV_TIMER | EV_STAT)) for (i = timercnt + HEAP0; i-- > HEAP0; ) #if EV_STAT_ENABLE /*TODO: timer is not always active*/ if (ev_cb ((ev_timer *)ANHE_w (timers [i])) == stat_timer_cb) { if (types & EV_STAT) cb (EV_A_ EV_STAT, ((char *)ANHE_w (timers [i])) - offsetof (struct ev_stat, timer)); } else #endif if (types & EV_TIMER) cb (EV_A_ EV_TIMER, ANHE_w (timers [i])); #if EV_PERIODIC_ENABLE if (types & EV_PERIODIC) for (i = periodiccnt + HEAP0; i-- > HEAP0; ) cb (EV_A_ EV_PERIODIC, ANHE_w (periodics [i])); #endif #if EV_IDLE_ENABLE if (types & EV_IDLE) for (j = NUMPRI; j--; ) for (i = idlecnt [j]; i--; ) cb (EV_A_ EV_IDLE, idles [j][i]); #endif #if EV_FORK_ENABLE if (types & EV_FORK) for (i = forkcnt; i--; ) if (ev_cb (forks [i]) != embed_fork_cb) cb (EV_A_ EV_FORK, forks [i]); #endif #if EV_ASYNC_ENABLE if (types & EV_ASYNC) for (i = asynccnt; i--; ) cb (EV_A_ EV_ASYNC, asyncs [i]); #endif #if EV_PREPARE_ENABLE if (types & EV_PREPARE) for (i = preparecnt; i--; ) # if EV_EMBED_ENABLE if (ev_cb (prepares [i]) != embed_prepare_cb) # endif cb (EV_A_ EV_PREPARE, prepares [i]); #endif #if EV_CHECK_ENABLE if (types & EV_CHECK) for (i = checkcnt; i--; ) cb (EV_A_ EV_CHECK, checks [i]); #endif #if EV_SIGNAL_ENABLE if (types & EV_SIGNAL) for (i = 0; i < EV_NSIG - 1; ++i) for (wl = signals [i].head; wl; ) { wn = wl->next; cb (EV_A_ EV_SIGNAL, wl); wl = wn; } #endif #if EV_CHILD_ENABLE if (types & EV_CHILD) for (i = (EV_PID_HASHSIZE); i--; ) for (wl = childs [i]; wl; ) { wn = wl->next; cb (EV_A_ EV_CHILD, wl); wl = wn; } #endif /* EV_STAT 0x00001000 * stat data changed */ /* EV_EMBED 0x00010000 * embedded event loop needs sweep */ } #endif #if EV_MULTIPLICITY #include "ev_wrap.h" #endif audit-4.0.2/src/libev/ev.h0000644001034500103450000007307614655201403010774 /* * libev native API header * * Copyright (c) 2007-2020 Marc Alexander Lehmann * All rights reserved. * * Redistribution and use in source and binary forms, with or without modifica- * tion, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MER- * CHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPE- * CIAL, 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 OTH- * ERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, the contents of this file may be used under the terms of * the GNU General Public License ("GPL") version 2 or any later version, * in which case the provisions of the GPL are applicable instead of * the above. If you wish to allow the use of your version of this file * only under the terms of the GPL and not to allow others to use your * version of this file under the BSD license, indicate your decision * by deleting the provisions above and replace them with the notice * and other provisions required by the GPL. If you do not delete the * provisions above, a recipient may use your version of this file under * either the BSD or the GPL. */ #ifndef EV_H_ #define EV_H_ #ifdef __cplusplus # define EV_CPP(x) x # if __cplusplus >= 201103L # define EV_NOEXCEPT noexcept # else # define EV_NOEXCEPT # endif #else # define EV_CPP(x) # define EV_NOEXCEPT #endif #define EV_THROW EV_NOEXCEPT /* pre-4.25, do not use in new code */ EV_CPP(extern "C" {) /*****************************************************************************/ /* pre-4.0 compatibility */ #ifndef EV_COMPAT3 # define EV_COMPAT3 1 #endif #ifndef EV_FEATURES # if defined __OPTIMIZE_SIZE__ # define EV_FEATURES 0x7c # else # define EV_FEATURES 0x7f # endif #endif #define EV_FEATURE_CODE ((EV_FEATURES) & 1) #define EV_FEATURE_DATA ((EV_FEATURES) & 2) #define EV_FEATURE_CONFIG ((EV_FEATURES) & 4) #define EV_FEATURE_API ((EV_FEATURES) & 8) #define EV_FEATURE_WATCHERS ((EV_FEATURES) & 16) #define EV_FEATURE_BACKENDS ((EV_FEATURES) & 32) #define EV_FEATURE_OS ((EV_FEATURES) & 64) /* these priorities are inclusive, higher priorities will be invoked earlier */ #ifndef EV_MINPRI # define EV_MINPRI (EV_FEATURE_CONFIG ? -2 : 0) #endif #ifndef EV_MAXPRI # define EV_MAXPRI (EV_FEATURE_CONFIG ? +2 : 0) #endif #ifndef EV_MULTIPLICITY # define EV_MULTIPLICITY EV_FEATURE_CONFIG #endif #ifndef EV_PERIODIC_ENABLE # define EV_PERIODIC_ENABLE EV_FEATURE_WATCHERS #endif #ifndef EV_STAT_ENABLE # define EV_STAT_ENABLE EV_FEATURE_WATCHERS #endif #ifndef EV_PREPARE_ENABLE # define EV_PREPARE_ENABLE EV_FEATURE_WATCHERS #endif #ifndef EV_CHECK_ENABLE # define EV_CHECK_ENABLE EV_FEATURE_WATCHERS #endif #ifndef EV_IDLE_ENABLE # define EV_IDLE_ENABLE EV_FEATURE_WATCHERS #endif #ifndef EV_FORK_ENABLE # define EV_FORK_ENABLE EV_FEATURE_WATCHERS #endif #ifndef EV_CLEANUP_ENABLE # define EV_CLEANUP_ENABLE EV_FEATURE_WATCHERS #endif #ifndef EV_SIGNAL_ENABLE # define EV_SIGNAL_ENABLE EV_FEATURE_WATCHERS #endif #ifndef EV_CHILD_ENABLE # ifdef _WIN32 # define EV_CHILD_ENABLE 0 # else # define EV_CHILD_ENABLE 0 #endif #endif #ifndef EV_ASYNC_ENABLE # define EV_ASYNC_ENABLE EV_FEATURE_WATCHERS #endif #ifndef EV_EMBED_ENABLE # define EV_EMBED_ENABLE EV_FEATURE_WATCHERS #endif #ifndef EV_WALK_ENABLE # define EV_WALK_ENABLE 0 /* not yet */ #endif /*****************************************************************************/ #if EV_CHILD_ENABLE && !EV_SIGNAL_ENABLE # undef EV_SIGNAL_ENABLE # define EV_SIGNAL_ENABLE 1 #endif /*****************************************************************************/ #ifndef EV_TSTAMP_T # define EV_TSTAMP_T double #endif typedef EV_TSTAMP_T ev_tstamp; #include /* for memmove */ #ifndef EV_ATOMIC_T # include # define EV_ATOMIC_T sig_atomic_t volatile #endif #if EV_STAT_ENABLE # ifdef _WIN32 # include # include # endif # include #endif /* support multiple event loops? */ #if EV_MULTIPLICITY struct ev_loop; # define EV_P struct ev_loop *loop /* a loop as sole parameter in a declaration */ # define EV_P_ EV_P, /* a loop as first of multiple parameters */ # define EV_A loop /* a loop as sole argument to a function call */ # define EV_A_ EV_A, /* a loop as first of multiple arguments */ # define EV_DEFAULT_UC ev_default_loop_uc_ () /* the default loop, if initialised, as sole arg */ # define EV_DEFAULT_UC_ EV_DEFAULT_UC, /* the default loop as first of multiple arguments */ # define EV_DEFAULT ev_default_loop (0) /* the default loop as sole arg */ # define EV_DEFAULT_ EV_DEFAULT, /* the default loop as first of multiple arguments */ #else # define EV_P void # define EV_P_ # define EV_A # define EV_A_ # define EV_DEFAULT # define EV_DEFAULT_ # define EV_DEFAULT_UC # define EV_DEFAULT_UC_ # undef EV_EMBED_ENABLE #endif /* EV_INLINE is used for functions in header files */ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L || __GNUC__ >= 3 # define EV_INLINE static inline #else # define EV_INLINE static #endif #ifdef EV_API_STATIC # define EV_API_DECL static #else # define EV_API_DECL extern #endif /* EV_PROTOTYPES can be used to switch of prototype declarations */ #ifndef EV_PROTOTYPES # define EV_PROTOTYPES 1 #endif /*****************************************************************************/ #define EV_VERSION_MAJOR 4 #define EV_VERSION_MINOR 33 /* eventmask, revents, events... */ enum { EV_UNDEF = (int)0xFFFFFFFF, /* guaranteed to be invalid */ EV_NONE = 0x00, /* no events */ EV_READ = 0x01, /* ev_io detected read will not block */ EV_WRITE = 0x02, /* ev_io detected write will not block */ EV__IOFDSET = 0x80, /* internal use only */ EV_IO = EV_READ, /* alias for type-detection */ EV_TIMER = 0x00000100, /* timer timed out */ #if EV_COMPAT3 EV_TIMEOUT = EV_TIMER, /* pre 4.0 API compatibility */ #endif EV_PERIODIC = 0x00000200, /* periodic timer timed out */ EV_SIGNAL = 0x00000400, /* signal was received */ EV_CHILD = 0x00000800, /* child/pid had status change */ EV_STAT = 0x00001000, /* stat data changed */ EV_IDLE = 0x00002000, /* event loop is idling */ EV_PREPARE = 0x00004000, /* event loop about to poll */ EV_CHECK = 0x00008000, /* event loop finished poll */ EV_EMBED = 0x00010000, /* embedded event loop needs sweep */ EV_FORK = 0x00020000, /* event loop resumed in child */ EV_CLEANUP = 0x00040000, /* event loop resumed in child */ EV_ASYNC = 0x00080000, /* async intra-loop signal */ EV_CUSTOM = 0x01000000, /* for use by user code */ EV_ERROR = (int)0x80000000 /* sent when an error occurs */ }; /* can be used to add custom fields to all watchers, while losing binary compatibility */ #ifndef EV_COMMON # define EV_COMMON void *data; #endif #ifndef EV_CB_DECLARE # define EV_CB_DECLARE(type) void (*cb)(EV_P_ struct type *w, int revents); #endif #ifndef EV_CB_INVOKE # define EV_CB_INVOKE(watcher,revents) (watcher)->cb (EV_A_ (watcher), (revents)) #endif /* not official, do not use */ #define EV_CB(type,name) void name (EV_P_ struct ev_ ## type *w, int revents) /* * struct member types: * private: you may look at them, but not change them, * and they might not mean anything to you. * ro: can be read anytime, but only changed when the watcher isn't active. * rw: can be read and modified anytime, even when the watcher is active. * * some internal details that might be helpful for debugging: * * active is either 0, which means the watcher is not active, * or the array index of the watcher (periodics, timers) * or the array index + 1 (most other watchers) * or simply 1 for watchers that aren't in some array. * pending is either 0, in which case the watcher isn't, * or the array index + 1 in the pendings array. */ #if EV_MINPRI == EV_MAXPRI # define EV_DECL_PRIORITY #elif !defined (EV_DECL_PRIORITY) # define EV_DECL_PRIORITY int priority; #endif /* shared by all watchers */ #define EV_WATCHER(type) \ int active; /* private */ \ int pending; /* private */ \ EV_DECL_PRIORITY /* private */ \ EV_COMMON /* rw */ \ EV_CB_DECLARE (type) /* private */ #define EV_WATCHER_LIST(type) \ EV_WATCHER (type) \ struct ev_watcher_list *next; /* private */ #define EV_WATCHER_TIME(type) \ EV_WATCHER (type) \ ev_tstamp at; /* private */ /* base class, nothing to see here unless you subclass */ typedef struct ev_watcher { EV_WATCHER (ev_watcher) } ev_watcher; /* base class, nothing to see here unless you subclass */ typedef struct ev_watcher_list { EV_WATCHER_LIST (ev_watcher_list) } ev_watcher_list; /* base class, nothing to see here unless you subclass */ typedef struct ev_watcher_time { EV_WATCHER_TIME (ev_watcher_time) } ev_watcher_time; /* invoked when fd is either EV_READable or EV_WRITEable */ /* revent EV_READ, EV_WRITE */ typedef struct ev_io { EV_WATCHER_LIST (ev_io) int fd; /* ro */ int events; /* ro */ } ev_io; /* invoked after a specific time, repeatable (based on monotonic clock) */ /* revent EV_TIMEOUT */ typedef struct ev_timer { EV_WATCHER_TIME (ev_timer) ev_tstamp repeat; /* rw */ } ev_timer; /* invoked at some specific time, possibly repeating at regular intervals (based on UTC) */ /* revent EV_PERIODIC */ typedef struct ev_periodic { EV_WATCHER_TIME (ev_periodic) ev_tstamp offset; /* rw */ ev_tstamp interval; /* rw */ ev_tstamp (*reschedule_cb)(struct ev_periodic *w, ev_tstamp now) EV_NOEXCEPT; /* rw */ } ev_periodic; /* invoked when the given signal has been received */ /* revent EV_SIGNAL */ typedef struct ev_signal { EV_WATCHER_LIST (ev_signal) int signum; /* ro */ } ev_signal; /* invoked when sigchld is received and waitpid indicates the given pid */ /* revent EV_CHILD */ /* does not support priorities */ typedef struct ev_child { EV_WATCHER_LIST (ev_child) int flags; /* private */ int pid; /* ro */ int rpid; /* rw, holds the received pid */ int rstatus; /* rw, holds the exit status, use the macros from sys/wait.h */ } ev_child; #if EV_STAT_ENABLE /* st_nlink = 0 means missing file or other error */ # ifdef _WIN32 typedef struct _stati64 ev_statdata; # else typedef struct stat ev_statdata; # endif /* invoked each time the stat data changes for a given path */ /* revent EV_STAT */ typedef struct ev_stat { EV_WATCHER_LIST (ev_stat) ev_timer timer; /* private */ ev_tstamp interval; /* ro */ const char *path; /* ro */ ev_statdata prev; /* ro */ ev_statdata attr; /* ro */ int wd; /* wd for inotify, fd for kqueue */ } ev_stat; #endif /* invoked when the nothing else needs to be done, keeps the process from blocking */ /* revent EV_IDLE */ typedef struct ev_idle { EV_WATCHER (ev_idle) } ev_idle; /* invoked for each run of the mainloop, just before the blocking call */ /* you can still change events in any way you like */ /* revent EV_PREPARE */ typedef struct ev_prepare { EV_WATCHER (ev_prepare) } ev_prepare; /* invoked for each run of the mainloop, just after the blocking call */ /* revent EV_CHECK */ typedef struct ev_check { EV_WATCHER (ev_check) } ev_check; /* the callback gets invoked before check in the child process when a fork was detected */ /* revent EV_FORK */ typedef struct ev_fork { EV_WATCHER (ev_fork) } ev_fork; /* is invoked just before the loop gets destroyed */ /* revent EV_CLEANUP */ typedef struct ev_cleanup { EV_WATCHER (ev_cleanup) } ev_cleanup; #if EV_EMBED_ENABLE /* used to embed an event loop inside another */ /* the callback gets invoked when the event loop has handled events, and can be 0 */ typedef struct ev_embed { EV_WATCHER (ev_embed) struct ev_loop *other; /* ro */ #undef EV_IO_ENABLE #define EV_IO_ENABLE 1 ev_io io; /* private */ #undef EV_PREPARE_ENABLE #define EV_PREPARE_ENABLE 1 ev_prepare prepare; /* private */ ev_check check; /* unused */ ev_timer timer; /* unused */ ev_periodic periodic; /* unused */ ev_idle idle; /* unused */ ev_fork fork; /* private */ ev_cleanup cleanup; /* unused */ } ev_embed; #endif #if EV_ASYNC_ENABLE /* invoked when somebody calls ev_async_send on the watcher */ /* revent EV_ASYNC */ typedef struct ev_async { EV_WATCHER (ev_async) EV_ATOMIC_T sent; /* private */ } ev_async; # define ev_async_pending(w) (+(w)->sent) #endif /* the presence of this union forces similar struct layout */ union ev_any_watcher { struct ev_watcher w; struct ev_watcher_list wl; struct ev_io io; struct ev_timer timer; struct ev_periodic periodic; struct ev_signal signal; struct ev_child child; #if EV_STAT_ENABLE struct ev_stat stat; #endif #if EV_IDLE_ENABLE struct ev_idle idle; #endif struct ev_prepare prepare; struct ev_check check; #if EV_FORK_ENABLE struct ev_fork fork; #endif #if EV_CLEANUP_ENABLE struct ev_cleanup cleanup; #endif #if EV_EMBED_ENABLE struct ev_embed embed; #endif #if EV_ASYNC_ENABLE struct ev_async async; #endif }; /* flag bits for ev_default_loop and ev_loop_new */ enum { /* the default */ EVFLAG_AUTO = 0x00000000U, /* not quite a mask */ /* flag bits */ EVFLAG_NOENV = 0x01000000U, /* do NOT consult environment */ EVFLAG_FORKCHECK = 0x02000000U, /* check for a fork in each iteration */ /* debugging/feature disable */ EVFLAG_NOINOTIFY = 0x00100000U, /* do not attempt to use inotify */ #if EV_COMPAT3 EVFLAG_NOSIGFD = 0, /* compatibility to pre-3.9 */ #endif EVFLAG_SIGNALFD = 0x00200000U, /* attempt to use signalfd */ EVFLAG_NOSIGMASK = 0x00400000U, /* avoid modifying the signal mask */ EVFLAG_NOTIMERFD = 0x00800000U /* avoid creating a timerfd */ }; /* method bits to be ored together */ enum { EVBACKEND_SELECT = 0x00000001U, /* available just about anywhere */ EVBACKEND_POLL = 0x00000002U, /* !win, !aix, broken on osx */ EVBACKEND_EPOLL = 0x00000004U, /* linux */ EVBACKEND_KQUEUE = 0x00000008U, /* bsd, broken on osx */ EVBACKEND_DEVPOLL = 0x00000010U, /* solaris 8 */ /* NYI */ EVBACKEND_PORT = 0x00000020U, /* solaris 10 */ EVBACKEND_LINUXAIO = 0x00000040U, /* linux AIO, 4.19+ */ EVBACKEND_IOURING = 0x00000080U, /* linux io_uring, 5.1+ */ EVBACKEND_ALL = 0x000000FFU, /* all known backends */ EVBACKEND_MASK = 0x0000FFFFU /* all future backends */ }; #if EV_PROTOTYPES EV_API_DECL int ev_version_major (void) EV_NOEXCEPT; EV_API_DECL int ev_version_minor (void) EV_NOEXCEPT; EV_API_DECL unsigned int ev_supported_backends (void) EV_NOEXCEPT; EV_API_DECL unsigned int ev_recommended_backends (void) EV_NOEXCEPT; EV_API_DECL unsigned int ev_embeddable_backends (void) EV_NOEXCEPT; EV_API_DECL ev_tstamp ev_time (void) EV_NOEXCEPT; EV_API_DECL void ev_sleep (ev_tstamp delay) EV_NOEXCEPT; /* sleep for a while */ /* Sets the allocation function to use, works like realloc. * It is used to allocate and free memory. * If it returns zero when memory needs to be allocated, the library might abort * or take some potentially destructive action. * The default is your system realloc function. */ EV_API_DECL void ev_set_allocator (void *(*cb)(void *ptr, long size) EV_NOEXCEPT) EV_NOEXCEPT; /* set the callback function to call on a * retryable syscall error * (such as failed select, poll, epoll_wait) */ EV_API_DECL void ev_set_syserr_cb (void (*cb)(const char *msg) EV_NOEXCEPT) EV_NOEXCEPT; #if EV_MULTIPLICITY /* the default loop is the only one that handles signals and child watchers */ /* you can call this as often as you like */ EV_API_DECL struct ev_loop *ev_default_loop (unsigned int flags EV_CPP (= 0)) EV_NOEXCEPT; #ifdef EV_API_STATIC EV_API_DECL struct ev_loop *ev_default_loop_ptr; #endif EV_INLINE struct ev_loop * ev_default_loop_uc_ (void) EV_NOEXCEPT { extern struct ev_loop *ev_default_loop_ptr; return ev_default_loop_ptr; } EV_INLINE int ev_is_default_loop (EV_P) EV_NOEXCEPT { return EV_A == EV_DEFAULT_UC; } /* create and destroy alternative loops that don't handle signals */ EV_API_DECL struct ev_loop *ev_loop_new (unsigned int flags EV_CPP (= 0)) EV_NOEXCEPT; EV_API_DECL ev_tstamp ev_now (EV_P) EV_NOEXCEPT; /* time w.r.t. timers and the eventloop, updated after each poll */ #else EV_API_DECL int ev_default_loop (unsigned int flags EV_CPP (= 0)) EV_NOEXCEPT; /* returns true when successful */ EV_API_DECL ev_tstamp ev_rt_now; EV_INLINE ev_tstamp ev_now (void) EV_NOEXCEPT { return ev_rt_now; } /* looks weird, but ev_is_default_loop (EV_A) still works if this exists */ EV_INLINE int ev_is_default_loop (void) EV_NOEXCEPT { return 1; } #endif /* multiplicity */ /* destroy event loops, also works for the default loop */ EV_API_DECL void ev_loop_destroy (EV_P); /* this needs to be called after fork, to duplicate the loop */ /* when you want to re-use it in the child */ /* you can call it in either the parent or the child */ /* you can actually call it at any time, anywhere :) */ EV_API_DECL void ev_loop_fork (EV_P) EV_NOEXCEPT; EV_API_DECL unsigned int ev_backend (EV_P) EV_NOEXCEPT; /* backend in use by loop */ EV_API_DECL void ev_now_update (EV_P) EV_NOEXCEPT; /* update event loop time */ #if EV_WALK_ENABLE /* walk (almost) all watchers in the loop of a given type, invoking the */ /* callback on every such watcher. The callback might stop the watcher, */ /* but do nothing else with the loop */ EV_API_DECL void ev_walk (EV_P_ int types, void (*cb)(EV_P_ int type, void *w)) EV_NOEXCEPT; #endif #endif /* prototypes */ /* ev_run flags values */ enum { EVRUN_NOWAIT = 1, /* do not block/wait */ EVRUN_ONCE = 2 /* block *once* only */ }; /* ev_break how values */ enum { EVBREAK_CANCEL = 0, /* undo unloop */ EVBREAK_ONE = 1, /* unloop once */ EVBREAK_ALL = 2 /* unloop all loops */ }; #if EV_PROTOTYPES EV_API_DECL int ev_run (EV_P_ int flags EV_CPP (= 0)); EV_API_DECL void ev_break (EV_P_ int how EV_CPP (= EVBREAK_ONE)) EV_NOEXCEPT; /* break out of the loop */ /* * ref/unref can be used to add or remove a refcount on the mainloop. every watcher * keeps one reference. if you have a long-running watcher you never unregister that * should not keep ev_loop from running, unref() after starting, and ref() before stopping. */ EV_API_DECL void ev_ref (EV_P) EV_NOEXCEPT; EV_API_DECL void ev_unref (EV_P) EV_NOEXCEPT; /* * convenience function, wait for a single event, without registering an event watcher * if timeout is < 0, do wait indefinitely */ EV_API_DECL void ev_once (EV_P_ int fd, int events, ev_tstamp timeout, void (*cb)(int revents, void *arg), void *arg) EV_NOEXCEPT; EV_API_DECL void ev_invoke_pending (EV_P); /* invoke all pending watchers */ # if EV_FEATURE_API EV_API_DECL unsigned int ev_iteration (EV_P) EV_NOEXCEPT; /* number of loop iterations */ EV_API_DECL unsigned int ev_depth (EV_P) EV_NOEXCEPT; /* #ev_loop enters - #ev_loop leaves */ EV_API_DECL void ev_verify (EV_P) EV_NOEXCEPT; /* abort if loop data corrupted */ EV_API_DECL void ev_set_io_collect_interval (EV_P_ ev_tstamp interval) EV_NOEXCEPT; /* sleep at least this time, default 0 */ EV_API_DECL void ev_set_timeout_collect_interval (EV_P_ ev_tstamp interval) EV_NOEXCEPT; /* sleep at least this time, default 0 */ /* advanced stuff for threading etc. support, see docs */ EV_API_DECL void ev_set_userdata (EV_P_ void *data) EV_NOEXCEPT; EV_API_DECL void *ev_userdata (EV_P) EV_NOEXCEPT; typedef void (*ev_loop_callback)(EV_P); EV_API_DECL void ev_set_invoke_pending_cb (EV_P_ ev_loop_callback invoke_pending_cb) EV_NOEXCEPT; /* C++ doesn't allow the use of the ev_loop_callback typedef here, so we need to spell it out */ EV_API_DECL void ev_set_loop_release_cb (EV_P_ void (*release)(EV_P) EV_NOEXCEPT, void (*acquire)(EV_P) EV_NOEXCEPT) EV_NOEXCEPT; EV_API_DECL unsigned int ev_pending_count (EV_P) EV_NOEXCEPT; /* number of pending events, if any */ /* * stop/start the timer handling. */ EV_API_DECL void ev_suspend (EV_P) EV_NOEXCEPT; EV_API_DECL void ev_resume (EV_P) EV_NOEXCEPT; #endif #endif /* these may evaluate ev multiple times, and the other arguments at most once */ /* either use ev_init + ev_TYPE_set, or the ev_TYPE_init macro, below, to first initialise a watcher */ #define ev_init(ev,cb_) do { \ ((ev_watcher *)(void *)(ev))->active = \ ((ev_watcher *)(void *)(ev))->pending = 0; \ ev_set_priority ((ev), 0); \ ev_set_cb ((ev), cb_); \ } while (0) #define ev_io_modify(ev,events_) do { (ev)->events = (ev)->events & EV__IOFDSET | (events_); } while (0) #define ev_io_set(ev,fd_,events_) do { (ev)->fd = (fd_); (ev)->events = (events_) | EV__IOFDSET; } while (0) #define ev_timer_set(ev,after_,repeat_) do { ((ev_watcher_time *)(ev))->at = (after_); (ev)->repeat = (repeat_); } while (0) #define ev_periodic_set(ev,ofs_,ival_,rcb_) do { (ev)->offset = (ofs_); (ev)->interval = (ival_); (ev)->reschedule_cb = (rcb_); } while (0) #define ev_signal_set(ev,signum_) do { (ev)->signum = (signum_); } while (0) #define ev_child_set(ev,pid_,trace_) do { (ev)->pid = (pid_); (ev)->flags = !!(trace_); } while (0) #define ev_stat_set(ev,path_,interval_) do { (ev)->path = (path_); (ev)->interval = (interval_); (ev)->wd = -2; } while (0) #define ev_idle_set(ev) /* nop, yes, this is a serious in-joke */ #define ev_prepare_set(ev) /* nop, yes, this is a serious in-joke */ #define ev_check_set(ev) /* nop, yes, this is a serious in-joke */ #define ev_embed_set(ev,other_) do { (ev)->other = (other_); } while (0) #define ev_fork_set(ev) /* nop, yes, this is a serious in-joke */ #define ev_cleanup_set(ev) /* nop, yes, this is a serious in-joke */ #define ev_async_set(ev) /* nop, yes, this is a serious in-joke */ #define ev_io_init(ev,cb,fd,events) do { ev_init ((ev), (cb)); ev_io_set ((ev),(fd),(events)); } while (0) #define ev_timer_init(ev,cb,after,repeat) do { ev_init ((ev), (cb)); ev_timer_set ((ev),(after),(repeat)); } while (0) #define ev_periodic_init(ev,cb,ofs,ival,rcb) do { ev_init ((ev), (cb)); ev_periodic_set ((ev),(ofs),(ival),(rcb)); } while (0) #define ev_signal_init(ev,cb,signum) do { ev_init ((ev), (cb)); ev_signal_set ((ev), (signum)); } while (0) #define ev_child_init(ev,cb,pid,trace) do { ev_init ((ev), (cb)); ev_child_set ((ev),(pid),(trace)); } while (0) #define ev_stat_init(ev,cb,path,interval) do { ev_init ((ev), (cb)); ev_stat_set ((ev),(path),(interval)); } while (0) #define ev_idle_init(ev,cb) do { ev_init ((ev), (cb)); ev_idle_set ((ev)); } while (0) #define ev_prepare_init(ev,cb) do { ev_init ((ev), (cb)); ev_prepare_set ((ev)); } while (0) #define ev_check_init(ev,cb) do { ev_init ((ev), (cb)); ev_check_set ((ev)); } while (0) #define ev_embed_init(ev,cb,other) do { ev_init ((ev), (cb)); ev_embed_set ((ev),(other)); } while (0) #define ev_fork_init(ev,cb) do { ev_init ((ev), (cb)); ev_fork_set ((ev)); } while (0) #define ev_cleanup_init(ev,cb) do { ev_init ((ev), (cb)); ev_cleanup_set ((ev)); } while (0) #define ev_async_init(ev,cb) do { ev_init ((ev), (cb)); ev_async_set ((ev)); } while (0) #define ev_is_pending(ev) (0 + ((ev_watcher *)(void *)(ev))->pending) /* ro, true when watcher is waiting for callback invocation */ #define ev_is_active(ev) (0 + ((ev_watcher *)(void *)(ev))->active) /* ro, true when the watcher has been started */ #define ev_cb_(ev) (ev)->cb /* rw */ #define ev_cb(ev) (memmove (&ev_cb_ (ev), &((ev_watcher *)(ev))->cb, sizeof (ev_cb_ (ev))), (ev)->cb) #if EV_MINPRI == EV_MAXPRI # define ev_priority(ev) ((ev), EV_MINPRI) # define ev_set_priority(ev,pri) ((ev), (pri)) #else # define ev_priority(ev) (+(((ev_watcher *)(void *)(ev))->priority)) # define ev_set_priority(ev,pri) ( (ev_watcher *)(void *)(ev))->priority = (pri) #endif #define ev_periodic_at(ev) (+((ev_watcher_time *)(ev))->at) #ifndef ev_set_cb /* memmove is used here to avoid strict aliasing violations, and hopefully is optimized out by any reasonable compiler */ # define ev_set_cb(ev,cb_) (ev_cb_ (ev) = (cb_), memmove (&((ev_watcher *)(ev))->cb, &ev_cb_ (ev), sizeof (ev_cb_ (ev)))) #endif /* stopping (enabling, adding) a watcher does nothing if it is already running */ /* stopping (disabling, deleting) a watcher does nothing unless it's already running */ #if EV_PROTOTYPES /* feeds an event into a watcher as if the event actually occurred */ /* accepts any ev_watcher type */ EV_API_DECL void ev_feed_event (EV_P_ void *w, int revents) EV_NOEXCEPT; EV_API_DECL void ev_feed_fd_event (EV_P_ int fd, int revents) EV_NOEXCEPT; #if EV_SIGNAL_ENABLE EV_API_DECL void ev_feed_signal (int signum) EV_NOEXCEPT; EV_API_DECL void ev_feed_signal_event (EV_P_ int signum) EV_NOEXCEPT; #endif EV_API_DECL void ev_invoke (EV_P_ void *w, int revents); EV_API_DECL int ev_clear_pending (EV_P_ void *w) EV_NOEXCEPT; EV_API_DECL void ev_io_start (EV_P_ ev_io *w) EV_NOEXCEPT; EV_API_DECL void ev_io_stop (EV_P_ ev_io *w) EV_NOEXCEPT; EV_API_DECL void ev_timer_start (EV_P_ ev_timer *w) EV_NOEXCEPT; EV_API_DECL void ev_timer_stop (EV_P_ ev_timer *w) EV_NOEXCEPT; /* stops if active and no repeat, restarts if active and repeating, starts if inactive and repeating */ EV_API_DECL void ev_timer_again (EV_P_ ev_timer *w) EV_NOEXCEPT; /* return remaining time */ EV_API_DECL ev_tstamp ev_timer_remaining (EV_P_ ev_timer *w) EV_NOEXCEPT; #if EV_PERIODIC_ENABLE EV_API_DECL void ev_periodic_start (EV_P_ ev_periodic *w) EV_NOEXCEPT; EV_API_DECL void ev_periodic_stop (EV_P_ ev_periodic *w) EV_NOEXCEPT; EV_API_DECL void ev_periodic_again (EV_P_ ev_periodic *w) EV_NOEXCEPT; #endif /* only supported in the default loop */ #if EV_SIGNAL_ENABLE EV_API_DECL void ev_signal_start (EV_P_ ev_signal *w) EV_NOEXCEPT; EV_API_DECL void ev_signal_stop (EV_P_ ev_signal *w) EV_NOEXCEPT; #endif /* only supported in the default loop */ # if EV_CHILD_ENABLE EV_API_DECL void ev_child_start (EV_P_ ev_child *w) EV_NOEXCEPT; EV_API_DECL void ev_child_stop (EV_P_ ev_child *w) EV_NOEXCEPT; # endif # if EV_STAT_ENABLE EV_API_DECL void ev_stat_start (EV_P_ ev_stat *w) EV_NOEXCEPT; EV_API_DECL void ev_stat_stop (EV_P_ ev_stat *w) EV_NOEXCEPT; EV_API_DECL void ev_stat_stat (EV_P_ ev_stat *w) EV_NOEXCEPT; # endif # if EV_IDLE_ENABLE EV_API_DECL void ev_idle_start (EV_P_ ev_idle *w) EV_NOEXCEPT; EV_API_DECL void ev_idle_stop (EV_P_ ev_idle *w) EV_NOEXCEPT; # endif #if EV_PREPARE_ENABLE EV_API_DECL void ev_prepare_start (EV_P_ ev_prepare *w) EV_NOEXCEPT; EV_API_DECL void ev_prepare_stop (EV_P_ ev_prepare *w) EV_NOEXCEPT; #endif #if EV_CHECK_ENABLE EV_API_DECL void ev_check_start (EV_P_ ev_check *w) EV_NOEXCEPT; EV_API_DECL void ev_check_stop (EV_P_ ev_check *w) EV_NOEXCEPT; #endif # if EV_FORK_ENABLE EV_API_DECL void ev_fork_start (EV_P_ ev_fork *w) EV_NOEXCEPT; EV_API_DECL void ev_fork_stop (EV_P_ ev_fork *w) EV_NOEXCEPT; # endif # if EV_CLEANUP_ENABLE EV_API_DECL void ev_cleanup_start (EV_P_ ev_cleanup *w) EV_NOEXCEPT; EV_API_DECL void ev_cleanup_stop (EV_P_ ev_cleanup *w) EV_NOEXCEPT; # endif # if EV_EMBED_ENABLE /* only supported when loop to be embedded is in fact embeddable */ EV_API_DECL void ev_embed_start (EV_P_ ev_embed *w) EV_NOEXCEPT; EV_API_DECL void ev_embed_stop (EV_P_ ev_embed *w) EV_NOEXCEPT; EV_API_DECL void ev_embed_sweep (EV_P_ ev_embed *w) EV_NOEXCEPT; # endif # if EV_ASYNC_ENABLE EV_API_DECL void ev_async_start (EV_P_ ev_async *w) EV_NOEXCEPT; EV_API_DECL void ev_async_stop (EV_P_ ev_async *w) EV_NOEXCEPT; EV_API_DECL void ev_async_send (EV_P_ ev_async *w) EV_NOEXCEPT; # endif #if EV_COMPAT3 #define EVLOOP_NONBLOCK EVRUN_NOWAIT #define EVLOOP_ONESHOT EVRUN_ONCE #define EVUNLOOP_CANCEL EVBREAK_CANCEL #define EVUNLOOP_ONE EVBREAK_ONE #define EVUNLOOP_ALL EVBREAK_ALL #if EV_PROTOTYPES EV_INLINE void ev_loop (EV_P_ int flags) { ev_run (EV_A_ flags); } EV_INLINE void ev_unloop (EV_P_ int how ) { ev_break (EV_A_ how ); } EV_INLINE void ev_default_destroy (void) { ev_loop_destroy (EV_DEFAULT); } EV_INLINE void ev_default_fork (void) { ev_loop_fork (EV_DEFAULT); } #if EV_FEATURE_API EV_INLINE unsigned int ev_loop_count (EV_P) { return ev_iteration (EV_A); } EV_INLINE unsigned int ev_loop_depth (EV_P) { return ev_depth (EV_A); } EV_INLINE void ev_loop_verify (EV_P) { ev_verify (EV_A); } #endif #endif #else typedef struct ev_loop ev_loop; #endif #endif EV_CPP(}) #endif audit-4.0.2/src/libev/event.h0000644001034500103450000001415414655201403011473 /* * libevent compatibility header, only core events supported * * Copyright (c) 2007,2008,2010,2012 Marc Alexander Lehmann * All rights reserved. * * Redistribution and use in source and binary forms, with or without modifica- * tion, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MER- * CHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPE- * CIAL, 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 OTH- * ERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, the contents of this file may be used under the terms of * the GNU General Public License ("GPL") version 2 or any later version, * in which case the provisions of the GPL are applicable instead of * the above. If you wish to allow the use of your version of this file * only under the terms of the GPL and not to allow others to use your * version of this file under the BSD license, indicate your decision * by deleting the provisions above and replace them with the notice * and other provisions required by the GPL. If you do not delete the * provisions above, a recipient may use your version of this file under * either the BSD or the GPL. */ #ifndef EVENT_H_ #define EVENT_H_ #ifdef EV_H # include EV_H #else # include "ev.h" #endif #ifndef EVLOOP_NONBLOCK # define EVLOOP_NONBLOCK EVRUN_NOWAIT #endif #ifndef EVLOOP_ONESHOT # define EVLOOP_ONESHOT EVRUN_ONCE #endif #ifndef EV_TIMEOUT # define EV_TIMEOUT EV_TIMER #endif #ifdef __cplusplus extern "C" { #endif /* we need sys/time.h for struct timeval only */ #if !defined (WIN32) || defined (__MINGW32__) # include /* mingw seems to need this, for whatever reason */ # include #endif struct event_base; #define EVLIST_TIMEOUT 0x01 #define EVLIST_INSERTED 0x02 #define EVLIST_SIGNAL 0x04 #define EVLIST_ACTIVE 0x08 #define EVLIST_INTERNAL 0x10 #define EVLIST_INIT 0x80 typedef void (*event_callback_fn)(int, short, void *); struct event { /* libev watchers we map onto */ union { struct ev_io io; struct ev_signal sig; } iosig; struct ev_timer to; /* compatibility slots */ struct event_base *ev_base; event_callback_fn ev_callback; void *ev_arg; int ev_fd; int ev_pri; int ev_res; int ev_flags; short ev_events; }; event_callback_fn event_get_callback (const struct event *ev); #define EV_READ EV_READ #define EV_WRITE EV_WRITE #define EV_PERSIST 0x10 #define EV_ET 0x20 /* nop */ #define EVENT_SIGNAL(ev) ((int) (ev)->ev_fd) #define EVENT_FD(ev) ((int) (ev)->ev_fd) #define event_initialized(ev) ((ev)->ev_flags & EVLIST_INIT) #define evtimer_add(ev,tv) event_add (ev, tv) #define evtimer_set(ev,cb,data) event_set (ev, -1, 0, cb, data) #define evtimer_del(ev) event_del (ev) #define evtimer_pending(ev,tv) event_pending (ev, EV_TIMEOUT, tv) #define evtimer_initialized(ev) event_initialized (ev) #define timeout_add(ev,tv) evtimer_add (ev, tv) #define timeout_set(ev,cb,data) evtimer_set (ev, cb, data) #define timeout_del(ev) evtimer_del (ev) #define timeout_pending(ev,tv) evtimer_pending (ev, tv) #define timeout_initialized(ev) evtimer_initialized (ev) #define signal_add(ev,tv) event_add (ev, tv) #define signal_set(ev,sig,cb,data) event_set (ev, sig, EV_SIGNAL | EV_PERSIST, cb, data) #define signal_del(ev) event_del (ev) #define signal_pending(ev,tv) event_pending (ev, EV_SIGNAL, tv) #define signal_initialized(ev) event_initialized (ev) const char *event_get_version (void); const char *event_get_method (void); void *event_init (void); void event_base_free (struct event_base *base); #define EVLOOP_ONCE EVLOOP_ONESHOT int event_loop (int); int event_loopexit (struct timeval *tv); int event_dispatch (void); #define _EVENT_LOG_DEBUG 0 #define _EVENT_LOG_MSG 1 #define _EVENT_LOG_WARN 2 #define _EVENT_LOG_ERR 3 typedef void (*event_log_cb)(int severity, const char *msg); void event_set_log_callback(event_log_cb cb); void event_set (struct event *ev, int fd, short events, void (*cb)(int, short, void *), void *arg); int event_once (int fd, short events, void (*cb)(int, short, void *), void *arg, struct timeval *tv); int event_add (struct event *ev, struct timeval *tv); int event_del (struct event *ev); void event_active (struct event *ev, int res, short ncalls); /* ncalls is being ignored */ int event_pending (struct event *ev, short, struct timeval *tv); int event_priority_init (int npri); int event_priority_set (struct event *ev, int pri); struct event_base *event_base_new (void); const char *event_base_get_method (const struct event_base *); int event_base_set (struct event_base *base, struct event *ev); int event_base_loop (struct event_base *base, int); int event_base_loopexit (struct event_base *base, struct timeval *tv); int event_base_dispatch (struct event_base *base); int event_base_once (struct event_base *base, int fd, short events, void (*cb)(int, short, void *), void *arg, struct timeval *tv); int event_base_priority_init (struct event_base *base, int fd); /* next line is different in the libevent+libev version */ /*libevent-include*/ #ifdef __cplusplus } #endif #endif audit-4.0.2/src/libev/README0000644001034500103450000000503614655201403011060 libev is a high-performance event loop/event model with lots of features. (see benchmark at http://libev.schmorp.de/bench.html) ABOUT Homepage: http://software.schmorp.de/pkg/libev Mailinglist: libev@lists.schmorp.de http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev Library Documentation: http://pod.tst.eu/http://cvs.schmorp.de/libev/ev.pod Libev is modelled (very losely) after libevent and the Event perl module, but is faster, scales better and is more correct, and also more featureful. And also smaller. Yay. Some of the specialties of libev not commonly found elsewhere are: - extensive and detailed, readable documentation (not doxygen garbage). - fully supports fork, can detect fork in various ways and automatically re-arms kernel mechanisms that do not support fork. - highly optimised select, poll, linux epoll, linux aio, bsd kqueue and solaris event ports backends. - filesystem object (path) watching (with optional linux inotify support). - wallclock-based times (using absolute time, cron-like). - relative timers/timeouts (handle time jumps). - fast intra-thread communication between multiple event loops (with optional fast linux eventfd backend). - extremely easy to embed (fully documented, no dependencies, autoconf supported but optional). - very small codebase, no bloated library, simple code. - fully extensible by being able to plug into the event loop, integrate other event loops, integrate other event loop users. - very little memory use (small watchers, small event loop data). - optional C++ interface allowing method and function callbacks at no extra memory or runtime overhead. - optional Perl interface with similar characteristics (capable of running Glib/Gtk2 on libev). - support for other languages (multiple C++ interfaces, D, Ruby, Python) available from third-parties. Examples of programs that embed libev: the EV perl module, node.js, auditd, rxvt-unicode, gvpe (GNU Virtual Private Ethernet), the Deliantra MMORPG server (http://www.deliantra.net/), Rubinius (a next-generation Ruby VM), the Ebb web server, the Rev event toolkit. CONTRIBUTORS libev was written and designed by Marc Lehmann and Emanuele Giaquinta. The following people sent in patches or made other noteworthy contributions to the design (for minor patches, see the Changes file. If I forgot to include you, please shout at me, it was an accident): W.C.A. Wijngaards Christopher Layne Chris Brody audit-4.0.2/src/libev/ev_select.c0000644001034500103450000002122514655201403012313 /* * libev select fd activity backend * * Copyright (c) 2007,2008,2009,2010,2011 Marc Alexander Lehmann * All rights reserved. * * Redistribution and use in source and binary forms, with or without modifica- * tion, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MER- * CHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPE- * CIAL, 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 OTH- * ERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, the contents of this file may be used under the terms of * the GNU General Public License ("GPL") version 2 or any later version, * in which case the provisions of the GPL are applicable instead of * the above. If you wish to allow the use of your version of this file * only under the terms of the GPL and not to allow others to use your * version of this file under the BSD license, indicate your decision * by deleting the provisions above and replace them with the notice * and other provisions required by the GPL. If you do not delete the * provisions above, a recipient may use your version of this file under * either the BSD or the GPL. */ #ifndef _WIN32 /* for unix systems */ # include # ifndef __hpux /* for REAL unix systems */ # include # endif #endif #ifndef EV_SELECT_USE_FD_SET # ifdef NFDBITS # define EV_SELECT_USE_FD_SET 0 # else # define EV_SELECT_USE_FD_SET 1 # endif #endif #if EV_SELECT_IS_WINSOCKET # undef EV_SELECT_USE_FD_SET # define EV_SELECT_USE_FD_SET 1 # undef NFDBITS # define NFDBITS 0 #endif #if !EV_SELECT_USE_FD_SET # define NFDBYTES (NFDBITS / 8) #endif #include static void select_modify (EV_P_ int fd, int oev, int nev) { if (oev == nev) return; { #if EV_SELECT_USE_FD_SET #if EV_SELECT_IS_WINSOCKET SOCKET handle = anfds [fd].handle; #else int handle = fd; #endif assert (("libev: fd >= FD_SETSIZE passed to fd_set-based select backend", fd < FD_SETSIZE)); /* FD_SET is broken on windows (it adds the fd to a set twice or more, * which eventually leads to overflows). Need to call it only on changes. */ #if EV_SELECT_IS_WINSOCKET if ((oev ^ nev) & EV_READ) #endif if (nev & EV_READ) FD_SET (handle, (fd_set *)vec_ri); else FD_CLR (handle, (fd_set *)vec_ri); #if EV_SELECT_IS_WINSOCKET if ((oev ^ nev) & EV_WRITE) #endif if (nev & EV_WRITE) FD_SET (handle, (fd_set *)vec_wi); else FD_CLR (handle, (fd_set *)vec_wi); #else int word = fd / NFDBITS; fd_mask mask = 1UL << (fd % NFDBITS); if (ecb_expect_false (vec_max <= word)) { int new_max = word + 1; vec_ri = ev_realloc (vec_ri, new_max * NFDBYTES); vec_ro = ev_realloc (vec_ro, new_max * NFDBYTES); /* could free/malloc */ vec_wi = ev_realloc (vec_wi, new_max * NFDBYTES); vec_wo = ev_realloc (vec_wo, new_max * NFDBYTES); /* could free/malloc */ #ifdef _WIN32 vec_eo = ev_realloc (vec_eo, new_max * NFDBYTES); /* could free/malloc */ #endif for (; vec_max < new_max; ++vec_max) ((fd_mask *)vec_ri) [vec_max] = ((fd_mask *)vec_wi) [vec_max] = 0; } ((fd_mask *)vec_ri) [word] |= mask; if (!(nev & EV_READ)) ((fd_mask *)vec_ri) [word] &= ~mask; ((fd_mask *)vec_wi) [word] |= mask; if (!(nev & EV_WRITE)) ((fd_mask *)vec_wi) [word] &= ~mask; #endif } } static void select_poll (EV_P_ ev_tstamp timeout) { struct timeval tv; int res; int fd_setsize; EV_RELEASE_CB; EV_TV_SET (tv, timeout); #if EV_SELECT_USE_FD_SET fd_setsize = sizeof (fd_set); #else fd_setsize = vec_max * NFDBYTES; #endif memcpy (vec_ro, vec_ri, fd_setsize); memcpy (vec_wo, vec_wi, fd_setsize); #ifdef _WIN32 /* pass in the write set as except set. * the idea behind this is to work around a windows bug that causes * errors to be reported as an exception and not by setting * the writable bit. this is so uncontrollably lame. */ memcpy (vec_eo, vec_wi, fd_setsize); res = select (vec_max * NFDBITS, (fd_set *)vec_ro, (fd_set *)vec_wo, (fd_set *)vec_eo, &tv); #elif EV_SELECT_USE_FD_SET fd_setsize = anfdmax < FD_SETSIZE ? anfdmax : FD_SETSIZE; res = select (fd_setsize, (fd_set *)vec_ro, (fd_set *)vec_wo, 0, &tv); #else res = select (vec_max * NFDBITS, (fd_set *)vec_ro, (fd_set *)vec_wo, 0, &tv); #endif EV_ACQUIRE_CB; if (ecb_expect_false (res < 0)) { #if EV_SELECT_IS_WINSOCKET errno = WSAGetLastError (); #endif #ifdef WSABASEERR /* on windows, select returns incompatible error codes, fix this */ if (errno >= WSABASEERR && errno < WSABASEERR + 1000) if (errno == WSAENOTSOCK) errno = EBADF; else errno -= WSABASEERR; #endif #ifdef _WIN32 /* select on windows erroneously returns EINVAL when no fd sets have been * provided (this is documented). what microsoft doesn't tell you that this bug * exists even when the fd sets _are_ provided, so we have to check for this bug * here and emulate by sleeping manually. * we also get EINVAL when the timeout is invalid, but we ignore this case here * and assume that EINVAL always means: you have to wait manually. */ if (errno == EINVAL) { if (timeout) { unsigned long ms = EV_TS_TO_MSEC (timeout); Sleep (ms ? ms : 1); } return; } #endif if (errno == EBADF) fd_ebadf (EV_A); else if (errno == ENOMEM && !syserr_cb) fd_enomem (EV_A); else if (errno != EINTR) ev_syserr ("(libev) select"); return; } #if EV_SELECT_USE_FD_SET { int fd; for (fd = 0; fd < anfdmax; ++fd) if (anfds [fd].events) { int events = 0; #if EV_SELECT_IS_WINSOCKET SOCKET handle = anfds [fd].handle; #else int handle = fd; #endif if (FD_ISSET (handle, (fd_set *)vec_ro)) events |= EV_READ; if (FD_ISSET (handle, (fd_set *)vec_wo)) events |= EV_WRITE; #ifdef _WIN32 if (FD_ISSET (handle, (fd_set *)vec_eo)) events |= EV_WRITE; #endif if (ecb_expect_true (events)) fd_event (EV_A_ fd, events); } } #else { int word, bit; for (word = vec_max; word--; ) { fd_mask word_r = ((fd_mask *)vec_ro) [word]; fd_mask word_w = ((fd_mask *)vec_wo) [word]; #ifdef _WIN32 word_w |= ((fd_mask *)vec_eo) [word]; #endif if (word_r || word_w) for (bit = NFDBITS; bit--; ) { fd_mask mask = 1UL << bit; int events = 0; events |= word_r & mask ? EV_READ : 0; events |= word_w & mask ? EV_WRITE : 0; if (ecb_expect_true (events)) fd_event (EV_A_ word * NFDBITS + bit, events); } } } #endif } inline_size int select_init (EV_P_ int flags) { backend_mintime = EV_TS_CONST (1e-6); backend_modify = select_modify; backend_poll = select_poll; #if EV_SELECT_USE_FD_SET vec_ri = ev_malloc (sizeof (fd_set)); FD_ZERO ((fd_set *)vec_ri); vec_ro = ev_malloc (sizeof (fd_set)); vec_wi = ev_malloc (sizeof (fd_set)); FD_ZERO ((fd_set *)vec_wi); vec_wo = ev_malloc (sizeof (fd_set)); #ifdef _WIN32 vec_eo = ev_malloc (sizeof (fd_set)); #endif #else vec_max = 0; vec_ri = 0; vec_ro = 0; vec_wi = 0; vec_wo = 0; #ifdef _WIN32 vec_eo = 0; #endif #endif return EVBACKEND_SELECT; } inline_size void select_destroy (EV_P) { ev_free (vec_ri); ev_free (vec_ro); ev_free (vec_wi); ev_free (vec_wo); #ifdef _WIN32 ev_free (vec_eo); #endif } audit-4.0.2/src/libev/event.c0000644001034500103450000002333614655201403011470 /* * libevent compatibility layer * * Copyright (c) 2007,2008,2009,2010,2012 Marc Alexander Lehmann * All rights reserved. * * Redistribution and use in source and binary forms, with or without modifica- * tion, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MER- * CHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPE- * CIAL, 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 OTH- * ERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, the contents of this file may be used under the terms of * the GNU General Public License ("GPL") version 2 or any later version, * in which case the provisions of the GPL are applicable instead of * the above. If you wish to allow the use of your version of this file * only under the terms of the GPL and not to allow others to use your * version of this file under the BSD license, indicate your decision * by deleting the provisions above and replace them with the notice * and other provisions required by the GPL. If you do not delete the * provisions above, a recipient may use your version of this file under * either the BSD or the GPL. */ #include #include #include #ifdef EV_EVENT_H # include EV_EVENT_H #else # include "event.h" #endif #if EV_MULTIPLICITY # define dLOOPev struct ev_loop *loop = (struct ev_loop *)ev->ev_base # define dLOOPbase struct ev_loop *loop = (struct ev_loop *)base #else # define dLOOPev # define dLOOPbase #endif /* never accessed, will always be cast from/to ev_loop */ struct event_base { int dummy; }; static struct event_base *ev_x_cur; static ev_tstamp ev_tv_get (struct timeval *tv) { if (tv) { ev_tstamp after = tv->tv_sec + tv->tv_usec * 1e-6; return after ? after : 1e-6; } else return -1.; } #define EVENT_STRINGIFY(s) # s #define EVENT_VERSION(a,b) EVENT_STRINGIFY (a) "." EVENT_STRINGIFY (b) const char * event_get_version (void) { /* returns ABI, not API or library, version */ return EVENT_VERSION (EV_VERSION_MAJOR, EV_VERSION_MINOR); } const char * event_get_method (void) { return "libev"; } void *event_init (void) { #if EV_MULTIPLICITY if (ev_x_cur) ev_x_cur = (struct event_base *)ev_loop_new (EVFLAG_AUTO); else ev_x_cur = (struct event_base *)ev_default_loop (EVFLAG_AUTO); #else assert (("libev: multiple event bases not supported when not compiled with EV_MULTIPLICITY", !ev_x_cur)); ev_x_cur = (struct event_base *)(long)ev_default_loop (EVFLAG_AUTO); #endif return ev_x_cur; } const char * event_base_get_method (const struct event_base *base) { return "libev"; } struct event_base * event_base_new (void) { #if EV_MULTIPLICITY return (struct event_base *)ev_loop_new (EVFLAG_AUTO); #else assert (("libev: multiple event bases not supported when not compiled with EV_MULTIPLICITY")); return NULL; #endif } void event_base_free (struct event_base *base) { dLOOPbase; #if EV_MULTIPLICITY if (!ev_is_default_loop (loop)) ev_loop_destroy (loop); #endif } int event_dispatch (void) { return event_base_dispatch (ev_x_cur); } #ifdef EV_STANDALONE void event_set_log_callback (event_log_cb cb) { /* nop */ } #endif int event_loop (int flags) { return event_base_loop (ev_x_cur, flags); } int event_loopexit (struct timeval *tv) { return event_base_loopexit (ev_x_cur, tv); } event_callback_fn event_get_callback (const struct event *ev) { return ev->ev_callback; } static void ev_x_cb (struct event *ev, int revents) { revents &= EV_READ | EV_WRITE | EV_TIMER | EV_SIGNAL; ev->ev_res = revents; ev->ev_callback (ev->ev_fd, (short)revents, ev->ev_arg); } static void ev_x_cb_sig (EV_P_ struct ev_signal *w, int revents) { struct event *ev = (struct event *)(((char *)w) - offsetof (struct event, iosig.sig)); if (revents & EV_ERROR) event_del (ev); ev_x_cb (ev, revents); } static void ev_x_cb_io (EV_P_ struct ev_io *w, int revents) { struct event *ev = (struct event *)(((char *)w) - offsetof (struct event, iosig.io)); if ((revents & EV_ERROR) || !(ev->ev_events & EV_PERSIST)) event_del (ev); ev_x_cb (ev, revents); } static void ev_x_cb_to (EV_P_ struct ev_timer *w, int revents) { struct event *ev = (struct event *)(((char *)w) - offsetof (struct event, to)); event_del (ev); ev_x_cb (ev, revents); } void event_set (struct event *ev, int fd, short events, void (*cb)(int, short, void *), void *arg) { if (events & EV_SIGNAL) ev_init (&ev->iosig.sig, ev_x_cb_sig); else ev_init (&ev->iosig.io, ev_x_cb_io); ev_init (&ev->to, ev_x_cb_to); ev->ev_base = ev_x_cur; /* not threadsafe, but it's how libevent works */ ev->ev_fd = fd; ev->ev_events = events; ev->ev_pri = 0; ev->ev_callback = cb; ev->ev_arg = arg; ev->ev_res = 0; ev->ev_flags = EVLIST_INIT; } int event_once (int fd, short events, void (*cb)(int, short, void *), void *arg, struct timeval *tv) { return event_base_once (ev_x_cur, fd, events, cb, arg, tv); } int event_add (struct event *ev, struct timeval *tv) { dLOOPev; if (ev->ev_events & EV_SIGNAL) { if (!ev_is_active (&ev->iosig.sig)) { ev_signal_set (&ev->iosig.sig, ev->ev_fd); ev_signal_start (EV_A_ &ev->iosig.sig); ev->ev_flags |= EVLIST_SIGNAL; } } else if (ev->ev_events & (EV_READ | EV_WRITE)) { if (!ev_is_active (&ev->iosig.io)) { ev_io_set (&ev->iosig.io, ev->ev_fd, ev->ev_events & (EV_READ | EV_WRITE)); ev_io_start (EV_A_ &ev->iosig.io); ev->ev_flags |= EVLIST_INSERTED; } } if (tv) { ev->to.repeat = ev_tv_get (tv); ev_timer_again (EV_A_ &ev->to); ev->ev_flags |= EVLIST_TIMEOUT; } else { ev_timer_stop (EV_A_ &ev->to); ev->ev_flags &= ~EVLIST_TIMEOUT; } ev->ev_flags |= EVLIST_ACTIVE; return 0; } int event_del (struct event *ev) { dLOOPev; if (ev->ev_events & EV_SIGNAL) ev_signal_stop (EV_A_ &ev->iosig.sig); else if (ev->ev_events & (EV_READ | EV_WRITE)) ev_io_stop (EV_A_ &ev->iosig.io); if (ev_is_active (&ev->to)) ev_timer_stop (EV_A_ &ev->to); ev->ev_flags = EVLIST_INIT; return 0; } void event_active (struct event *ev, int res, short ncalls) { dLOOPev; if (res & EV_TIMEOUT) ev_feed_event (EV_A_ &ev->to, res & EV_TIMEOUT); if (res & EV_SIGNAL) ev_feed_event (EV_A_ &ev->iosig.sig, res & EV_SIGNAL); if (res & (EV_READ | EV_WRITE)) ev_feed_event (EV_A_ &ev->iosig.io, res & (EV_READ | EV_WRITE)); } int event_pending (struct event *ev, short events, struct timeval *tv) { short revents = 0; dLOOPev; if (ev->ev_events & EV_SIGNAL) { /* sig */ if (ev_is_active (&ev->iosig.sig) || ev_is_pending (&ev->iosig.sig)) revents |= EV_SIGNAL; } else if (ev->ev_events & (EV_READ | EV_WRITE)) { /* io */ if (ev_is_active (&ev->iosig.io) || ev_is_pending (&ev->iosig.io)) revents |= ev->ev_events & (EV_READ | EV_WRITE); } if (ev->ev_events & EV_TIMEOUT || ev_is_active (&ev->to) || ev_is_pending (&ev->to)) { revents |= EV_TIMEOUT; if (tv) { ev_tstamp at = ev_now (EV_A); tv->tv_sec = (long)at; tv->tv_usec = (long)((at - (ev_tstamp)tv->tv_sec) * 1e6); } } return events & revents; } int event_priority_init (int npri) { return event_base_priority_init (ev_x_cur, npri); } int event_priority_set (struct event *ev, int pri) { ev->ev_pri = pri; return 0; } int event_base_set (struct event_base *base, struct event *ev) { ev->ev_base = base; return 0; } int event_base_loop (struct event_base *base, int flags) { dLOOPbase; return !ev_run (EV_A_ flags); } int event_base_dispatch (struct event_base *base) { return event_base_loop (base, 0); } static void ev_x_loopexit_cb (int revents, void *base) { dLOOPbase; ev_break (EV_A_ EVBREAK_ONE); } int event_base_loopexit (struct event_base *base, struct timeval *tv) { ev_tstamp after = ev_tv_get (tv); dLOOPbase; ev_once (EV_A_ -1, 0, after >= 0. ? after : 0., ev_x_loopexit_cb, (void *)base); return 0; } struct ev_x_once { int fd; void (*cb)(int, short, void *); void *arg; }; static void ev_x_once_cb (int revents, void *arg) { struct ev_x_once *once = (struct ev_x_once *)arg; once->cb (once->fd, (short)revents, once->arg); free (once); } int event_base_once (struct event_base *base, int fd, short events, void (*cb)(int, short, void *), void *arg, struct timeval *tv) { struct ev_x_once *once = (struct ev_x_once *)malloc (sizeof (struct ev_x_once)); dLOOPbase; if (!once) return -1; once->fd = fd; once->cb = cb; once->arg = arg; ev_once (EV_A_ fd, events & (EV_READ | EV_WRITE), ev_tv_get (tv), ev_x_once_cb, (void *)once); return 0; } int event_base_priority_init (struct event_base *base, int npri) { /*dLOOPbase;*/ return 0; } audit-4.0.2/src/libev/ev_linuxaio.c0000644001034500103450000005176614655201403012701 /* * libev linux aio fd activity backend * * Copyright (c) 2019 Marc Alexander Lehmann * All rights reserved. * * Redistribution and use in source and binary forms, with or without modifica- * tion, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MER- * CHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPE- * CIAL, 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 OTH- * ERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, the contents of this file may be used under the terms of * the GNU General Public License ("GPL") version 2 or any later version, * in which case the provisions of the GPL are applicable instead of * the above. If you wish to allow the use of your version of this file * only under the terms of the GPL and not to allow others to use your * version of this file under the BSD license, indicate your decision * by deleting the provisions above and replace them with the notice * and other provisions required by the GPL. If you do not delete the * provisions above, a recipient may use your version of this file under * either the BSD or the GPL. */ /* * general notes about linux aio: * * a) at first, the linux aio IOCB_CMD_POLL functionality introduced in * 4.18 looks too good to be true: both watchers and events can be * batched, and events can even be handled in userspace using * a ring buffer shared with the kernel. watchers can be canceled * regardless of whether the fd has been closed. no problems with fork. * ok, the ring buffer is 200% undocumented (there isn't even a * header file), but otherwise, it's pure bliss! * b) ok, watchers are one-shot, so you have to re-arm active ones * on every iteration. so much for syscall-less event handling, * but at least these re-arms can be batched, no big deal, right? * c) well, linux as usual: the documentation lies to you: io_submit * sometimes returns EINVAL because the kernel doesn't feel like * handling your poll mask - ttys can be polled for POLLOUT, * POLLOUT|POLLIN, but polling for POLLIN fails. just great, * so we have to fall back to something else (hello, epoll), * but at least the fallback can be slow, because these are * exceptional cases, right? * d) hmm, you have to tell the kernel the maximum number of watchers * you want to queue when initialising the aio context. but of * course the real limit is magically calculated in the kernel, and * is often higher then we asked for. so we just have to destroy * the aio context and re-create it a bit larger if we hit the limit. * (starts to remind you of epoll? well, it's a bit more deterministic * and less gambling, but still ugly as hell). * e) that's when you find out you can also hit an arbitrary system-wide * limit. or the kernel simply doesn't want to handle your watchers. * what the fuck do we do then? you guessed it, in the middle * of event handling we have to switch to 100% epoll polling. and * that better is as fast as normal epoll polling, so you practically * have to use the normal epoll backend with all its quirks. * f) end result of this train wreck: it inherits all the disadvantages * from epoll, while adding a number on its own. why even bother to use * it? because if conditions are right and your fds are supported and you * don't hit a limit, this backend is actually faster, doesn't gamble with * your fds, batches watchers and events and doesn't require costly state * recreates. well, until it does. * g) all of this makes this backend use almost twice as much code as epoll. * which in turn uses twice as much code as poll. and that#s not counting * the fact that this backend also depends on the epoll backend, making * it three times as much code as poll, or kqueue. * h) bleah. why can't linux just do kqueue. sure kqueue is ugly, but by now * it's clear that whatever linux comes up with is far, far, far worse. */ #include /* actually linux/time.h, but we must assume they are compatible */ #include #include /*****************************************************************************/ /* syscall wrapdadoop - this section has the raw api/abi definitions */ #include /* no glibc wrappers */ /* aio_abi.h is not versioned in any way, so we cannot test for its existance */ #define IOCB_CMD_POLL 5 /* taken from linux/fs/aio.c. yup, that's a .c file. * not only is this totally undocumented, not even the source code * can tell you what the future semantics of compat_features and * incompat_features are, or what header_length actually is for. */ #define AIO_RING_MAGIC 0xa10a10a1 #define EV_AIO_RING_INCOMPAT_FEATURES 0 struct aio_ring { unsigned id; /* kernel internal index number */ unsigned nr; /* number of io_events */ unsigned head; /* Written to by userland or by kernel. */ unsigned tail; unsigned magic; unsigned compat_features; unsigned incompat_features; unsigned header_length; /* size of aio_ring */ struct io_event io_events[0]; }; inline_size int evsys_io_setup (unsigned nr_events, aio_context_t *ctx_idp) { return ev_syscall2 (SYS_io_setup, nr_events, ctx_idp); } inline_size int evsys_io_destroy (aio_context_t ctx_id) { return ev_syscall1 (SYS_io_destroy, ctx_id); } inline_size int evsys_io_submit (aio_context_t ctx_id, long nr, struct iocb *cbp[]) { return ev_syscall3 (SYS_io_submit, ctx_id, nr, cbp); } inline_size int evsys_io_cancel (aio_context_t ctx_id, struct iocb *cbp, struct io_event *result) { return ev_syscall3 (SYS_io_cancel, ctx_id, cbp, result); } inline_size int evsys_io_getevents (aio_context_t ctx_id, long min_nr, long nr, struct io_event *events, struct timespec *timeout) { return ev_syscall5 (SYS_io_getevents, ctx_id, min_nr, nr, events, timeout); } /*****************************************************************************/ /* actual backed implementation */ ecb_cold static int linuxaio_nr_events (EV_P) { /* we start with 16 iocbs and incraese from there * that's tiny, but the kernel has a rather low system-wide * limit that can be reached quickly, so let's be parsimonious * with this resource. * Rest assured, the kernel generously rounds up small and big numbers * in different ways (but doesn't seem to charge you for it). * The 15 here is because the kernel usually has a power of two as aio-max-nr, * and this helps to take advantage of that limit. */ /* we try to fill 4kB pages exactly. * the ring buffer header is 32 bytes, every io event is 32 bytes. * the kernel takes the io requests number, doubles it, adds 2 * and adds the ring buffer. * the way we use this is by starting low, and then roughly doubling the * size each time we hit a limit. */ int requests = 15 << linuxaio_iteration; int one_page = (4096 / sizeof (struct io_event) ) / 2; /* how many fit into one page */ int first_page = ((4096 - sizeof (struct aio_ring)) / sizeof (struct io_event) - 2) / 2; /* how many fit into the first page */ /* if everything fits into one page, use count exactly */ if (requests > first_page) /* otherwise, round down to full pages and add the first page */ requests = requests / one_page * one_page + first_page; return requests; } /* we use out own wrapper structure in case we ever want to do something "clever" */ typedef struct aniocb { struct iocb io; /*int inuse;*/ } *ANIOCBP; inline_size void linuxaio_array_needsize_iocbp (ANIOCBP *base, int offset, int count) { while (count--) { /* TODO: quite the overhead to allocate every iocb separately, maybe use our own allocator? */ ANIOCBP iocb = (ANIOCBP)ev_malloc (sizeof (*iocb)); /* full zero initialise is probably not required at the moment, but * this is not well documented, so we better do it. */ memset (iocb, 0, sizeof (*iocb)); iocb->io.aio_lio_opcode = IOCB_CMD_POLL; iocb->io.aio_fildes = offset; base [offset++] = iocb; } } ecb_cold static void linuxaio_free_iocbp (EV_P) { while (linuxaio_iocbpmax--) ev_free (linuxaio_iocbps [linuxaio_iocbpmax]); linuxaio_iocbpmax = 0; /* next resize will completely reallocate the array, at some overhead */ } static void linuxaio_modify (EV_P_ int fd, int oev, int nev) { array_needsize (ANIOCBP, linuxaio_iocbps, linuxaio_iocbpmax, fd + 1, linuxaio_array_needsize_iocbp); ANIOCBP iocb = linuxaio_iocbps [fd]; ANFD *anfd = &anfds [fd]; if (ecb_expect_false (iocb->io.aio_reqprio < 0)) { /* we handed this fd over to epoll, so undo this first */ /* we do it manually because the optimisations on epoll_modify won't do us any good */ epoll_ctl (backend_fd, EPOLL_CTL_DEL, fd, 0); anfd->emask = 0; iocb->io.aio_reqprio = 0; } else if (ecb_expect_false (iocb->io.aio_buf)) { /* iocb active, so cancel it first before resubmit */ /* this assumes we only ever get one call per fd per loop iteration */ for (;;) { /* on all relevant kernels, io_cancel fails with EINPROGRESS on "success" */ if (ecb_expect_false (evsys_io_cancel (linuxaio_ctx, &iocb->io, (struct io_event *)0) == 0)) break; if (ecb_expect_true (errno == EINPROGRESS)) break; /* the EINPROGRESS test is for nicer error message. clumsy. */ if (errno != EINTR) { assert (("libev: linuxaio unexpected io_cancel failed", errno != EINTR && errno != EINPROGRESS)); break; } } /* increment generation counter to avoid handling old events */ ++anfd->egen; } iocb->io.aio_buf = (nev & EV_READ ? POLLIN : 0) | (nev & EV_WRITE ? POLLOUT : 0); if (nev) { iocb->io.aio_data = (uint32_t)fd | ((__u64)(uint32_t)anfd->egen << 32); /* queue iocb up for io_submit */ /* this assumes we only ever get one call per fd per loop iteration */ ++linuxaio_submitcnt; array_needsize (struct iocb *, linuxaio_submits, linuxaio_submitmax, linuxaio_submitcnt, array_needsize_noinit); linuxaio_submits [linuxaio_submitcnt - 1] = &iocb->io; } } static void linuxaio_epoll_cb (EV_P_ struct ev_io *w, int revents) { epoll_poll (EV_A_ 0); } inline_speed void linuxaio_fd_rearm (EV_P_ int fd) { anfds [fd].events = 0; linuxaio_iocbps [fd]->io.aio_buf = 0; fd_change (EV_A_ fd, EV_ANFD_REIFY); } static void linuxaio_parse_events (EV_P_ struct io_event *ev, int nr) { while (nr) { int fd = ev->data & 0xffffffff; uint32_t gen = ev->data >> 32; int res = ev->res; assert (("libev: iocb fd must be in-bounds", fd >= 0 && fd < anfdmax)); /* only accept events if generation counter matches */ if (ecb_expect_true (gen == (uint32_t)anfds [fd].egen)) { /* feed events, we do not expect or handle POLLNVAL */ fd_event ( EV_A_ fd, (res & (POLLOUT | POLLERR | POLLHUP) ? EV_WRITE : 0) | (res & (POLLIN | POLLERR | POLLHUP) ? EV_READ : 0) ); /* linux aio is oneshot: rearm fd. TODO: this does more work than strictly needed */ linuxaio_fd_rearm (EV_A_ fd); } --nr; ++ev; } } /* get any events from ring buffer, return true if any were handled */ static int linuxaio_get_events_from_ring (EV_P) { struct aio_ring *ring = (struct aio_ring *)linuxaio_ctx; unsigned head, tail; /* the kernel reads and writes both of these variables, */ /* as a C extension, we assume that volatile use here */ /* both makes reads atomic and once-only */ head = *(volatile unsigned *)&ring->head; ECB_MEMORY_FENCE_ACQUIRE; tail = *(volatile unsigned *)&ring->tail; if (head == tail) return 0; /* parse all available events, but only once, to avoid starvation */ if (ecb_expect_true (tail > head)) /* normal case around */ linuxaio_parse_events (EV_A_ ring->io_events + head, tail - head); else /* wrapped around */ { linuxaio_parse_events (EV_A_ ring->io_events + head, ring->nr - head); linuxaio_parse_events (EV_A_ ring->io_events, tail); } ECB_MEMORY_FENCE_RELEASE; /* as an extension to C, we hope that the volatile will make this atomic and once-only */ *(volatile unsigned *)&ring->head = tail; return 1; } inline_size int linuxaio_ringbuf_valid (EV_P) { struct aio_ring *ring = (struct aio_ring *)linuxaio_ctx; return ecb_expect_true (ring->magic == AIO_RING_MAGIC) && ring->incompat_features == EV_AIO_RING_INCOMPAT_FEATURES && ring->header_length == sizeof (struct aio_ring); /* TODO: or use it to find io_event[0]? */ } /* read at least one event from kernel, or timeout */ inline_size void linuxaio_get_events (EV_P_ ev_tstamp timeout) { struct timespec ts; struct io_event ioev[8]; /* 256 octet stack space */ int want = 1; /* how many events to request */ int ringbuf_valid = linuxaio_ringbuf_valid (EV_A); if (ecb_expect_true (ringbuf_valid)) { /* if the ring buffer has any events, we don't wait or call the kernel at all */ if (linuxaio_get_events_from_ring (EV_A)) return; /* if the ring buffer is empty, and we don't have a timeout, then don't call the kernel */ if (!timeout) return; } else /* no ringbuffer, request slightly larger batch */ want = sizeof (ioev) / sizeof (ioev [0]); /* no events, so wait for some * for fairness reasons, we do this in a loop, to fetch all events */ for (;;) { int res; EV_RELEASE_CB; EV_TS_SET (ts, timeout); res = evsys_io_getevents (linuxaio_ctx, 1, want, ioev, &ts); EV_ACQUIRE_CB; if (res < 0) if (errno == EINTR) /* ignored, retry */; else ev_syserr ("(libev) linuxaio io_getevents"); else if (res) { /* at least one event available, handle them */ linuxaio_parse_events (EV_A_ ioev, res); if (ecb_expect_true (ringbuf_valid)) { /* if we have a ring buffer, handle any remaining events in it */ linuxaio_get_events_from_ring (EV_A); /* at this point, we should have handled all outstanding events */ break; } else if (res < want) /* otherwise, if there were fewere events than we wanted, we assume there are no more */ break; } else break; /* no events from the kernel, we are done */ timeout = EV_TS_CONST (0.); /* only wait in the first iteration */ } } inline_size int linuxaio_io_setup (EV_P) { linuxaio_ctx = 0; return evsys_io_setup (linuxaio_nr_events (EV_A), &linuxaio_ctx); } static void linuxaio_poll (EV_P_ ev_tstamp timeout) { int submitted; /* first phase: submit new iocbs */ /* io_submit might return less than the requested number of iocbs */ /* this is, afaics, only because of errors, but we go by the book and use a loop, */ /* which allows us to pinpoint the erroneous iocb */ for (submitted = 0; submitted < linuxaio_submitcnt; ) { int res = evsys_io_submit (linuxaio_ctx, linuxaio_submitcnt - submitted, linuxaio_submits + submitted); if (ecb_expect_false (res < 0)) if (errno == EINVAL) { /* This happens for unsupported fds, officially, but in my testing, * also randomly happens for supported fds. We fall back to good old * poll() here, under the assumption that this is a very rare case. * See https://lore.kernel.org/patchwork/patch/1047453/ to see * discussion about such a case (ttys) where polling for POLLIN * fails but POLLIN|POLLOUT works. */ struct iocb *iocb = linuxaio_submits [submitted]; epoll_modify (EV_A_ iocb->aio_fildes, 0, anfds [iocb->aio_fildes].events); iocb->aio_reqprio = -1; /* mark iocb as epoll */ res = 1; /* skip this iocb - another iocb, another chance */ } else if (errno == EAGAIN) { /* This happens when the ring buffer is full, or some other shit we * don't know and isn't documented. Most likely because we have too * many requests and linux aio can't be assed to handle them. * In this case, we try to allocate a larger ring buffer, freeing * ours first. This might fail, in which case we have to fall back to 100% * epoll. * God, how I hate linux not getting its act together. Ever. */ evsys_io_destroy (linuxaio_ctx); linuxaio_submitcnt = 0; /* rearm all fds with active iocbs */ { int fd; for (fd = 0; fd < linuxaio_iocbpmax; ++fd) if (linuxaio_iocbps [fd]->io.aio_buf) linuxaio_fd_rearm (EV_A_ fd); } ++linuxaio_iteration; if (linuxaio_io_setup (EV_A) < 0) { /* TODO: rearm all and recreate epoll backend from scratch */ /* TODO: might be more prudent? */ /* to bad, we can't get a new aio context, go 100% epoll */ linuxaio_free_iocbp (EV_A); ev_io_stop (EV_A_ &linuxaio_epoll_w); ev_ref (EV_A); linuxaio_ctx = 0; backend = EVBACKEND_EPOLL; backend_modify = epoll_modify; backend_poll = epoll_poll; } timeout = EV_TS_CONST (0.); /* it's easiest to handle this mess in another iteration */ return; } else if (errno == EBADF) { assert (("libev: event loop rejected bad fd", errno != EBADF)); fd_kill (EV_A_ linuxaio_submits [submitted]->aio_fildes); res = 1; /* skip this iocb */ } else if (errno == EINTR) /* not seen in reality, not documented */ res = 0; /* silently ignore and retry */ else { ev_syserr ("(libev) linuxaio io_submit"); res = 0; } submitted += res; } linuxaio_submitcnt = 0; /* second phase: fetch and parse events */ linuxaio_get_events (EV_A_ timeout); } inline_size int linuxaio_init (EV_P_ int flags) { /* would be great to have a nice test for IOCB_CMD_POLL instead */ /* also: test some semi-common fd types, such as files and ttys in recommended_backends */ /* 4.18 introduced IOCB_CMD_POLL, 4.19 made epoll work, and we need that */ if (ev_linux_version () < 0x041300) return 0; if (!epoll_init (EV_A_ 0)) return 0; linuxaio_iteration = 0; if (linuxaio_io_setup (EV_A) < 0) { epoll_destroy (EV_A); return 0; } ev_io_init (&linuxaio_epoll_w, linuxaio_epoll_cb, backend_fd, EV_READ); ev_set_priority (&linuxaio_epoll_w, EV_MAXPRI); ev_io_start (EV_A_ &linuxaio_epoll_w); ev_unref (EV_A); /* watcher should not keep loop alive */ backend_modify = linuxaio_modify; backend_poll = linuxaio_poll; linuxaio_iocbpmax = 0; linuxaio_iocbps = 0; linuxaio_submits = 0; linuxaio_submitmax = 0; linuxaio_submitcnt = 0; return EVBACKEND_LINUXAIO; } inline_size void linuxaio_destroy (EV_P) { epoll_destroy (EV_A); linuxaio_free_iocbp (EV_A); evsys_io_destroy (linuxaio_ctx); /* fails in child, aio context is destroyed */ } ecb_cold static void linuxaio_fork (EV_P) { linuxaio_submitcnt = 0; /* all pointers were invalidated */ linuxaio_free_iocbp (EV_A); /* this frees all iocbs, which is very heavy-handed */ evsys_io_destroy (linuxaio_ctx); /* fails in child, aio context is destroyed */ linuxaio_iteration = 0; /* we start over in the child */ while (linuxaio_io_setup (EV_A) < 0) ev_syserr ("(libev) linuxaio io_setup"); /* forking epoll should also effectively unregister all fds from the backend */ epoll_fork (EV_A); /* epoll_fork already did this. hopefully */ /*fd_rearm_all (EV_A);*/ ev_io_stop (EV_A_ &linuxaio_epoll_w); ev_io_set (EV_A_ &linuxaio_epoll_w, backend_fd, EV_READ); ev_io_start (EV_A_ &linuxaio_epoll_w); } audit-4.0.2/src/libev/ev_poll.c0000644001034500103450000001102314655201403011775 /* * libev poll fd activity backend * * Copyright (c) 2007,2008,2009,2010,2011,2016,2019 Marc Alexander Lehmann * All rights reserved. * * Redistribution and use in source and binary forms, with or without modifica- * tion, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MER- * CHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPE- * CIAL, 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 OTH- * ERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * Alternatively, the contents of this file may be used under the terms of * the GNU General Public License ("GPL") version 2 or any later version, * in which case the provisions of the GPL are applicable instead of * the above. If you wish to allow the use of your version of this file * only under the terms of the GPL and not to allow others to use your * version of this file under the BSD license, indicate your decision * by deleting the provisions above and replace them with the notice * and other provisions required by the GPL. If you do not delete the * provisions above, a recipient may use your version of this file under * either the BSD or the GPL. */ #include inline_size void array_needsize_pollidx (int *base, int offset, int count) { /* using memset (.., -1, ...) is tempting, we we try * to be ultraportable */ base += offset; while (count--) *base++ = -1; } static void poll_modify (EV_P_ int fd, int oev, int nev) { int idx; if (oev == nev) return; array_needsize (int, pollidxs, pollidxmax, fd + 1, array_needsize_pollidx); idx = pollidxs [fd]; if (idx < 0) /* need to allocate a new pollfd */ { pollidxs [fd] = idx = pollcnt++; array_needsize (struct pollfd, polls, pollmax, pollcnt, array_needsize_noinit); polls [idx].fd = fd; } assert (polls [idx].fd == fd); if (nev) polls [idx].events = (nev & EV_READ ? POLLIN : 0) | (nev & EV_WRITE ? POLLOUT : 0); else /* remove pollfd */ { pollidxs [fd] = -1; if (ecb_expect_true (idx < --pollcnt)) { polls [idx] = polls [pollcnt]; pollidxs [polls [idx].fd] = idx; } } } static void poll_poll (EV_P_ ev_tstamp timeout) { struct pollfd *p; int res; EV_RELEASE_CB; res = poll (polls, pollcnt, EV_TS_TO_MSEC (timeout)); EV_ACQUIRE_CB; if (ecb_expect_false (res < 0)) { if (errno == EBADF) fd_ebadf (EV_A); else if (errno == ENOMEM && !syserr_cb) fd_enomem (EV_A); else if (errno != EINTR) ev_syserr ("(libev) poll"); } else for (p = polls; res; ++p) { assert (("libev: poll returned illegal result, broken BSD kernel?", p < polls + pollcnt)); if (ecb_expect_false (p->revents)) /* this expect is debatable */ { --res; if (ecb_expect_false (p->revents & POLLNVAL)) { assert (("libev: poll found invalid fd in poll set", 0)); fd_kill (EV_A_ p->fd); } else fd_event ( EV_A_ p->fd, (p->revents & (POLLOUT | POLLERR | POLLHUP) ? EV_WRITE : 0) | (p->revents & (POLLIN | POLLERR | POLLHUP) ? EV_READ : 0) ); } } } inline_size int poll_init (EV_P_ int flags) { backend_mintime = EV_TS_CONST (1e-3); backend_modify = poll_modify; backend_poll = poll_poll; pollidxs = 0; pollidxmax = 0; polls = 0; pollmax = 0; pollcnt = 0; return EVBACKEND_POLL; } inline_size void poll_destroy (EV_P) { ev_free (pollidxs); ev_free (polls); } audit-4.0.2/src/auditd-event.c0000644001034500103450000012671014655201403011637 /* auditd-event.c -- * Copyright 2004-08,2011,2013,2015-16,2018,2021 Red Hat Inc. * All Rights Reserved. * * 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 * * Authors: * Steve Grubb * */ #include "config.h" #include #include #include #include #include /* O_NOFOLLOW needs gnu defined */ #include #include #include #include #include #include #include /* POSIX_HOST_NAME_MAX */ #include /* toupper */ #include /* dirname */ #ifdef HAVE_ATOMIC #include #endif #include "auditd-event.h" #include "auditd-dispatch.h" #include "auditd-listen.h" #include "libaudit.h" #include "private.h" #include "auparse.h" #include "auparse-idata.h" /* This is defined in auditd.c */ extern volatile ATOMIC_INT stop; /* Local function prototypes */ static void send_ack(const struct auditd_event *e, int ack_type, const char *msg); static void write_to_log(const struct auditd_event *e); static void check_log_file_size(void); static void check_space_left(void); static void do_space_left_action(int admin); static void do_disk_full_action(void); static void do_disk_error_action(const char *func, int err); static void fix_disk_permissions(void); static void check_excess_logs(void); static void rotate_logs_now(void); static void rotate_logs(unsigned int num_logs, unsigned int keep_logs); static void shift_logs(void); static int open_audit_log(void); static void change_runlevel(const char *level); static void safe_exec(const char *exe); static void reconfigure(struct auditd_event *e); static void init_flush_thread(void); /* Local Data */ static struct daemon_conf *config; static volatile int log_fd; static FILE *log_file = NULL; static unsigned int disk_err_warning = 0; static int fs_space_warning = 0; static int fs_admin_space_warning = 0; static int fs_space_left = 1; static int logging_suspended = 0; static unsigned int known_logs = 0; static const char *SINGLE = "1"; static const char *HALT = "0"; static char *format_buf = NULL; static off_t log_size = 0; static pthread_t flush_thread; static pthread_mutex_t flush_lock; static pthread_cond_t do_flush; static volatile int flush; static auparse_state_t *au = NULL; /* Local definitions */ #define FORMAT_BUF_LEN (MAX_AUDIT_MESSAGE_LENGTH + _POSIX_HOST_NAME_MAX) #define MIN_SPACE_LEFT 24 static inline int from_network(const struct auditd_event *e) { if (e && e->ack_func) return 1; return 0; } int dispatch_network_events(void) { return config->distribute_network_events; } void write_logging_state(FILE *f) { fprintf(f, "writing to logs = %s\n", config->write_logs ? "yes" : "no"); if (config->daemonize == D_BACKGROUND && config->write_logs) { int rc; struct statfs buf; fprintf(f, "current log size = %llu KB\n", (long long unsigned)log_size/1024); fprintf(f, "max log size = %lu KB\n", config->max_log_size * (MEGABYTE/1024)); fprintf(f,"logs detected last rotate/shift = %u\n", known_logs); fprintf(f, "space left on partition = %s\n", fs_space_left ? "yes" : "no"); rc = fstatfs(log_fd, &buf); if (rc == 0) { fprintf(f, "Logging partition free space = %llu MB\n", (long long unsigned) (buf.f_bavail * buf.f_bsize)/MEGABYTE); fprintf(f, "space_left setting = %lu MB\n", config->space_left); fprintf(f, "admin_space_left setting = %lu MB\n", config->admin_space_left); } fprintf(f, "logging suspended = %s\n", logging_suspended ? "yes" : "no"); fprintf(f, "file system space action performed = %s\n", fs_space_warning ? "yes" : "no"); fprintf(f, "admin space action performed = %s\n", fs_admin_space_warning ? "yes" : "no"); fprintf(f, "disk error detected = %s\n", disk_err_warning ? "yes" : "no"); } } void shutdown_events(void) { // We are no longer processing events, sync the disk and close up. pthread_cancel(flush_thread); free((void *)format_buf); auparse_destroy_ext(au, AUPARSE_DESTROY_ALL); if (log_fd >= 0) fsync(log_fd); if (log_file) fclose(log_file); } int init_event(struct daemon_conf *conf) { /* Store the netlink descriptor and config info away */ config = conf; log_fd = -1; /* Now open the log */ if (config->daemonize == D_BACKGROUND) { fix_disk_permissions(); if (open_audit_log()) return 1; setup_percentages(config, log_fd); } else { log_fd = 1; // stdout log_file = fdopen(log_fd, "a"); if (log_file == NULL) { audit_msg(LOG_ERR, "Error setting up stdout descriptor (%s)", strerror(errno)); return 1; } /* Set it to line buffering */ setlinebuf(log_file); } if (config->daemonize == D_BACKGROUND) { check_log_file_size(); check_excess_logs(); check_space_left(); } format_buf = (char *)malloc(FORMAT_BUF_LEN); if (format_buf == NULL) { audit_msg(LOG_ERR, "No memory for formatting, exiting"); if (log_file) fclose(log_file); log_file = NULL; return 1; } init_flush_thread(); return 0; } /* This tells the OS that pending writes need to get going. * Its only used when flush == incremental_async. */ static void *flush_thread_main(void *arg) { sigset_t sigs; /* This is a worker thread. Don't handle signals. */ sigemptyset(&sigs); sigaddset(&sigs, SIGTERM); sigaddset(&sigs, SIGHUP); sigaddset(&sigs, SIGUSR1); sigaddset(&sigs, SIGUSR2); sigaddset(&sigs, SIGCHLD); sigaddset(&sigs, SIGCONT); pthread_sigmask(SIG_SETMASK, &sigs, NULL); while (!stop) { pthread_mutex_lock(&flush_lock); // In the event that the logging thread requests another // flush before the first completes, this simply turns // into a loop of fsyncs. while (flush == 0) { pthread_cond_wait(&do_flush, &flush_lock); if (stop) { pthread_mutex_unlock(&flush_lock); return NULL; } } flush = 0; pthread_mutex_unlock(&flush_lock); if (log_fd >= 0) fsync(log_fd); } return NULL; } /* We setup the flush thread no matter what. This is incase a reconfig * changes from non incremental to incremental or vice versa. */ static void init_flush_thread(void) { pthread_mutex_init(&flush_lock, NULL); pthread_cond_init(&do_flush, NULL); flush = 0; pthread_create(&flush_thread, NULL, flush_thread_main, NULL); pthread_detach(flush_thread); } static void replace_event_msg(struct auditd_event *e, const char *buf) { if (buf) { size_t len = strlen(buf); if (len < MAX_AUDIT_MESSAGE_LENGTH - 1) e->reply.message = strdup(buf); else { // If too big, we must truncate the event due to API e->reply.message = strndup(buf, MAX_AUDIT_MESSAGE_LENGTH-1); len = MAX_AUDIT_MESSAGE_LENGTH; } // For network originating events, len should be used if (!from_network(e)) // V1 protocol msg size e->reply.msg.nlh.nlmsg_len = e->reply.len; e->reply.len = len; // V2 protocol msg size } } /* * This function will take an audit structure and return a * text buffer that's formatted for writing to disk. If there * is an error the return value is NULL. */ static const char *format_raw(const struct audit_reply *rep) { char *ptr; if (rep == NULL) { if (config->node_name_format != N_NONE) snprintf(format_buf, FORMAT_BUF_LEN - 32, "node=%s type=DAEMON_ERR op=format-raw msg=NULL res=failed", config->node_name); else snprintf(format_buf, MAX_AUDIT_MESSAGE_LENGTH, "type=DAEMON_ERR op=format-raw msg=NULL res=failed"); } else { int len, nlen; const char *type, *message; char unknown[32]; type = audit_msg_type_to_name(rep->type); if (type == NULL) { snprintf(unknown, sizeof(unknown), "UNKNOWN[%d]", rep->type); type = unknown; } if (rep->message == NULL) { message = "lost"; len = 4; } else { message = rep->message; len = rep->len; } // Note: This can truncate messages if // MAX_AUDIT_MESSAGE_LENGTH is too small if (config->node_name_format != N_NONE) nlen = snprintf(format_buf, FORMAT_BUF_LEN - 32, "node=%s type=%s msg=%.*s\n", config->node_name, type, len, message); else nlen = snprintf(format_buf, MAX_AUDIT_MESSAGE_LENGTH - 32, "type=%s msg=%.*s", type, len, message); /* Replace \n with space so it looks nicer. */ ptr = format_buf; while ((ptr = strchr(ptr, 0x0A)) != NULL) *ptr = ' '; /* Trim trailing space off since it wastes space */ if (format_buf[nlen-1] == ' ') format_buf[nlen-1] = 0; } return format_buf; } static int sep_done = 0; static int add_separator(unsigned int len_left) { if (sep_done == 0) { format_buf[FORMAT_BUF_LEN - len_left] = AUDIT_INTERP_SEPARATOR; sep_done++; return 1; } sep_done++; return 0; } // returns length used, 0 on error #define NAME_SIZE 64 static int add_simple_field(auparse_state_t *au, size_t len_left, int encode) { const char *value, *nptr; char *enc = NULL; char *ptr, field_name[NAME_SIZE]; size_t nlen, vlen, tlen; unsigned int i; int num; // prepare field name i = 0; nptr = auparse_get_field_name(au); while (*nptr && i < (NAME_SIZE - 1)) { field_name[i] = toupper(*nptr); i++; nptr++; } field_name[i] = 0; nlen = i; // get the translated value value = auparse_interpret_field(au); if (value == NULL) value = "?"; vlen = strlen(value); if (encode) { enc = audit_encode_nv_string(field_name, value, vlen); if (enc == NULL) return 0; tlen = 1 + strlen(enc) + 1; } else // calculate length to use tlen = 1 + nlen + 1 + vlen + 1; // If no room, do not truncate - just do nothing if (tlen >= len_left) { free(enc); return 0; } // Setup pointer ptr = &format_buf[FORMAT_BUF_LEN - len_left]; if (sep_done > 1) { *ptr = ' '; ptr++; num = 1; } else num = 0; // Add the field if (encode) { num += snprintf(ptr, tlen, "%s", enc); free(enc); } else num += snprintf(ptr, tlen, "%s=%s", field_name, value); return num; } /* * This function will take an audit structure and return a * text buffer that's formatted and enriched. If there is an * error the return value is NULL. */ static const char *format_enrich(const struct audit_reply *rep) { if (rep == NULL) { if (config->node_name_format != N_NONE) snprintf(format_buf, FORMAT_BUF_LEN - 32, "node=%s type=DAEMON_ERR op=format-enriched msg=NULL res=failed", config->node_name); else snprintf(format_buf, MAX_AUDIT_MESSAGE_LENGTH, "type=DAEMON_ERR op=format-enriched msg=NULL res=failed"); } else { int rc, rtype; size_t mlen, len; char *message; // Do raw format to get event started format_raw(rep); // How much room is left? mlen = strlen(format_buf); len = FORMAT_BUF_LEN - mlen; if (len <= MIN_SPACE_LEFT) return format_buf; // create copy to parse up format_buf[mlen] = 0x0A; format_buf[mlen+1] = 0; message = strdup(format_buf); format_buf[mlen] = 0; // init auparse if (au == NULL) { au = auparse_init(AUSOURCE_BUFFER, message); if (au == NULL) { free(message); return format_buf; } auparse_set_escape_mode(au, AUPARSE_ESC_RAW); auparse_set_eoe_timeout(config->end_of_event_timeout); } else auparse_new_buffer(au, message, mlen+1); sep_done = 0; // Loop over all fields while possible to add field rc = auparse_first_record(au); rtype = auparse_get_type(au); switch (rtype) { // Flush before adding to pickup new associations case AUDIT_ADD_USER: case AUDIT_ADD_GROUP: _auparse_flush_caches(); break; default: break; } while (rc > 0 && len > MIN_SPACE_LEFT) { // See what kind of field we have size_t vlen; int type = auparse_get_field_type(au); switch (type) { case AUPARSE_TYPE_UID: case AUPARSE_TYPE_GID: if (add_separator(len)) len--; vlen = add_simple_field(au, len, 1); len -= vlen; break; case AUPARSE_TYPE_SYSCALL: case AUPARSE_TYPE_ARCH: case AUPARSE_TYPE_SOCKADDR: if (add_separator(len)) len--; vlen = add_simple_field(au, len, 0); len -= vlen; break; default: break; } rc = auparse_next_field(au); } switch(rtype) { // Flush after modification to remove stale entries case AUDIT_USER_MGMT: case AUDIT_DEL_USER: case AUDIT_DEL_GROUP: case AUDIT_GRP_MGMT: _auparse_flush_caches(); break; default: break; } free(message); } return format_buf; } void format_event(struct auditd_event *e) { const char *buf; switch (config->log_format) { case LF_RAW: buf = format_raw(&e->reply); break; case LF_ENRICHED: buf = format_enrich(&e->reply); break; default: buf = NULL; break; } replace_event_msg(e, buf); } /* This function free's all memory associated with events */ void cleanup_event(struct auditd_event *e) { // Over in send_audit_event we sometimes have message pointing // into the middle of the reply allocation. Check for it. if (e->reply.message != e->reply.msg.data) free((void *)e->reply.message); free(e); } /* This function takes a reconfig event and sends it to the handler */ void enqueue_event(struct auditd_event *e) { e->ack_func = NULL; e->ack_data = NULL; e->sequence_id = 0; handle_event(e); cleanup_event(e); } /* This function allocates memory and fills the event fields with passed arguments. Caller must free memory. */ struct auditd_event *create_event(const char *msg, ack_func_type ack_func, void *ack_data, uint32_t sequence_id) { struct auditd_event *e; e = (struct auditd_event *)calloc(1, sizeof (*e)); if (e == NULL) { audit_msg(LOG_ERR, "Cannot allocate audit reply"); return NULL; } e->ack_func = ack_func; e->ack_data = ack_data; e->sequence_id = sequence_id; /* Network originating events need things adjusted to mimic netlink. */ if (from_network(e)) replace_event_msg(e, msg); return e; } /* This function takes the event and handles it. */ static unsigned int count = 0L; void handle_event(struct auditd_event *e) { if (e->reply.type == AUDIT_DAEMON_RECONFIG && e->ack_func == NULL) { reconfigure(e); if (config->write_logs == 0 && config->daemonize == D_BACKGROUND) return; format_event(e); } else if (e->reply.type == AUDIT_DAEMON_ROTATE) { rotate_logs_now(); if (config->write_logs == 0 && config->daemonize == D_BACKGROUND) return; } if (!logging_suspended && (config->write_logs || config->daemonize == D_FOREGROUND)) { write_to_log(e); /* See if we need to flush to disk manually */ if (config->flush == FT_INCREMENTAL || config->flush == FT_INCREMENTAL_ASYNC) { count++; if ((count % config->freq) == 0) { int rc; errno = 0; do { rc = fflush_unlocked(log_file); } while (rc < 0 && errno == EINTR); if (errno) { if (errno == ENOSPC && fs_space_left == 1) { fs_space_left = 0; do_disk_full_action(); } else //EIO is only likely failure mode do_disk_error_action("flush", errno); } if (config->daemonize == D_BACKGROUND) { if (config->flush == FT_INCREMENTAL) { /* EIO is only likely failure */ if (log_fd >= 0 && fsync(log_fd) != 0) { do_disk_error_action( "fsync", errno); } } else { pthread_mutex_lock(&flush_lock); flush = 1; pthread_cond_signal(&do_flush); pthread_mutex_unlock( &flush_lock); } } } } } else if (!config->write_logs && config->daemonize == D_BACKGROUND) send_ack(e, AUDIT_RMW_TYPE_ACK, ""); else if (logging_suspended) send_ack(e,AUDIT_RMW_TYPE_DISKERROR,"remote logging suspended"); } static void send_ack(const struct auditd_event *e, int ack_type, const char *msg) { if (from_network(e)) { unsigned char header[AUDIT_RMW_HEADER_SIZE]; AUDIT_RMW_PACK_HEADER(header, 0, ack_type, strlen(msg), e->sequence_id); e->ack_func(e->ack_data, header, msg); } } void resume_logging(void) { audit_msg(LOG_NOTICE, "Audit daemon is attempting to resume logging."); logging_suspended = 0; fs_space_left = 1; // User space action scripts cause fd to close // Need to reopen here to recreate the file if the // script deleted or moved it. if (log_file == NULL) { fix_disk_permissions(); if (open_audit_log()) { int saved_errno = errno; audit_msg(LOG_WARNING, "Could not reopen a log after resume logging"); logging_suspended = 1; do_disk_error_action("resume", saved_errno); } else check_log_file_size(); audit_msg(LOG_NOTICE, "Audit daemon resumed logging."); } disk_err_warning = 0; fs_space_warning = 0; fs_admin_space_warning = 0; } /* This function writes the given buf to the current log file */ static void write_to_log(const struct auditd_event *e) { int rc; int ack_type = AUDIT_RMW_TYPE_ACK; const char *msg = ""; /* write it to disk */ rc = fprintf(log_file, "%s\n", e->reply.message); /* error? Handle it */ if (rc < 0) { if (errno == ENOSPC) { ack_type = AUDIT_RMW_TYPE_DISKFULL; msg = "disk full"; send_ack(e, ack_type, msg); if (fs_space_left == 1) { fs_space_left = 0; do_disk_full_action(); } } else { int saved_errno = errno; ack_type = AUDIT_RMW_TYPE_DISKERROR; msg = "disk write error"; send_ack(e, ack_type, msg); do_disk_error_action("write", saved_errno); } } else { /* check log file size & space left on partition */ if (config->daemonize == D_BACKGROUND) { // If either of these fail, I consider it an // inconvenience as opposed to something that is // actionable. There may be some temporary condition // that the system recovers from. The real error // occurs on write. log_size += rc; check_log_file_size(); // Keep loose tabs on the free space if ((log_size % 8) < 3) check_space_left(); } if (fs_space_warning) ack_type = AUDIT_RMW_TYPE_DISKLOW; send_ack(e, ack_type, msg); disk_err_warning = 0; } } static void check_log_file_size(void) { /* did we cross the size limit? */ off_t sz = log_size / MEGABYTE; if (config->write_logs == 0) return; if (sz >= config->max_log_size && (config->daemonize == D_BACKGROUND)) { switch (config->max_log_size_action) { case SZ_IGNORE: break; case SZ_SYSLOG: audit_msg(LOG_ERR, "Audit daemon log file is larger than max size"); break; case SZ_SUSPEND: audit_msg(LOG_ERR, "Audit daemon is suspending logging due to logfile size."); // We need to close the file so that manual // intervention can move or delete the file. // We don't want to keep logging to a deleted // file. if (log_file) fclose(log_file); log_file = NULL; log_fd = -1; logging_suspended = 1; break; case SZ_ROTATE: if (config->num_logs > 1) { audit_msg(LOG_NOTICE, "Audit daemon rotating log files"); rotate_logs(0, 0); } break; case SZ_KEEP_LOGS: audit_msg(LOG_NOTICE, "Audit daemon rotating log files with keep option"); shift_logs(); break; default: audit_msg(LOG_ALERT, "Audit daemon log file is larger than max size and unknown action requested"); break; } } } static void check_space_left(void) { int rc; struct statfs buf; if (log_fd < 0) return; rc = fstatfs(log_fd, &buf); if (rc == 0) { if (buf.f_bavail < 5) { /* we won't consume the last 5 blocks */ fs_space_left = 0; do_disk_full_action(); } else { unsigned long blocks; unsigned long block_size = buf.f_bsize; blocks = config->space_left * (MEGABYTE/block_size); if (buf.f_bavail < blocks) { if (fs_space_warning == 0) { do_space_left_action(0); // Allow unlimited rotation if (config->space_left_action != FA_ROTATE) fs_space_warning = 1; } } else if (fs_space_warning && config->space_left_action == FA_SYSLOG){ // Auto reset only if failure action is syslog fs_space_warning = 0; } blocks=config->admin_space_left * (MEGABYTE/block_size); if (buf.f_bavail < blocks) { if (fs_admin_space_warning == 0) { do_space_left_action(1); // Allow unlimited rotation if (config->admin_space_left_action != FA_ROTATE) fs_admin_space_warning = 1; } } else if (fs_admin_space_warning && config->admin_space_left_action == FA_SYSLOG) { // Auto reset only if failure action is syslog fs_admin_space_warning = 0; } } } else audit_msg(LOG_DEBUG, "fstatfs returned:%d, %s", rc, strerror(errno)); } extern int sendmail(const char *subject, const char *content, const char *mail_acct); static void do_space_left_action(int admin) { int action; if (admin) action = config->admin_space_left_action; else action = config->space_left_action; switch (action) { case FA_IGNORE: break; case FA_SYSLOG: audit_msg(LOG_ALERT, "Audit daemon is low on disk space for logging"); break; case FA_ROTATE: if (config->num_logs > 1) { audit_msg(LOG_NOTICE, "Audit daemon rotating log files"); rotate_logs(0, 0); } break; case FA_EMAIL: if (admin == 0) { sendmail("Audit Disk Space Alert", "The audit daemon is low on disk space for logging! Please take action\nto ensure no loss of service.", config->action_mail_acct); audit_msg(LOG_ALERT, "Audit daemon is low on disk space for logging"); } else { sendmail("Audit Admin Space Alert", "The audit daemon is very low on disk space for logging! Immediate action\nis required to ensure no loss of service.", config->action_mail_acct); audit_msg(LOG_ALERT, "Audit daemon is very low on disk space for logging"); } break; case FA_EXEC: // Close the logging file in case the script zips or // moves the file. We'll reopen in sigusr2 handler if (log_file) fclose(log_file); log_file = NULL; log_fd = -1; logging_suspended = 1; if (admin) safe_exec(config->admin_space_left_exe); else safe_exec(config->space_left_exe); break; case FA_SUSPEND: audit_msg(LOG_ALERT, "Audit daemon is suspending logging due to low disk space."); // We need to close the file so that manual // intervention can move or delete the file. We // don't want to keep logging to a deleted file. if (log_file) fclose(log_file); log_file = NULL; log_fd = -1; logging_suspended = 1; break; case FA_SINGLE: audit_msg(LOG_ALERT, "The audit daemon is now changing the system to single user mode and exiting due to low disk space"); change_runlevel(SINGLE); stop = 1; break; case FA_HALT: audit_msg(LOG_ALERT, "The audit daemon is now halting the system and exiting due to low disk space"); change_runlevel(HALT); stop = 1; break; default: audit_msg(LOG_ALERT, "Audit daemon is low on disk space for logging and unknown action requested"); break; } } static void do_disk_full_action(void) { audit_msg(LOG_ALERT, "Audit daemon has no space left on logging partition"); switch (config->disk_full_action) { case FA_IGNORE: case FA_SYSLOG: /* Message is syslogged above */ break; case FA_ROTATE: if (config->num_logs > 1) { audit_msg(LOG_NOTICE, "Audit daemon rotating log files"); rotate_logs(0, 0); } break; case FA_EXEC: // Close the logging file in case the script zips or // moves the file. We'll reopen in sigusr2 handler if (log_file) fclose(log_file); log_file = NULL; log_fd = -1; logging_suspended = 1; safe_exec(config->disk_full_exe); break; case FA_SUSPEND: audit_msg(LOG_ALERT, "Audit daemon is suspending logging due to no space left on logging partition."); // We need to close the file so that manual // intervention can move or delete the file. We // don't want to keep logging to a deleted file. if (log_file) fclose(log_file); log_file = NULL; log_fd = -1; logging_suspended = 1; break; case FA_SINGLE: audit_msg(LOG_ALERT, "The audit daemon is now changing the system to single user mode and exiting due to no space left on logging partition"); change_runlevel(SINGLE); stop = 1; break; case FA_HALT: audit_msg(LOG_ALERT, "The audit daemon is now halting the system and exiting due to no space left on logging partition"); change_runlevel(HALT); stop = 1; break; default: audit_msg(LOG_ALERT, "Unknown disk full action requested"); break; } } static void do_disk_error_action(const char *func, int err) { char text[128]; switch (config->disk_error_action) { case FA_IGNORE: break; case FA_SYSLOG: if (disk_err_warning < 5) { snprintf(text, sizeof(text), "%s: Audit daemon detected an error writing an event to disk (%s)", func, strerror(err)); audit_msg(LOG_ALERT, "%s", text); disk_err_warning++; } break; case FA_EXEC: // Close the logging file in case the script zips or // moves the file. We'll reopen in sigusr2 handler if (log_file) fclose(log_file); log_file = NULL; log_fd = -1; logging_suspended = 1; safe_exec(config->disk_error_exe); break; case FA_SUSPEND: audit_msg(LOG_ALERT, "Audit daemon is suspending logging due to previously mentioned write error"); // We need to close the file so that manual // intervention can move or delete the file. We // don't want to keep logging to a deleted file. if (log_file) fclose(log_file); log_file = NULL; log_fd = -1; logging_suspended = 1; break; case FA_SINGLE: audit_msg(LOG_ALERT, "The audit daemon is now changing the system to single user mode and exiting due to previously mentioned write error"); change_runlevel(SINGLE); stop = 1; break; case FA_HALT: audit_msg(LOG_ALERT, "The audit daemon is now halting the system and exiting due to previously mentioned write error."); change_runlevel(HALT); stop = 1; break; default: audit_msg(LOG_ALERT, "Unknown disk error action requested"); break; } } static void rotate_logs_now(void) { /* Don't rotate in debug mode */ if (config->daemonize == D_FOREGROUND) return; if (config->max_log_size_action == SZ_KEEP_LOGS) shift_logs(); else rotate_logs(0, 0); } /* Check for and remove excess logs so that we don't run out of room */ static void check_excess_logs(void) { int rc; unsigned int i, len; char *name; // Only do this if rotate is the log size action // and we actually have a limit if (config->max_log_size_action != SZ_ROTATE || config->num_logs < 2) return; len = strlen(config->log_file) + 16; name = (char *)malloc(len); if (name == NULL) { /* Not fatal - just messy */ audit_msg(LOG_ERR, "No memory checking excess logs"); return; } // We want 1 beyond the normal logs i = config->num_logs; rc = 0; while (rc == 0) { snprintf(name, len, "%s.%u", config->log_file, i++); rc=unlink(name); if (rc == 0) audit_msg(LOG_NOTICE, "Log %s removed as it exceeds num_logs parameter", name); } free(name); } static void fix_disk_permissions(void) { char *path, *dir; unsigned int i, len; if (config == NULL || config->log_file == NULL) return; len = strlen(config->log_file) + 16; path = malloc(len); if (path == NULL) return; // Start with the directory strcpy(path, config->log_file); dir = dirname(path); if (chmod(dir,config->log_group ? S_IRWXU|S_IRGRP|S_IXGRP: S_IRWXU) < 0) audit_msg(LOG_WARNING, "Couldn't change access mode of " "%s (%s)", dir, strerror(errno)); if (chown(dir, 0, config->log_group ? config->log_group : 0) < 0) audit_msg(LOG_WARNING, "Couldn't change ownership of " "%s (%s)", dir, strerror(errno)); // Now, for each file... for (i = 1; i < config->num_logs; i++) { int rc; snprintf(path, len, "%s.%u", config->log_file, i); rc = chmod(path, config->log_group ? S_IRUSR|S_IRGRP : S_IRUSR); if (rc && errno == ENOENT) break; } // Now the current file chmod(config->log_file, config->log_group ? S_IWUSR|S_IRUSR|S_IRGRP : S_IWUSR|S_IRUSR); free(path); } static void rotate_logs(unsigned int num_logs, unsigned int keep_logs) { int rc, i; unsigned int len; char *oldname, *newname; /* Check that log rotation is enabled in the configuration file. There * is no need to check for max_log_size_action == SZ_ROTATE because * this could be invoked externally by receiving a USR1 signal, * independently on the action parameter. */ if (config->num_logs < 2 && !keep_logs){ audit_msg(LOG_NOTICE, "Log rotation disabled (num_logs < 2), skipping"); return; } /* Close audit file. fchmod and fchown errors are not fatal because we * already adjusted log file permissions and ownership when opening the * log file. */ if (log_fd >= 0) { if (fchmod(log_fd, config->log_group ? S_IRUSR|S_IRGRP : S_IRUSR) < 0){ audit_msg(LOG_WARNING, "Couldn't change permissions while " "rotating log file (%s)", strerror(errno)); } if (fchown(log_fd, 0, config->log_group) < 0) { audit_msg(LOG_WARNING, "Couldn't change ownership while " "rotating log file (%s)", strerror(errno)); } } if (log_file) { log_fd = -1; fclose(log_file); log_file = NULL; } /* Rotate */ len = strlen(config->log_file) + 16; oldname = (char *)malloc(len); if (oldname == NULL) { /* Not fatal - just messy */ audit_msg(LOG_ERR, "No memory rotating logs"); logging_suspended = 1; return; } newname = (char *)malloc(len); if (newname == NULL) { /* Not fatal - just messy */ audit_msg(LOG_ERR, "No memory rotating logs"); free(oldname); logging_suspended = 1; return; } /* If we are rotating, get number from config */ if (num_logs == 0) num_logs = config->num_logs; /* Handle this case first since it will not enter the for loop */ if (num_logs == 2) snprintf(oldname, len, "%s.1", config->log_file); known_logs = 0; for (i=(int)num_logs - 1; i>1; i--) { snprintf(oldname, len, "%s.%d", config->log_file, i-1); snprintf(newname, len, "%s.%d", config->log_file, i); /* if the old file exists */ rc = rename(oldname, newname); if (rc == -1 && errno != ENOENT) { // Likely errors: ENOSPC, ENOMEM, EBUSY int saved_errno = errno; audit_msg(LOG_ERR, "Error rotating logs from %s to %s (%s)", oldname, newname, strerror(errno)); if (saved_errno == ENOSPC && fs_space_left == 1) { fs_space_left = 0; do_disk_full_action(); } else do_disk_error_action("rotate", saved_errno); } else if (rc == 0 && known_logs == 0) known_logs = i + 1; } free(newname); /* At this point, oldname should point to lowest number - use it */ newname = oldname; rc = rename(config->log_file, newname); if (rc == -1 && errno != ENOENT) { // Likely errors: ENOSPC, ENOMEM, EBUSY int saved_errno = errno; audit_msg(LOG_ERR, "Error rotating logs from %s to %s (%s)", config->log_file, newname, strerror(errno)); if (saved_errno == ENOSPC && fs_space_left == 1) { fs_space_left = 0; do_disk_full_action(); } else do_disk_error_action("rotate2", saved_errno); /* At this point, we've failed to rotate the original log. * So, let's make the old log writable and try again next * time */ chmod(config->log_file, config->log_group ? S_IWUSR|S_IRUSR|S_IRGRP : S_IWUSR|S_IRUSR); } free(newname); /* open new audit file */ if (open_audit_log()) { int saved_errno = errno; audit_msg(LOG_CRIT, "Could not reopen a log after rotating."); logging_suspended = 1; do_disk_error_action("reopen", saved_errno); } } static unsigned int last_log = 1; static void shift_logs(void) { // The way this has to work is to start scanning from .1 up until // no file is found. Then do the rotate algorithm using that number // instead of log_max. unsigned int num_logs, len; char *name; len = strlen(config->log_file) + 16; name = (char *)malloc(len); if (name == NULL) { /* Not fatal - just messy */ audit_msg(LOG_ERR, "No memory shifting logs"); return; } // Find last log num_logs = last_log; while (num_logs) { snprintf(name, len, "%s.%u", config->log_file, num_logs); if (access(name, R_OK) != 0) break; num_logs++; } known_logs = num_logs; /* Our last known file disappeared, start over... */ if (num_logs <= last_log && last_log > 1) { audit_msg(LOG_WARNING, "Last known log disappeared (%s)", name); num_logs = last_log = 1; while (num_logs) { snprintf(name, len, "%s.%u", config->log_file, num_logs); if (access(name, R_OK) != 0) break; num_logs++; } audit_msg(LOG_INFO, "Next log to use will be %s", name); } last_log = num_logs; rotate_logs(num_logs+1, 1); free(name); } /* * This function handles opening a descriptor for the audit log * file and ensuring the correct options are applied to the descriptor. * It returns 0 on success and 1 on failure. */ static int open_audit_log(void) { int flags, lfd; if (config->write_logs == 0) return 0; flags = O_WRONLY|O_APPEND|O_NOFOLLOW|O_CLOEXEC; if (config->flush == FT_DATA) flags |= O_DSYNC; else if (config->flush == FT_SYNC) flags |= O_SYNC; // Likely errors for open: Almost anything // Likely errors on rotate: ENFILE, ENOMEM, ENOSPC retry: lfd = open(config->log_file, flags); if (lfd < 0) { if (errno == ENOENT) { lfd = create_log_file(config->log_file); if (lfd < 0) { audit_msg(LOG_CRIT, "Couldn't create log file %s (%s)", config->log_file, strerror(errno)); return 1; } close(lfd); lfd = open(config->log_file, flags); log_size = 0; } else if (errno == ENFILE) { // All system descriptors used, try again... goto retry; } if (lfd < 0) { audit_msg(LOG_CRIT, "Couldn't open log file %s (%s)", config->log_file, strerror(errno)); return 1; } } else { // Get initial size struct stat st; int rc = fstat(lfd, &st); if (rc == 0) log_size = st.st_size; else { close(lfd); return 1; } } if (fchmod(lfd, config->log_group ? S_IRUSR|S_IWUSR|S_IRGRP : S_IRUSR|S_IWUSR) < 0) { audit_msg(LOG_ERR, "Couldn't change permissions of log file (%s)", strerror(errno)); close(lfd); return 1; } if (fchown(lfd, 0, config->log_group) < 0) { audit_msg(LOG_ERR, "Couldn't change ownership of log file (%s)", strerror(errno)); close(lfd); return 1; } log_fd = lfd; log_file = fdopen(lfd, "a"); if (log_file == NULL) { audit_msg(LOG_CRIT, "Error setting up log descriptor (%s)", strerror(errno)); close(lfd); return 1; } /* Set it to line buffering */ setlinebuf(log_file); return 0; } static void change_runlevel(const char *level) { char *argv[3]; int pid; struct sigaction sa; static const char *init_pgm = "/sbin/init"; pid = fork(); if (pid < 0) { audit_msg(LOG_ALERT, "Audit daemon failed to fork switching runlevels"); return; } if (pid) /* Parent */ return; /* Child */ sigfillset (&sa.sa_mask); sigprocmask (SIG_UNBLOCK, &sa.sa_mask, 0); argv[0] = (char *)init_pgm; argv[1] = (char *)level; argv[2] = NULL; execve(init_pgm, argv, NULL); audit_msg(LOG_ALERT, "Audit daemon failed to exec %s", init_pgm); exit(1); } static void safe_exec(const char *exe) { char *argv[2]; int pid; struct sigaction sa; if (exe == NULL) { audit_msg(LOG_ALERT, "Safe_exec passed NULL for program to execute"); return; } pid = fork(); if (pid < 0) { audit_msg(LOG_ALERT, "Audit daemon failed to fork doing safe_exec"); return; } if (pid) /* Parent */ return; /* Child */ sigfillset (&sa.sa_mask); sigprocmask (SIG_UNBLOCK, &sa.sa_mask, 0); argv[0] = (char *)exe; argv[1] = NULL; execve(exe, argv, NULL); audit_msg(LOG_ALERT, "Audit daemon failed to exec %s", exe); exit(1); } static void reconfigure(struct auditd_event *e) { struct daemon_conf *nconf = e->reply.conf; struct daemon_conf *oconf = config; uid_t uid = nconf->sender_uid; pid_t pid = nconf->sender_pid; const char *ctx = nconf->sender_ctx; struct timeval tv; char txt[MAX_AUDIT_MESSAGE_LENGTH]; char date[40]; unsigned int seq_num; int need_size_check = 0, need_reopen = 0, need_space_check = 0; snprintf(txt, sizeof(txt), "config change requested by pid=%d auid=%u subj=%s", pid, uid, ctx); audit_msg(LOG_NOTICE, "%s", txt); /* Do the reconfiguring. These are done in a specific * order from least invasive to most invasive. We will * start with general system parameters. */ // start with disk error action. oconf->disk_error_action = nconf->disk_error_action; free((char *)oconf->disk_error_exe); oconf->disk_error_exe = nconf->disk_error_exe; disk_err_warning = 0; // number of logs oconf->num_logs = nconf->num_logs; // flush freq oconf->freq = nconf->freq; // priority boost if (oconf->priority_boost != nconf->priority_boost) { oconf->priority_boost = nconf->priority_boost; errno = 0; if (nice(-oconf->priority_boost)) ; /* Intentionally blank, we have to check errno */ if (errno) audit_msg(LOG_WARNING, "Cannot change priority in " "reconfigure (%s)", strerror(errno)); } // log format oconf->log_format = nconf->log_format; // Only update this if we are in background mode since // foreground mode writes to stderr. if ((oconf->write_logs != nconf->write_logs) && (oconf->daemonize == D_BACKGROUND)) { oconf->write_logs = nconf->write_logs; need_reopen = 1; } // log_group if (oconf->log_group != nconf->log_group) { oconf->log_group = nconf->log_group; need_reopen = 1; } // action_mail_acct if (strcmp(oconf->action_mail_acct, nconf->action_mail_acct)) { free((void *)oconf->action_mail_acct); oconf->action_mail_acct = nconf->action_mail_acct; } else free((void *)nconf->action_mail_acct); // node_name if (oconf->node_name_format != nconf->node_name_format || (oconf->node_name && nconf->node_name && strcmp(oconf->node_name, nconf->node_name) != 0)) { oconf->node_name_format = nconf->node_name_format; free((char *)oconf->node_name); oconf->node_name = nconf->node_name; } // network listener auditd_tcp_listen_reconfigure(nconf, oconf); // distribute network events oconf->distribute_network_events = nconf->distribute_network_events; // Dispatcher items oconf->q_depth = nconf->q_depth; oconf->overflow_action = nconf->overflow_action; oconf->max_restarts = nconf->max_restarts; if (oconf->plugin_dir != nconf->plugin_dir || (oconf->plugin_dir && nconf->plugin_dir && strcmp(oconf->plugin_dir, nconf->plugin_dir) != 0)) { free(oconf->plugin_dir); oconf->plugin_dir = nconf->plugin_dir; } /* At this point we will work on the items that are related to * a single log file. */ // max logfile action if (oconf->max_log_size_action != nconf->max_log_size_action) { oconf->max_log_size_action = nconf->max_log_size_action; need_size_check = 1; } // max log size if (oconf->max_log_size != nconf->max_log_size) { oconf->max_log_size = nconf->max_log_size; need_size_check = 1; } if (need_size_check) { logging_suspended = 0; check_log_file_size(); } // flush technique if (oconf->flush != nconf->flush) { oconf->flush = nconf->flush; need_reopen = 1; } // logfile if (strcmp(oconf->log_file, nconf->log_file)) { free((void *)oconf->log_file); oconf->log_file = nconf->log_file; need_reopen = 1; need_space_check = 1; // might be on new partition } else free((void *)nconf->log_file); if (need_reopen) { if (log_file) fclose(log_file); log_file = NULL; fix_disk_permissions(); if (open_audit_log()) { int saved_errno = errno; audit_msg(LOG_ERR, "Could not reopen a log after reconfigure"); logging_suspended = 1; // Likely errors: ENOMEM, ENOSPC do_disk_error_action("reconfig", saved_errno); } else { logging_suspended = 0; check_log_file_size(); } } /* At this point we will start working on items that are * related to the amount of space on the partition. */ // space left if (oconf->space_left != nconf->space_left) { oconf->space_left = nconf->space_left; need_space_check = 1; } // space left percent if (oconf->space_left_percent != nconf->space_left_percent) { oconf->space_left_percent = nconf->space_left_percent; need_space_check = 1; } // space left action if (oconf->space_left_action != nconf->space_left_action) { oconf->space_left_action = nconf->space_left_action; need_space_check = 1; } // space left exe if (oconf->space_left_exe || nconf->space_left_exe) { if (nconf->space_left_exe == NULL) ; /* do nothing if new one is blank */ else if (oconf->space_left_exe == NULL && nconf->space_left_exe) need_space_check = 1; else if (strcmp(oconf->space_left_exe, nconf->space_left_exe)) need_space_check = 1; free((char *)oconf->space_left_exe); oconf->space_left_exe = nconf->space_left_exe; } // admin space left if (oconf->admin_space_left != nconf->admin_space_left) { oconf->admin_space_left = nconf->admin_space_left; need_space_check = 1; } // admin space left percent if (oconf->admin_space_left_percent != nconf->admin_space_left_percent){ oconf->admin_space_left_percent = nconf->admin_space_left_percent; need_space_check = 1; } // admin space action if (oconf->admin_space_left_action != nconf->admin_space_left_action) { oconf->admin_space_left_action = nconf->admin_space_left_action; need_space_check = 1; } // admin space left exe if (oconf->admin_space_left_exe || nconf->admin_space_left_exe) { if (nconf->admin_space_left_exe == NULL) ; /* do nothing if new one is blank */ else if (oconf->admin_space_left_exe == NULL && nconf->admin_space_left_exe) need_space_check = 1; else if (strcmp(oconf->admin_space_left_exe, nconf->admin_space_left_exe)) need_space_check = 1; free((char *)oconf->admin_space_left_exe); oconf->admin_space_left_exe = nconf->admin_space_left_exe; } // disk full action if (oconf->disk_full_action != nconf->disk_full_action) { oconf->disk_full_action = nconf->disk_full_action; need_space_check = 1; } // disk full exe if (oconf->disk_full_exe || nconf->disk_full_exe) { if (nconf->disk_full_exe == NULL) ; /* do nothing if new one is blank */ else if (oconf->disk_full_exe == NULL && nconf->disk_full_exe) need_space_check = 1; else if (strcmp(oconf->disk_full_exe, nconf->disk_full_exe)) need_space_check = 1; free((char *)oconf->disk_full_exe); oconf->disk_full_exe = nconf->disk_full_exe; } if (need_space_check) { /* note save suspended flag, then do space_left. If suspended * is still 0, then copy saved suspended back. This avoids * having to call check_log_file_size to restore it. */ int saved_suspend = logging_suspended; setup_percentages(oconf, log_fd); fs_space_warning = 0; fs_admin_space_warning = 0; fs_space_left = 1; logging_suspended = 0; check_excess_logs(); check_space_left(); if (logging_suspended == 0) logging_suspended = saved_suspend; } reconfigure_dispatcher(oconf); // Next document the results srand(time(NULL)); seq_num = rand()%10000; if (gettimeofday(&tv, NULL) == 0) { snprintf(date, sizeof(date), "audit(%lld.%03u:%u)", (long long int)tv.tv_sec, (unsigned)(tv.tv_usec/1000), seq_num); } else { snprintf(date, sizeof(date), "audit(%lld.%03d:%u)", (long long int)time(NULL), 0, seq_num); } e->reply.type = AUDIT_DAEMON_CONFIG; e->reply.len = snprintf(e->reply.msg.data, MAX_AUDIT_MESSAGE_LENGTH-2, "%s: op=reconfigure state=changed auid=%u pid=%d subj=%s res=success", date, uid, pid, ctx ); e->reply.message = e->reply.msg.data; free((char *)ctx); } audit-4.0.2/src/ausearch-llist.c0000644001034500103450000001235414655201403012164 /* * ausearch-llist.c - Minimal linked list library * Copyright (c) 2005-2008,2011,2016 Red Hat Inc. * Copyright (c) 2011 IBM Corp. * All Rights Reserved. * * This software may be freely redistributed and/or modified 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, Inc., 51 Franklin Street, Fifth Floor * Boston, MA 02110-1335, USA. * * Authors: * Steve Grubb * Marcelo Henrique Cerri */ #include #include #include "ausearch-llist.h" #include "auditd-config.h" void list_create(llist *l) { l->head = NULL; l->cur = NULL; l->cnt = 0; l->fmt = LF_RAW; l->e.milli = 0L; l->e.sec = 0L; l->e.serial = 0L; l->e.node = NULL; l->e.type = 0; l->s.gid = -1; l->s.egid = -1; l->s.ppid = -1; l->s.pid = -1; l->s.success = S_UNSET; l->s.uid = -1; l->s.euid = -1; l->s.loginuid = -2; l->s.hostname = NULL; l->s.filename = NULL; l->s.terminal = NULL; l->s.cwd = NULL; l->s.exe = NULL; l->s.key = NULL; l->s.comm = NULL; l->s.avc = NULL; l->s.acct = NULL; l->s.arch = 0; l->s.syscall = 0; l->s.session_id = -2; l->s.uuid = NULL; l->s.vmname = NULL; l->s.tuid = NULL; l->s.teuid = NULL; l->s.tauid = NULL; l->s.exit = 0; l->s.exit_is_set = 0; } void list_last(llist *l) { register lnode* node; if (l->head == NULL) return; node = l->head; while (node->next) node = node->next; l->cur = node; } lnode *list_next(llist *l) { if (l->cur == NULL) return NULL; l->cur = l->cur->next; return l->cur; } lnode *list_prev(llist *l) { if (l->cur == NULL) return NULL; if (l->cur->item == 0) return NULL; list_find_item(l, l->cur->item-1); return l->cur; } int list_append(llist *l, lnode *node) { lnode* newnode; newnode = malloc(sizeof(lnode)); if (newnode == NULL) return 1; if (node->message) newnode->message = node->message; else newnode->message = NULL; newnode->interp = node->interp; newnode->mlen = node->mlen; newnode->tlen = node->tlen; newnode->type = node->type; newnode->a0 = node->a0; newnode->a1 = node->a1; newnode->item = l->cnt; newnode->next = NULL; // if we are at top, fix this up if (l->head == NULL) l->head = newnode; else // Otherwise add pointer to newnode l->cur->next = newnode; // make newnode current l->cur = newnode; l->cnt++; return 0; } int list_find_item(llist *l, unsigned int i) { register lnode* node; if (l->cur && (l->cur->item <= i)) node = l->cur; /* Try to use where we are */ else node = l->head; /* Can't, start over */ while (node) { if (node->item == i) { l->cur = node; return 1; } else node = node->next; } return 0; } void list_clear(llist* l) { lnode* nextnode; register lnode* current; current = l->head; while (current) { nextnode=current->next; free(current->message); free(current); current=nextnode; } l->head = NULL; l->cur = NULL; l->cnt = 0; l->e.milli = 0L; l->e.sec = 0L; l->e.serial = 0L; free((char *)l->e.node); l->e.node = NULL; l->e.type = 0; l->s.gid = -1; l->s.egid = -1; l->s.ppid = -1; l->s.pid = -1; l->s.success = S_UNSET; l->s.uid = -1; l->s.euid = -1; l->s.loginuid = -2; free(l->s.hostname); l->s.hostname = NULL; if (l->s.filename) { slist_clear(l->s.filename); free(l->s.filename); l->s.filename = NULL; } free(l->s.terminal); l->s.terminal = NULL; free(l->s.cwd); l->s.cwd = NULL; free(l->s.exe); l->s.exe = NULL; if (l->s.key) { slist_clear(l->s.key); free(l->s.key); l->s.key = NULL; } free(l->s.comm); l->s.comm = NULL; if (l->s.avc) { alist_clear(l->s.avc); free(l->s.avc); l->s.avc = NULL; } free(l->s.acct); l->s.acct = NULL; l->s.arch = 0; l->s.syscall = 0; l->s.session_id = -2; free(l->s.uuid); l->s.uuid = NULL; free(l->s.vmname); l->s.vmname = NULL; free((void *)l->s.tuid); l->s.tuid = NULL; free((void *)l->s.teuid); l->s.teuid = NULL; free((void *)l->s.tauid); l->s.tauid = NULL; l->s.exit = 0; l->s.exit_is_set = 0; } int list_get_event(llist* l, event *e) { if (l == NULL || e == NULL) return 0; e->sec = l->e.sec; e->milli = l->e.milli; e->serial = l->e.serial; return 1; } lnode *list_find_msg(llist *l, int i) { register lnode* node; node = l->head; /* start at the beginning */ while (node) { if (node->type == i) { l->cur = node; return node; } else node = node->next; } return NULL; } lnode *list_find_msg_range(llist *l, int low, int high) { register lnode* node; if (high <= low) return NULL; node = l->head; /* Start at the beginning */ while (node) { if (node->type >= low && node->type <= high) { l->cur = node; return node; } else node = node->next; } return NULL; } audit-4.0.2/src/auditctl-listing.h0000644001034500103450000000216314655201403012526 /* * auditctl-listing.h - Header file for ausearch-llist.c * Copyright (c) 2014 Red Hat Inc., Durham, North Carolina. * All Rights Reserved. * * This software may be freely redistributed and/or modified 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, Inc., 51 Franklin Street, Fifth Floor * Boston, MA 02110-1335, USA. * * Authors: * Steve Grubb */ #ifndef CTLLISTING_HEADER #define CTLLISTING_HEADER #include "config.h" #include "libaudit.h" void audit_print_init(void); int audit_print_reply(const struct audit_reply *rep, int fd); int key_match(const struct audit_rule_data *r); #endif audit-4.0.2/src/auditd-listen.c0000644001034500103450000007651714655201403012025 /* auditd-listen.c -- * Copyright 2008,2009,2011,2016,2018 Red Hat Inc. * All Rights Reserved. * * 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 * * Authors: * DJ Delorie * Steve Grubb * */ #include "config.h" #include #include #include #include #include #include #include #include #include #include /* O_NOFOLLOW needs gnu defined */ #include #include #include /* INT_MAX */ #include #include #include #include #ifdef HAVE_LIBWRAP #include #endif #ifdef USE_GSSAPI #include #include #include #endif #include "libaudit.h" #include "auditd-event.h" #include "auditd-config.h" #include "private.h" #include "ev.h" extern int send_audit_event(int type, const char *str); #define DEFAULT_BUF_SZ 192 typedef struct ev_tcp { struct ev_io io; struct sockaddr_storage addr; struct ev_tcp *next, *prev; unsigned int bufptr; int client_active; #ifdef USE_GSSAPI /* This holds the negotiated security context for this client. */ gss_ctx_id_t gss_context; char *remote_name; int remote_name_len; #endif unsigned char buffer [MAX_AUDIT_MESSAGE_LENGTH + 17]; } ev_tcp; #define N_SOCKS 4 static int listen_socket[N_SOCKS]; static int nlsocks; static struct ev_io tcp_listen_watcher; static struct ev_periodic periodic_watcher; static unsigned min_port, max_port, max_per_addr; static int use_libwrap = 1; static int transport = T_TCP; static char msgbuf[MAX_AUDIT_MESSAGE_LENGTH + 1]; static struct ev_tcp *client_chain = NULL; #ifdef USE_GSSAPI /* This is our global credentials */ static gss_cred_id_t server_creds; // This is used to hold our own private key static char *my_service_name, *my_gss_realm; #define USE_GSS (transport == T_KRB5) #endif static char *sockaddr_to_string(const struct sockaddr_storage *addr) { static char buf[INET6_ADDRSTRLEN]; inet_ntop(addr->ss_family, addr->ss_family == AF_INET ? (void *) &((struct sockaddr_in *)addr)->sin_addr : (void *) &((struct sockaddr_in6 *)addr)->sin6_addr, buf, INET6_ADDRSTRLEN); return buf; } static unsigned int sockaddr_to_port(const struct sockaddr_storage *addr) { unsigned int rc; if (addr->ss_family == AF_INET) rc = ntohs(((struct sockaddr_in *)addr)->sin_port); else if (addr->ss_family == AF_INET6) rc = ntohs(((struct sockaddr_in6 *)addr)->sin6_port); else rc = -1; return rc; } static char *sockaddr_to_addr(struct sockaddr_storage *addr) { static char buf[64]; snprintf(buf, sizeof(buf), "%52s:%u", sockaddr_to_string(addr), sockaddr_to_port(addr)); return buf; } static void set_close_on_exec(int fd) { int flags = fcntl(fd, F_GETFD); if (flags == -1) flags = 0; flags |= FD_CLOEXEC; fcntl(fd, F_SETFD, flags); } static void release_client(struct ev_tcp *client) { char emsg[DEFAULT_BUF_SZ]; snprintf(emsg, sizeof(emsg), "addr=%s port=%u res=success", sockaddr_to_string(&client->addr), sockaddr_to_port(&client->addr)); send_audit_event(AUDIT_DAEMON_CLOSE, emsg); #ifdef USE_GSSAPI if (client->remote_name) free (client->remote_name); #endif shutdown(client->io.fd, SHUT_RDWR); close(client->io.fd); if (client_chain == client) client_chain = client->next; if (client->next) client->next->prev = client->prev; if (client->prev) client->prev->next = client->next; } static void close_client(struct ev_tcp *client) { release_client(client); free(client); } static int ar_write(int sock, const void *buf, int len) { int rc = 0, w; while (len > 0) { do { w = write(sock, buf, len); } while (w < 0 && errno == EINTR); if (w < 0) return w; if (w == 0) break; rc += w; len -= w; buf = (const void *)((const char *)buf + w); } return rc; } #ifdef USE_GSSAPI static int ar_read(int sock, void *buf, int len) { int rc = 0, r; while (len > 0) { do { r = read(sock, buf, len); } while (r < 0 && errno == EINTR); if (r < 0) return r; if (r == 0) break; rc += r; len -= r; buf = (void *)((char *)buf + r); } return rc; } /* Communications under GSS is done by token exchanges. Each "token" may contain a message, perhaps signed, perhaps encrypted. The messages within are what we're interested in, but the network sees the tokens. The protocol we use for transferring tokens is to send the length first, four bytes MSB first, then the token data. We return nonzero on error. */ static int recv_token(int s, gss_buffer_t tok) { int ret; unsigned char lenbuf[4]; unsigned int len; ret = ar_read(s, (char *)lenbuf, 4); if (ret < 0) { audit_msg(LOG_ERR, "GSS-API error reading token length"); return -1; } else if (!ret) { return 0; } else if (ret != 4) { audit_msg(LOG_ERR, "GSS-API error reading token length"); return -1; } len = ((lenbuf[0] << 24) | (lenbuf[1] << 16) | (lenbuf[2] << 8) | lenbuf[3]); if (len > MAX_AUDIT_MESSAGE_LENGTH) { audit_msg(LOG_ERR, "GSS-API error: event length exceeds MAX_AUDIT_LENGTH"); return -1; } tok->length = len; tok->value = (char *)malloc(tok->length ? tok->length : 1); if (tok->length && tok->value == NULL) { audit_msg(LOG_ERR, "Out of memory allocating token data"); return -1; } ret = ar_read(s, (char *)tok->value, tok->length); if (ret < 0) { audit_msg(LOG_ERR, "GSS-API error reading token data"); free(tok->value); return -1; } else if (ret != (int) tok->length) { audit_msg(LOG_ERR, "GSS-API error reading token data"); free(tok->value); return -1; } return 1; } /* Same here. */ static int send_token(int s, gss_buffer_t tok) { int ret; unsigned char lenbuf[4]; unsigned int len; if (tok->length > 0xffffffffUL) return -1; len = tok->length; lenbuf[0] = (len >> 24) & 0xff; lenbuf[1] = (len >> 16) & 0xff; lenbuf[2] = (len >> 8) & 0xff; lenbuf[3] = len & 0xff; ret = ar_write(s, (char *) lenbuf, 4); if (ret < 0) { audit_msg(LOG_ERR, "GSS-API error sending token length"); return -1; } else if (ret != 4) { audit_msg(LOG_ERR, "GSS-API error sending token length"); return -1; } ret = ar_write(s, tok->value, tok->length); if (ret < 0) { audit_msg(LOG_ERR, "GSS-API error sending token data"); return -1; } else if (ret != (int)tok->length) { audit_msg(LOG_ERR, "GSS-API error sending token data"); return -1; } return 0; } static void gss_failure_2(const char *msg, int status, int type) { OM_uint32 message_context = 0; OM_uint32 min_status = 0; gss_buffer_desc status_string; do { gss_display_status(&min_status, status, type, GSS_C_NO_OID, &message_context, &status_string); audit_msg (LOG_ERR, "GSS error: %s: %s", msg, (char *)status_string.value); gss_release_buffer(&min_status, &status_string); } while (message_context != 0); } static void gss_failure(const char *msg, int major_status, int minor_status) { gss_failure_2(msg, major_status, GSS_C_GSS_CODE); if (minor_status) gss_failure_2(msg, minor_status, GSS_C_MECH_CODE); } #define KCHECK(x,f, k) if (x) { \ const char *kstr = krb5_get_error_message(kcontext, x); \ audit_msg(LOG_ERR, "krb5 error: %s in %s\n", kstr, f); \ krb5_free_error_message(kcontext, kstr); \ krb5_free_context(k); k = NULL; \ return -1; } /* These are our private credentials, which come from a key file on our server. They are acquired once, at program start. */ static krb5_context kcontext = NULL; static int server_acquire_creds(const char *service_name, gss_cred_id_t *lserver_creds) { gss_buffer_desc name_buf; gss_name_t server_name; OM_uint32 major_status, minor_status; int krberr; my_service_name = strdup(service_name); name_buf.value = (char *)service_name; name_buf.length = strlen(name_buf.value) + 1; major_status = gss_import_name(&minor_status, &name_buf, (gss_OID) gss_nt_service_name, &server_name); if (major_status != GSS_S_COMPLETE) { gss_failure("importing name", major_status, minor_status); return -1; } major_status = gss_acquire_cred(&minor_status, server_name, GSS_C_INDEFINITE, GSS_C_NULL_OID_SET, GSS_C_ACCEPT, lserver_creds, NULL, NULL); if (major_status != GSS_S_COMPLETE) { gss_failure("acquiring credentials", major_status, minor_status); (void) gss_release_name(&minor_status, &server_name); return -1; } (void) gss_release_name(&minor_status, &server_name); krberr = krb5_init_context(&kcontext); KCHECK (krberr, "krb5_init_context", kcontext); krberr = krb5_get_default_realm(kcontext, &my_gss_realm); KCHECK (krberr, "krb5_get_default_realm", kcontext); audit_msg(LOG_DEBUG, "GSS creds for %s acquired", service_name); return 0; } /* This is where we negotiate a security context with the client. In the case of Kerberos, this is where the key exchange happens. FIXME: While everything else is strictly nonblocking, this negotiation blocks. */ static int negotiate_credentials(ev_tcp *io) { gss_buffer_desc send_tok, recv_tok; gss_name_t client; OM_uint32 maj_stat, min_stat, acc_sec_min_stat; gss_ctx_id_t *context; OM_uint32 sess_flags; char *slashptr, *atptr; context = & io->gss_context; *context = GSS_C_NO_CONTEXT; io->remote_name = NULL; maj_stat = GSS_S_CONTINUE_NEEDED; do { /* STEP 1 - get a token from the client. */ if (recv_token(io->io.fd, &recv_tok) <= 0) { audit_msg(LOG_ERR, "TCP session from %s will be closed, error ignored", sockaddr_to_addr(&io->addr)); return -1; } if (recv_tok.length == 0) { free(recv_tok.value); recv_tok.value = NULL; continue; } /* STEP 2 - let GSS process that token. */ maj_stat = gss_accept_sec_context(&acc_sec_min_stat, context, server_creds, &recv_tok, GSS_C_NO_CHANNEL_BINDINGS, &client, NULL, &send_tok, &sess_flags, NULL, NULL); if (recv_tok.value) gss_release_buffer(&min_stat, &recv_tok); if (maj_stat != GSS_S_COMPLETE && maj_stat != GSS_S_CONTINUE_NEEDED) { gss_release_buffer(&min_stat, &send_tok); if (*context != GSS_C_NO_CONTEXT) gss_delete_sec_context(&min_stat, context, GSS_C_NO_BUFFER); gss_failure("accepting context", maj_stat, acc_sec_min_stat); return -1; } /* STEP 3 - send any tokens to the client that GSS may ask us to send. */ if (send_tok.length != 0) { if (send_token(io->io.fd, &send_tok) < 0) { gss_release_buffer(&min_stat, &send_tok); audit_msg(LOG_ERR, "TCP session from %s will be closed, error ignored", sockaddr_to_addr(&io->addr)); if (*context != GSS_C_NO_CONTEXT) gss_delete_sec_context(&min_stat, context, GSS_C_NO_BUFFER); gss_release_name(&min_stat, &client); return -1; } } gss_release_buffer(&min_stat, &send_tok); } while (maj_stat == GSS_S_CONTINUE_NEEDED); maj_stat = gss_display_name(&min_stat, client, &recv_tok, NULL); gss_release_name(&min_stat, &client); if (maj_stat != GSS_S_COMPLETE) { gss_failure("displaying name", maj_stat, min_stat); return -1; } if (asprintf(&io->remote_name, "%.*s", (int)recv_tok.length, (char *)recv_tok.value) < 0) { io->remote_name = strdup("?"); io->remote_name_len = 1; } else io->remote_name_len = recv_tok.length; audit_msg(LOG_INFO, "GSS-API Accepted connection from: %s", io->remote_name); gss_release_buffer(&min_stat, &recv_tok); if (io->remote_name) { slashptr = strchr(io->remote_name, '/'); atptr = strchr(io->remote_name, '@'); } else slashptr = NULL; if (!slashptr || !atptr) { audit_msg(LOG_ERR, "Invalid GSS name from remote client: %s", io->remote_name); return -1; } *slashptr = 0; if (strcmp(io->remote_name, my_service_name)) { audit_msg(LOG_ERR, "Unauthorized GSS client name: %s (not %s)", io->remote_name, my_service_name); return -1; } *slashptr = '/'; if (strcmp(atptr+1, my_gss_realm)) { audit_msg(LOG_ERR, "Unauthorized GSS client realm: %s (not %s)", atptr+1, my_gss_realm); return -1; } return 0; } #endif /* USE_GSSAPI */ /* This is called from auditd-event after the message has been logged. The header is already filled in. */ static void client_ack(void *ack_data, const unsigned char *header, const char *msg) { ev_tcp *io = (ev_tcp *)ack_data; #ifdef USE_GSSAPI if (USE_GSS) { OM_uint32 major_status, minor_status; gss_buffer_desc utok, etok; int mlen; mlen = strlen(msg); utok.length = AUDIT_RMW_HEADER_SIZE + mlen; utok.value = malloc(utok.length + 1); memcpy(utok.value, header, AUDIT_RMW_HEADER_SIZE); memcpy(utok.value+AUDIT_RMW_HEADER_SIZE, msg, mlen); /* Wrapping the message creates a token for the client. Then we just have to worry about sending the token. */ major_status = gss_wrap(&minor_status, io->gss_context, 1, GSS_C_QOP_DEFAULT, &utok, NULL, &etok); if (major_status != GSS_S_COMPLETE) { gss_failure("encrypting message", major_status, minor_status); free(utok.value); return; } // FIXME: Should we check the return code of this? send_token(io->io.fd, &etok); free(utok.value); (void) gss_release_buffer(&minor_status, &etok); return; } #endif // Send the header and a text error message if it exists ar_write(io->io.fd, header, AUDIT_RMW_HEADER_SIZE); if (msg[0]) ar_write(io->io.fd, msg, strlen(msg)); } extern void distribute_event(struct auditd_event *e); static void client_message (struct ev_tcp *io, unsigned int length, unsigned char *header) { unsigned char ch; uint32_t type, mlen, seq; int hver, mver; if (AUDIT_RMW_IS_MAGIC (header, length)) { AUDIT_RMW_UNPACK_HEADER (header, hver, mver, type, mlen, seq) ch = header[length]; header[length] = 0; if (length > 1 && header[length-1] == '\n') header[length-1] = 0; if (type == AUDIT_RMW_TYPE_HEARTBEAT) { unsigned char ack[AUDIT_RMW_HEADER_SIZE]; AUDIT_RMW_PACK_HEADER (ack, 0, AUDIT_RMW_TYPE_ACK, 0, seq); client_ack(io, ack, ""); } else { struct auditd_event *e = create_event( header+AUDIT_RMW_HEADER_SIZE, client_ack, io, seq); if (e) distribute_event(e); } header[length] = ch; } } static void auditd_tcp_client_handler(struct ev_loop *loop, struct ev_io *_io, int revents) { struct ev_tcp *io = (struct ev_tcp *)_io; int i, r; int total_this_call = 0; io->client_active = 1; /* The socket is non-blocking, but we have a limited buffer size. In the event that we get a packet that's bigger than our buffer, we need to read it in multiple parts. Thus, we keep reading/parsing/processing until we run out of ready data. */ read_more: r = read (io->io.fd, io->buffer + io->bufptr, MAX_AUDIT_MESSAGE_LENGTH - io->bufptr); if (r < 0 && errno == EAGAIN) r = 0; /* We need to keep track of the difference between "no data * because it's closed" and "no data because we've read it * all". */ if (r == 0 && total_this_call > 0) { return; } /* If the connection is gracefully closed, the first read we try will return zero. If the connection times out or otherwise fails, the read will return -1. */ if (r <= 0) { if (r < 0) audit_msg(LOG_WARNING, "client %s socket closed unexpectedly", sockaddr_to_addr(&io->addr)); /* There may have been a final message without a LF. */ if (io->bufptr) { client_message(io, io->bufptr, io->buffer); } ev_io_stop(loop, _io); close_client(io); return; } total_this_call += r; more_messages: #ifdef USE_GSSAPI /* If we're using GSS at all, everything will be encrypted, one record per token. */ if (USE_GSS) { gss_buffer_desc utok, etok; io->bufptr += r; uint32_t len; OM_uint32 major_status, minor_status; /* We need at least four bytes to test the length. If we have more than four bytes, we can tell if we have a whole token (or more). */ if (io->bufptr < 4) return; len = ( ((uint32_t)(io->buffer[0] & 0xFF) << 24) | ((uint32_t)(io->buffer[1] & 0xFF) << 16) | ((uint32_t)(io->buffer[2] & 0xFF) << 8) | (uint32_t)(io->buffer[3] & 0xFF)); /* Make sure we got something big enough and not too big */ if (io->bufptr < 4 + len || len > MAX_AUDIT_MESSAGE_LENGTH) return; i = len + 4; etok.length = len; etok.value = io->buffer + 4; /* Unwrapping the token gives us the original message, which we know is already a single record. */ major_status = gss_unwrap(&minor_status, io->gss_context, &etok, &utok, NULL, NULL); if (major_status != GSS_S_COMPLETE) { gss_failure("decrypting message", major_status, minor_status); } else { /* client_message() wants to NUL terminate it, so copy it to a bigger buffer. Plus, we want to add our own tag. */ memcpy(msgbuf, utok.value, utok.length); while (utok.length > 0 && msgbuf[utok.length-1] == '\n') utok.length --; snprintf(msgbuf + utok.length, MAX_AUDIT_MESSAGE_LENGTH - utok.length, " krb5=%s", io->remote_name); utok.length += 6 + io->remote_name_len; client_message (io, utok.length, msgbuf); gss_release_buffer(&minor_status, &utok); } } else #endif if (AUDIT_RMW_IS_MAGIC (io->buffer, (io->bufptr+r))) { uint32_t type, len, seq; int hver, mver; unsigned char *header = (unsigned char *)io->buffer; io->bufptr += r; if (io->bufptr < AUDIT_RMW_HEADER_SIZE) return; AUDIT_RMW_UNPACK_HEADER (header, hver, mver, type, len, seq); /* Make sure len is not too big */ if (len > MAX_AUDIT_MESSAGE_LENGTH) return; i = len; i += AUDIT_RMW_HEADER_SIZE; /* See if we have enough bytes to extract the whole message. */ if (io->bufptr < i) return; /* We have an I-byte message in buffer. Send ACK */ client_message(io, i, io->buffer); } else { /* At this point, the buffer has IO->BUFPTR+R bytes in it. The first IO->BUFPTR bytes do not have a LF in them (we've already checked), we must check the R new bytes. */ for (i = io->bufptr; i < io->bufptr + r; i ++) if (io->buffer [i] == '\n') break; io->bufptr += r; /* Check for a partial message, with no LF yet. */ if (i == io->bufptr) return; i++; /* We have an I-byte message in buffer. Send ACK */ client_message(io, i, io->buffer); } /* Now copy any remaining bytes to the beginning of the buffer. */ memmove(io->buffer, io->buffer + i, io->bufptr - i); io->bufptr -= i; /* See if this packet had more than one message in it. */ if (io->bufptr > 0) { r = io->bufptr; io->bufptr = 0; goto more_messages; } /* Go back and see if there's more data to read. */ goto read_more; } #ifdef HAVE_LIBWRAP int allow_severity = LOG_INFO, deny_severity = LOG_NOTICE; static int auditd_tcpd_check(int sock) { struct request_info request; request_init(&request, RQ_DAEMON, "auditd", RQ_FILE, sock, 0); fromhost(&request); if (!hosts_access(&request)) return 1; return 0; } #endif /* * This function counts the number of concurrent connections and returns * a 1 if there are too many and a 0 otherwise. It assumes the incoming * connection has not been added to the linked list yet. */ static int check_num_connections(const struct sockaddr_storage *aaddr) { int num = 0; struct ev_tcp *client = client_chain; while (client) { int rc; struct sockaddr_storage *cl_addr = &client->addr; if (aaddr->ss_family == AF_INET) rc = memcmp(&((struct sockaddr_in *)aaddr)->sin_addr, &((struct sockaddr_in *)cl_addr)->sin_addr, sizeof(struct in_addr)); else rc = memcmp(&((struct sockaddr_in6 *)aaddr)->sin6_addr, &((struct sockaddr_in6 *)cl_addr)->sin6_addr, sizeof(struct in6_addr)); if (rc == 0) { num++; if (num >= max_per_addr) return 1; } client = client->next; } return 0; } void write_connection_state(FILE *f) { unsigned int num = 0, act = 0; struct ev_tcp *client = client_chain; fprintf(f, "listening for network connections = %s\n", nlsocks ? "yes" : "no"); if (nlsocks) { while (client) { if (client->client_active) act++; num++; client = client->next; } fprintf(f, "active connections = %u\n", act); fprintf(f, "total connections = %u\n", num); } } static void auditd_tcp_listen_handler( struct ev_loop *loop, struct ev_io *_io, int revents) { int one=1; int afd; socklen_t aaddrlen; struct sockaddr_storage aaddr; struct ev_tcp *client; char emsg[DEFAULT_BUF_SZ]; /* Accept the connection and see where it's coming from. */ aaddrlen = sizeof(aaddr); afd = accept(_io->fd, (struct sockaddr *)&aaddr, &aaddrlen); if (afd == -1) { audit_msg(LOG_ERR, "Unable to accept TCP connection"); return; } #ifdef HAVE_LIBWRAP if (use_libwrap) { if (auditd_tcpd_check(afd)) { shutdown(afd, SHUT_RDWR); close(afd); audit_msg(LOG_ERR, "TCP connection from %s rejected", sockaddr_to_addr(&aaddr)); snprintf(emsg, sizeof(emsg), "op=wrap addr=%s port=%u res=no", sockaddr_to_string(&aaddr), sockaddr_to_port(&aaddr)); send_audit_event(AUDIT_DAEMON_ACCEPT, emsg); return; } } #endif /* Verify it's coming from an authorized port. We assume the firewall * will block attempts from unauthorized machines. */ if (min_port > sockaddr_to_port(&aaddr) || sockaddr_to_port(&aaddr) > max_port) { audit_msg(LOG_ERR, "TCP connection from %s rejected", sockaddr_to_addr(&aaddr)); snprintf(emsg, sizeof(emsg), "op=port addr=%s port=%u res=no", sockaddr_to_string(&aaddr), sockaddr_to_port(&aaddr)); send_audit_event(AUDIT_DAEMON_ACCEPT, emsg); shutdown(afd, SHUT_RDWR); close(afd); return; } /* Make sure we don't have too many connections */ if (check_num_connections(&aaddr)) { audit_msg(LOG_ERR, "Too many connections from %s - rejected", sockaddr_to_addr(&aaddr)); snprintf(emsg, sizeof(emsg), "op=dup addr=%s port=%u res=no", sockaddr_to_string(&aaddr), sockaddr_to_port(&aaddr)); send_audit_event(AUDIT_DAEMON_ACCEPT, emsg); shutdown(afd, SHUT_RDWR); close(afd); return; } /* Connection is accepted...start setting it up */ setsockopt(afd, SOL_SOCKET, SO_REUSEADDR, (char *)&one, sizeof (int)); setsockopt(afd, SOL_SOCKET, SO_KEEPALIVE, (char *)&one, sizeof (int)); setsockopt(afd, IPPROTO_TCP, TCP_NODELAY, (char *)&one, sizeof (int)); set_close_on_exec(afd); /* Make the client data structure */ client = (struct ev_tcp *)malloc (sizeof (struct ev_tcp)); if (client == NULL) { audit_msg(LOG_CRIT, "Unable to allocate TCP client data"); snprintf(emsg, sizeof(emsg), "op=alloc addr=%s port=%u res=no", sockaddr_to_string(&aaddr), sockaddr_to_port(&aaddr)); send_audit_event(AUDIT_DAEMON_ACCEPT, emsg); shutdown(afd, SHUT_RDWR); close(afd); return; } memset(client, 0, sizeof (struct ev_tcp)); client->client_active = 1; // Was watching for EV_ERROR, but libev 3.48 took it away ev_io_init(&(client->io), auditd_tcp_client_handler, afd, EV_READ); memcpy(&client->addr, &aaddr, sizeof (struct sockaddr_storage)); #ifdef USE_GSSAPI if (USE_GSS && negotiate_credentials (client)) { shutdown(afd, SHUT_RDWR); close(afd); free(client->remote_name); free(client); return; } #endif fcntl(afd, F_SETFL, O_NONBLOCK | O_NDELAY); ev_io_start(loop, &(client->io)); /* Add the new connection to a linked list of active clients. */ client->next = client_chain; if (client->next) client->next->prev = client; client_chain = client; /* And finally log that we accepted the connection */ snprintf(emsg, sizeof(emsg), "addr=%s port=%u res=success", sockaddr_to_string(&aaddr), sockaddr_to_port(&aaddr)); send_audit_event(AUDIT_DAEMON_ACCEPT, emsg); } static void auditd_set_ports(unsigned minp, unsigned maxp, unsigned max_p_addr) { min_port = minp; max_port = maxp; max_per_addr = max_p_addr; } static void periodic_handler(struct ev_loop *loop, struct ev_periodic *per, int revents) { struct daemon_conf *config = (struct daemon_conf *) per->data; struct ev_tcp *ev, *next = NULL; int active; if (!config->tcp_client_max_idle) return; for (ev = client_chain; ev; ev = next) { next = ev->next; active = ev->client_active; ev->client_active = 0; if (active) continue; audit_msg(LOG_NOTICE, "client %s idle too long - closing connection\n", sockaddr_to_addr(&(ev->addr))); ev_io_stop(loop, &ev->io); release_client(ev); free(ev); } } int auditd_tcp_listen_init(struct ev_loop *loop, struct daemon_conf *config) { struct addrinfo *ai, *runp; struct addrinfo hints; char local[16]; int one = 1, rc; int prefer_ipv6 = 0; /* If the port is not set, that means we aren't going to listen for connections. */ if (config->tcp_listen_port == 0) return 0; memset(&hints, '\0', sizeof(hints)); hints.ai_flags = AI_PASSIVE | AI_ADDRCONFIG; hints.ai_socktype = SOCK_STREAM; hints.ai_family = AF_UNSPEC; snprintf(local, sizeof(local), "%u", (unsigned)config->tcp_listen_port); rc = getaddrinfo(NULL, local, &hints, &ai); if (rc) { audit_msg(LOG_ERR, "Cannot lookup addresses"); return 1; } { int ipv4 = 0, ipv6 = 0; nlsocks = 0; runp = ai; while (runp && nlsocks < N_SOCKS) { // Let's take a pass through and see what we got. if (runp->ai_family == AF_INET) ipv4++; else if (runp->ai_family == AF_INET6) ipv6++; runp = runp->ai_next; nlsocks++; } if (nlsocks == 2 && ipv4 && ipv6) prefer_ipv6 = 1; } nlsocks = 0; runp = ai; while (runp && nlsocks < N_SOCKS) { // On linux, ipv6 sockets by default include ipv4 so // we only need one. if (runp->ai_family == AF_INET && prefer_ipv6) goto next_try; listen_socket[nlsocks] = socket(runp->ai_family, runp->ai_socktype, runp->ai_protocol); if (listen_socket[nlsocks] < 0) { audit_msg(LOG_ERR, "Cannot create %s listener socket", runp->ai_family == AF_INET ? "IPv4" : "IPv6"); goto next_try; } /* This avoids problems if auditd needs to be restarted. */ setsockopt(listen_socket[nlsocks], SOL_SOCKET, SO_REUSEADDR, (char *)&one, sizeof (int)); // If we had more than 2 addresses suggested we'll // separate the sockets. if (!prefer_ipv6 && runp->ai_family == AF_INET6) setsockopt(listen_socket[nlsocks], IPPROTO_IPV6, IPV6_V6ONLY, &one, sizeof(int)); set_close_on_exec(listen_socket[nlsocks]); if (bind(listen_socket[nlsocks], runp->ai_addr, runp->ai_addrlen)) { if (errno != EADDRINUSE) audit_msg(LOG_ERR, "Cannot bind listener socket to port %ld (%s)", config->tcp_listen_port, strerror(errno)); close(listen_socket[nlsocks]); listen_socket[nlsocks] = -1; goto non_fatal; } if (listen(listen_socket[nlsocks], config->tcp_listen_queue)) { audit_msg(LOG_ERR, "Unable to listen on %ld (%s)", config->tcp_listen_port, strerror(errno)); close(listen_socket[nlsocks]); listen_socket[nlsocks] = -1; goto next_try; } struct protoent *p = getprotobynumber(runp->ai_protocol); audit_msg(LOG_DEBUG, "Listening on TCP port %ld, protocol %s", config->tcp_listen_port, p ? p->p_name: "?"); endprotoent(); ev_io_init(&tcp_listen_watcher, auditd_tcp_listen_handler, listen_socket[nlsocks], EV_READ); ev_io_start(loop, &tcp_listen_watcher); non_fatal: nlsocks++; if (nlsocks == N_SOCKS) break; next_try: runp = runp->ai_next; } freeaddrinfo(ai); if (nlsocks == 0) return -1; // Now that we have sockets, start the periodic timers transport = config->transport; ev_periodic_init(&periodic_watcher, periodic_handler, 0, config->tcp_client_max_idle, NULL); periodic_watcher.data = config; if (config->tcp_client_max_idle) ev_periodic_start(loop, &periodic_watcher); use_libwrap = config->use_libwrap; auditd_set_ports(config->tcp_client_min_port, config->tcp_client_max_port, config->tcp_max_per_addr); #ifdef USE_GSSAPI if (USE_GSS) { const char *princ = config->krb5_principal; const char *key_file; struct stat st; if (!princ) princ = "auditd"; /* This may fail, but we don't care. */ unsetenv ("KRB5_KTNAME"); if (config->krb5_key_file) key_file = config->krb5_key_file; else key_file = "/etc/audit/audit.key"; setenv ("KRB5_KTNAME", key_file, 1); if (stat(key_file, &st) == 0) { if ((st.st_mode & 07777) != 0400) { audit_msg (LOG_ERR, "%s is not mode 0400 (it's %#o) - compromised key?", key_file, st.st_mode & 07777); return -1; } if (st.st_uid != 0) { audit_msg(LOG_ERR, "%s is not owned by root (it's %d) - compromised key?", key_file, st.st_uid); return -1; } } if (server_acquire_creds(princ, &server_creds)) { free(my_service_name); my_service_name = NULL; return -1; } } #endif return 0; } void auditd_tcp_listen_uninit(struct ev_loop *loop, struct daemon_conf *config) { #ifdef USE_GSSAPI OM_uint32 status; #endif /* If the port isn't set, we didn't listen for connections. */ if (config->tcp_listen_port == 0) return; ev_io_stop(loop, &tcp_listen_watcher); while (nlsocks > 0) { nlsocks--; close(listen_socket[nlsocks]); } #ifdef USE_GSSAPI if (USE_GSS) { gss_release_cred(&status, &server_creds); krb5_free_context(kcontext); kcontext = NULL; free(my_service_name); my_service_name = NULL; } #endif while (client_chain) { unsigned char ack[AUDIT_RMW_HEADER_SIZE]; AUDIT_RMW_PACK_HEADER (ack, 0, AUDIT_RMW_TYPE_ENDING, 0, 0); client_ack(client_chain, ack, ""); ev_io_stop(loop, &client_chain->io); close_client(client_chain); } if (config->tcp_client_max_idle) ev_periodic_stop(loop, &periodic_watcher); transport = T_TCP; } static void periodic_reconfigure(const struct daemon_conf *config) { struct ev_loop *loop = ev_default_loop(EVFLAG_AUTO); if (config->tcp_listen_port && config->tcp_client_max_idle) { ev_periodic_set(&periodic_watcher, ev_now(loop), config->tcp_client_max_idle, NULL); ev_periodic_start(loop, &periodic_watcher); } else { ev_periodic_stop(loop, &periodic_watcher); } } void auditd_tcp_listen_reconfigure(const struct daemon_conf *nconf, struct daemon_conf *oconf) { use_libwrap = nconf->use_libwrap; /* Look at network things that do not need restarting */ if (oconf->tcp_client_min_port != nconf->tcp_client_min_port || oconf->tcp_client_max_port != nconf->tcp_client_max_port || oconf->tcp_max_per_addr != nconf->tcp_max_per_addr) { oconf->tcp_client_min_port = nconf->tcp_client_min_port; oconf->tcp_client_max_port = nconf->tcp_client_max_port; oconf->tcp_max_per_addr = nconf->tcp_max_per_addr; auditd_set_ports(oconf->tcp_client_min_port, oconf->tcp_client_max_port, oconf->tcp_max_per_addr); } if (oconf->tcp_client_max_idle != nconf->tcp_client_max_idle) { oconf->tcp_client_max_idle = nconf->tcp_client_max_idle; periodic_reconfigure(oconf); } if (oconf->tcp_listen_port != nconf->tcp_listen_port || oconf->tcp_listen_queue != nconf->tcp_listen_queue) { oconf->tcp_listen_port = nconf->tcp_listen_port; oconf->tcp_listen_queue = nconf->tcp_listen_queue; // FIXME: need to restart the network stuff } free((void *)oconf->krb5_principal); // Copying the config for now. Should compare if the same // and recredential if needed. oconf->krb5_principal = nconf->krb5_principal; } audit-4.0.2/src/ausearch-avc.h0000644001034500103450000000455114655201403011613 /* * ausearch-avc.h - Header file for ausearch-string.c * Copyright (c) 2006,2008 Red Hat Inc. * All Rights Reserved. * * This software may be freely redistributed and/or modified 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, Inc., 51 Franklin Street, Fifth Floor * Boston, MA 02110-1335, USA. * * Authors: * Steve Grubb */ #ifndef AU_AVC_HEADER #define AU_AVC_HEADER #include "config.h" #include #include "libaudit.h" typedef enum { AVC_UNSET, AVC_DENIED, AVC_GRANTED } avc_t; /* This is the node of the linked list. message & item are the only elements * at this time. Any data elements that are per item goes here. */ typedef struct _anode{ char *scontext; // se linux subject context char *tcontext; // se linux object context avc_t avc_result; // se linux avc denied/granted char *avc_perm; // se linux avc permission mentioned char *avc_class; // se linux class mentioned struct _anode* next; // Next string node pointer } anode; /* This is the linked list head. Only data elements that are 1 per * event goes here. */ typedef struct { anode *head; // List head anode *cur; // Pointer to current node unsigned int cnt; // How many items in this list } alist; void alist_create(alist *l); static inline void alist_first(alist *l) { l->cur = l->head; } anode *alist_next(alist *l); static inline anode *alist_get_cur(const alist *l) { return l->cur; } int alist_append(alist *l, anode *node); void anode_init(anode *an); void anode_clear(anode *an); void alist_clear(alist* l); /* See if any subj exists in list */ int alist_find_subj(alist *l); anode *alist_next_subj(alist *l); /* See if any obj exists in list */ int alist_find_obj(alist *l); anode *alist_next_obj(alist *l); /* See if any avc exists in list */ int alist_find_avc(alist *l); anode *alist_next_avc(alist *l); #endif audit-4.0.2/src/auditd.c0000644001034500103450000006623214655201403010522 /* auditd.c -- * Copyright 2004-09,2011,2013,2016-18,2021 Red Hat Inc. * All Rights Reserved. * * 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 * * Authors: * Steve Grubb * Rickard E. (Rik) Faith */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_ATOMIC #include #endif #include "libaudit.h" #include "auditd-event.h" #include "auditd-config.h" #include "auditd-dispatch.h" #include "auditd-listen.h" #include "libdisp.h" #include "private.h" #include "ev.h" #if EV_CHILD_ENABLE #error "LIBEV must not have EV_CHILD_ENABLE set" #endif #define EV_STOP() ev_unloop (ev_default_loop (EVFLAG_AUTO), EVUNLOOP_ALL), stop = 1; #define DEFAULT_BUF_SZ 448 #define DMSG_SIZE (DEFAULT_BUF_SZ + 48) #define SUCCESS 0 #define FAILURE 1 #define SUBJ_LEN 4097 /* Global Data */ volatile ATOMIC_INT stop = 0; /* Local data */ static int fd = -1, pipefds[2] = {-1, -1}; static struct daemon_conf config; static const char *pidfile = "/var/run/auditd.pid"; static const char *state_file = "/var/run/auditd.state"; static int init_pipe[2]; static int do_fork = 1, opt_aggregate_only = 0, config_dir_set = 0; static struct auditd_event *cur_event = NULL, *reconfig_ev = NULL; static ATOMIC_INT hup_info_requested = 0; static ATOMIC_INT usr1_info_requested = 0, usr2_info_requested = 0; static char subj[SUBJ_LEN]; static uint32_t session; /* Local function prototypes */ int send_audit_event(int type, const char *str); static void clean_exit(void); static int get_reply(int fd, struct audit_reply *rep, int seq); static char *getsubj(char *subj); enum startup_state {startup_disable=0, startup_enable, startup_nochange, startup_INVALID}; static const char *startup_states[] = {"disable", "enable", "nochange"}; /* * Output a usage message */ static void usage(void) { fprintf(stderr, "Usage: auditd [-f] [-l] [-n] [-s %s|%s|%s] " "[-c ]\n", startup_states[startup_disable], startup_states[startup_enable], startup_states[startup_nochange]); exit(2); } /* * SIGTERM handler */ static void term_handler(struct ev_loop *loop, struct ev_signal *sig, int revents) { EV_STOP (); } /* * Used to reconfigure the daemon */ static void hup_handler( struct ev_loop *loop, struct ev_signal *sig, int revents ) { int rc; rc = audit_request_signal_info(fd); if (rc < 0) send_audit_event(AUDIT_DAEMON_CONFIG, "op=reconfigure state=no-change auid=-1 pid=-1 subj=? res=failed"); else hup_info_requested = 1; } /* * Used to force log rotation */ static void user1_handler(struct ev_loop *loop, struct ev_signal *sig, int revents) { int rc; rc = audit_request_signal_info(fd); if (rc < 0) send_audit_event(AUDIT_DAEMON_ROTATE, "op=rotate-logs auid=-1 pid=-1 subj=? res=failed"); else usr1_info_requested = 1; } /* * Used to resume logging */ static void user2_handler( struct ev_loop *loop, struct ev_signal *sig, int revents ) { int rc; rc = audit_request_signal_info(fd); if (rc < 0) { resume_logging(); send_audit_event(AUDIT_DAEMON_RESUME, "op=resume-logging auid=-1 pid=-1 subj=? res=success"); } else usr2_info_requested = 1; } /* * Used with email alerts to cleanup */ static void child_handler(struct ev_loop *loop, struct ev_signal *sig, int revents) { int pid; while ((pid = waitpid(-1, NULL, WNOHANG)) > 0) { if (pid == dispatcher_pid()) dispatcher_reaped(); } } static void child_handler2( int sig ) { child_handler(NULL, NULL, 0); } /* * Used to dump internal state information */ static void cont_handler(struct ev_loop *loop, struct ev_signal *sig, int revents) { char buf[64]; mode_t u = umask(0137); // allow 0640 FILE *f = fopen(state_file, "w"); umask(u); if (f == NULL) return; fprintf(f, "audit version = %s\n", VERSION); time_t now = time(0); strftime(buf, sizeof(buf), "%x %X", localtime(&now)); fprintf(f, "current time = %s\n", buf); fprintf(f, "process priority = %d\n", getpriority(PRIO_PROCESS, 0)); write_logging_state(f); libdisp_write_queue_state(f); #ifdef USE_LISTENER write_connection_state(f); #endif fclose(f); } static int extract_type(const char *str) { char tmp, *ptr2, *ptr = (char *)str; int type; if (*str == 'n') { ptr = strchr(str+1, ' '); if (ptr == NULL) return -1; // Malformed - bomb out ptr++; } // ptr should be at 't' ptr2 = strchr(ptr, ' '); if (ptr2 == NULL) return -1; // Malformed - bomb out // find = str = strchr(ptr, '='); if (str == NULL || str >= ptr2) return -1; // Malformed - bomb out // name is 1 past str++; // Save character & terminate string tmp = *ptr2; *ptr2 = 0; type = audit_name_to_msg_type(str); *ptr2 = tmp; // Restore character return type; } void distribute_event(struct auditd_event *e) { int route = 1, proto; if (config.log_format == LF_ENRICHED) proto = AUDISP_PROTOCOL_VER2; else proto = AUDISP_PROTOCOL_VER; /* If type is 0, then its a network originating event */ if (e->reply.type == 0) { // See if we are distributing network originating events if (!dispatch_network_events()) route = 0; else { // We only need the original type if its being routed e->reply.type = extract_type(e->reply.message); // Treat everything from the network as VER2 // because they are already formatted. This is // important when it gets to the dispatcher which // can strip node= when its VER1. proto = AUDISP_PROTOCOL_VER2; } } else if (e->reply.type != AUDIT_DAEMON_RECONFIG) { // All other local events need formatting format_event(e); // If the event has been formatted with node, upgrade // to VER2 so that the dispatcher honors the formatting if (config.node_name_format != N_NONE) proto = AUDISP_PROTOCOL_VER2; } else route = 0; // Don't DAEMON_RECONFIG events until after enqueue /* End of Event is for realtime interface - skip local logging of it */ if (e->reply.type != AUDIT_EOE) handle_event(e); /* Write to local disk */ /* Next, send to plugins */ if (route) dispatch_event(&e->reply, proto); /* Free msg and event memory */ cleanup_event(e); } /* * This function is used to send start, stop, and abort messages * to the audit log. */ static unsigned seq_num = 0; int send_audit_event(int type, const char *str) { struct auditd_event *e; struct timeval tv; e = create_event(NULL, 0, NULL, 0); if (e == NULL) { audit_msg(LOG_ERR, "Cannot allocate audit reply"); return 1; } e->reply.type = type; if (seq_num == 0) { // seq_num does not have to cryptographically secure srandom(time(NULL)); seq_num = random()%10000; } else seq_num++; // Write event into netlink area like normal events if (gettimeofday(&tv, NULL) == 0) { e->reply.len = snprintf((char *)e->reply.msg.data, DMSG_SIZE, "audit(%lld.%03u:%u): %s", (long long int)tv.tv_sec, (unsigned)(tv.tv_usec/1000), seq_num, str); } else { e->reply.len = snprintf((char *)e->reply.msg.data, DMSG_SIZE, "audit(%lld.%03d:%u): %s", (long long int)time(NULL), 0, seq_num, str); } // Point message at the netlink buffer like normal events e->reply.message = e->reply.msg.data; if (e->reply.len > DMSG_SIZE) e->reply.len = DMSG_SIZE; distribute_event(e); return 0; } static int write_pid_file(void) { int pidfd, len; char val[16]; len = snprintf(val, sizeof(val), "%u\n", getpid()); if (len <= 0) { audit_msg(LOG_ERR, "Pid error (%s)", strerror(errno)); pidfile = 0; return 1; } pidfd = open(pidfile, O_CREAT | O_TRUNC | O_NOFOLLOW | O_WRONLY, 0644); if (pidfd < 0) { audit_msg(LOG_ERR, "Unable to set pidfile (%s)", strerror(errno)); pidfile = 0; return 1; } if (write(pidfd, val, (unsigned int)len) != len) { audit_msg(LOG_ERR, "Unable to write pidfile (%s)", strerror(errno)); close(pidfd); pidfile = 0; return 1; } close(pidfd); return 0; } static void avoid_oom_killer(void) { int oomfd, len, rc; char *score = NULL; /* New kernels use different technique */ if ((oomfd = open("/proc/self/oom_score_adj", O_NOFOLLOW | O_WRONLY)) >= 0) { score = "-1000"; } else if ((oomfd = open("/proc/self/oom_adj", O_NOFOLLOW | O_WRONLY)) >= 0) { score = "-17"; } else { audit_msg(LOG_NOTICE, "Cannot open out of memory adjuster"); return; } len = strlen(score); rc = write(oomfd, score, len); if (rc != len) audit_msg(LOG_NOTICE, "Unable to adjust out of memory score"); close(oomfd); } /* * This function will take care of becoming a daemon. The parent * will wait until the child notifies it by writing into a special * pipe to signify that it successfully initialized. This prevents * a race in the init script where rules get loaded before the daemon * is ready and they wind up in syslog. The child returns 0 on success * and nonzero on failure. The parent returns nonzero on failure. On * success, the parent calls _exit with 0. */ static int become_daemon(void) { int nfd, rc; pid_t pid; int status; if (do_fork) { if (pipe(init_pipe) || fcntl(init_pipe[0], F_SETFD, FD_CLOEXEC) || fcntl(init_pipe[1], F_SETFD, FD_CLOEXEC)) return -1; pid = fork(); } else pid = 0; switch (pid) { case 0: /* No longer need this... */ if (do_fork) close(init_pipe[0]); /* Open stdin,out,err to /dev/null */ nfd = open("/dev/null", O_RDWR); if (nfd < 0) { audit_msg(LOG_ERR, "Cannot open /dev/null"); return -1; } if ((dup2(nfd, 0) < 0) || (dup2(nfd, 1) < 0) || (dup2(nfd, 2) < 0)) { audit_msg(LOG_ERR, "Cannot reassign descriptors to /dev/null"); close(nfd); return -1; } close(nfd); /* Change to '/' */ rc = chdir("/"); if (rc < 0) { audit_msg(LOG_ERR, "Cannot change working directory to /"); return -1; } /* Become session/process group leader */ setsid(); break; case -1: return -1; default: /* Wait for the child to say its done */ do { rc = read(init_pipe[0], &status,sizeof(status)); } while (rc < 0 && errno == EINTR); if (rc < 0) return -1; /* Success - die a happy death */ if (status == SUCCESS) { free_config(&config); _exit(0); } return -1; } return 0; } static void tell_parent(int status) { ssize_t rc; if (config.daemonize != D_BACKGROUND || do_fork == 0) return; do { rc = write(init_pipe[1], &status, sizeof(status)); } while (rc < 0 && errno == EINTR); } static void netlink_handler(struct ev_loop *loop, struct ev_io *io, int revents) { int rc = 1, cnt = 0; // Try to get all the events that are waiting but yield after 5 to // let other handlers run. Five should cover PATH events. // FIXME: backing down to 3 until IPC is faster while (rc > 0 && cnt < 3) { if (cur_event == NULL) { if ((cur_event = malloc(sizeof(*cur_event))) == NULL) { char emsg[DEFAULT_BUF_SZ]; if (*subj) snprintf(emsg, sizeof(emsg), "op=error-halt auid=%u pid=%d subj=%s res=failed", audit_getloginuid(), getpid(), subj); else snprintf(emsg, sizeof(emsg), "op=error-halt auid=%u pid=%d res=failed", audit_getloginuid(), getpid()); EV_STOP (); send_audit_event(AUDIT_DAEMON_ABORT, emsg); audit_msg(LOG_ERR, "Cannot allocate audit reply, exiting"); shutdown_events(); if (pidfile) unlink(pidfile); shutdown_dispatcher(); return; } cur_event->ack_func = NULL; } rc = audit_get_reply(fd, &cur_event->reply, GET_REPLY_NONBLOCKING, 0); if (rc > 0) { switch (cur_event->reply.type) { /* Don't process these */ case NLMSG_NOOP: case NLMSG_DONE: case NLMSG_ERROR: case AUDIT_GET: /* Or these */ case AUDIT_WATCH_INS...AUDIT_WATCH_LIST: case AUDIT_ADD_RULE...AUDIT_GET_FEATURE: case AUDIT_FIRST_DAEMON...AUDIT_LAST_DAEMON: case AUDIT_REPLACE: break; case AUDIT_SIGNAL_INFO: if (hup_info_requested) { char hup[MAX_AUDIT_MESSAGE_LENGTH]; audit_msg(LOG_DEBUG, "HUP detected, starting config manager"); reconfig_ev = cur_event; if (start_config_manager(cur_event)) { audit_format_signal_info(hup, sizeof(hup), "reconfigure state=no-change", &cur_event->reply, "failed"); send_audit_event(AUDIT_DAEMON_CONFIG, hup); } cur_event = NULL; hup_info_requested = 0; } else if (usr1_info_requested) { char usr1[MAX_AUDIT_MESSAGE_LENGTH]; audit_format_signal_info(usr1, sizeof(usr1), "rotate-logs", &cur_event->reply, "success"); send_audit_event(AUDIT_DAEMON_ROTATE, usr1); usr1_info_requested = 0; } else if (usr2_info_requested) { char usr2[MAX_AUDIT_MESSAGE_LENGTH]; audit_format_signal_info(usr2, sizeof(usr2), "resume-logging", &cur_event->reply, "success"); resume_logging(); libdisp_resume(); send_audit_event(AUDIT_DAEMON_RESUME, usr2); usr2_info_requested = 0; } break; default: distribute_event(cur_event); cur_event = NULL; break; } } cnt++; } } static void pipe_handler(struct ev_loop *loop, struct ev_io *io, int revents) { char buf[16]; // Drain the pipe - won't block because libev sets non-blocking mode if (read(pipefds[0], buf, sizeof(buf)) < 0) ; /* Intentionally blank - nothing we can do */ enqueue_event(reconfig_ev); reconfig_ev = NULL; } void reconfig_ready(void) { const char *msg = "ready\n"; if (write(pipefds[1], msg, strlen(msg)) < 0) ; /* Intentionally empty - nothing we can do */ } static void close_pipes(void) { close(pipefds[0]); close(pipefds[1]); } struct ev_loop *loop; int main(int argc, char *argv[]) { struct sigaction sa; struct rlimit limit; int i, c, rc; static const struct option opts[] = { {"foreground", no_argument, NULL, 'f'}, {"allow_links", no_argument, NULL, 'l'}, {"disable_fork", no_argument, NULL, 'n'}, {"enable_state", required_argument, NULL, 's'}, {"config_file", required_argument, NULL, 'c'}, {NULL, 0, NULL, 0} }; int opt_foreground = 0, opt_allow_links = 0; enum startup_state opt_startup = startup_enable; extern char *optarg; extern int optind; struct ev_io netlink_watcher; struct ev_io pipe_watcher; struct ev_signal sigterm_watcher; struct ev_signal sighup_watcher; struct ev_signal sigusr1_watcher; struct ev_signal sigusr2_watcher; struct ev_signal sigchld_watcher; struct ev_signal sigcont_watcher; /* Get params && set mode */ while ((c = getopt_long(argc, argv, "flns:c:", opts, NULL)) != -1) { switch (c) { case 'f': opt_foreground = 1; break; case 'l': opt_allow_links = 1; break; case 'n': do_fork = 0; break; case 's': for (i=0; i 0) { struct audit_reply trep; rc = get_reply(fd, &trep, rc); if (rc > 0) { char txt[MAX_AUDIT_MESSAGE_LENGTH]; audit_format_signal_info(txt, sizeof(txt), "terminate", &trep, "success"); send_audit_event(AUDIT_DAEMON_END, txt); } } if (rc <= 0) send_audit_event(AUDIT_DAEMON_END, "op=terminate auid=-1 uid=-1 ses=-1 pid=-1 subj=? res=success"); free(cur_event); // Tear down IO watchers Part 2 if (!opt_aggregate_only) ev_io_stop (loop, &netlink_watcher); ev_io_stop (loop, &pipe_watcher); close_pipes(); // Give DAEMON_END event a little time to be sent in case // of remote logging usleep(10000); // 10 milliseconds libdisp_shutdown(); usleep(20000); // 20 milliseconds // Tear down IO watchers Part 3 ev_signal_stop(loop, &sigchld_watcher); shutdown_events(); free_config(&config); ev_default_destroy(); return 0; } /* * A clean exit means : * 1) we log that we are going down * 2) deregister with kernel * 3) close the netlink socket */ static void clean_exit(void) { audit_msg(LOG_INFO, "The audit daemon is exiting."); if (fd >= 0) { if (!opt_aggregate_only) if (audit_set_pid(fd, 0, WAIT_NO)) ; // intentionally empty audit_close(fd); } if (pidfile) unlink(pidfile); unlink(state_file); closelog(); } /* * This function is used to get the reply for term info. * Returns 1 on success & -1 on failure. */ static int get_reply(int rfd, struct audit_reply *rep, int seq) { int rc, i; int timeout = 30; /* tenths of seconds */ for (i = 0; i < timeout; i++) { struct timeval t; fd_set read_mask; t.tv_sec = 0; t.tv_usec = 100000; /* .1 second */ FD_ZERO(&read_mask); FD_SET(rfd, &read_mask); do { rc = select(rfd+1, &read_mask, NULL, NULL, &t); } while (rc < 0 && errno == EINTR); rc = audit_get_reply(rfd, rep, GET_REPLY_NONBLOCKING, 0); if (rc > 0) { /* Don't make decisions based on wrong packet */ if (rep->nlh->nlmsg_seq != seq) continue; /* If its not what we are expecting, keep looping */ if (rep->type == AUDIT_SIGNAL_INFO) return 1; /* If we get done or error, break out */ if (rep->type == NLMSG_DONE || rep->type == NLMSG_ERROR) break; } } return -1; } // Get the subj label of the daemon static char *getsubj(char *dsubj) { pid_t pid = getpid(); char filename[48]; ssize_t num_read; int sfd; snprintf(filename, sizeof(filename), "/proc/%u/attr/current", pid); sfd = open(filename, O_RDONLY); if(sfd == -1) { dsubj[0] = 0; return NULL; } do { num_read = read(sfd, dsubj, SUBJ_LEN-1); } while (num_read < 0 && errno == EINTR); close(sfd); if(num_read <= 0) { dsubj[0] = 0; return NULL; } dsubj[num_read] = '\0'; return dsubj; } audit-4.0.2/src/ausearch-parse.c0000644001034500103450000015544214655201403012155 /* * ausearch-parse.c - Extract interesting fields and check for match * Copyright (c) 2005-08,2011,2013-14,2018-21 Red Hat * Copyright (c) 2011 IBM Corp. * All Rights Reserved. * * This software may be freely redistributed and/or modified 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, Inc., 51 Franklin Street, Fifth Floor * Boston, MA 02110-1335, USA. * * Authors: * Steve Grubb * Marcelo Henrique Cerri */ #include "config.h" #include #include #include #include #include #include #include #include /* PATH_MAX */ #include #include "libaudit.h" #include "ausearch-options.h" #include "ausearch-lookup.h" #include "ausearch-parse.h" #include "auparse-idata.h" #include "ausearch-nvpair.h" #define NAME_OFFSET 28 static const char key_sep[2] = { AUDIT_KEY_SEPARATOR, 0 }; static int parse_task_info(lnode *n, search_items *s); static int parse_syscall(lnode *n, search_items *s); static int parse_dir(const lnode *n, search_items *s); static int common_path_parser(search_items *s, char *path); static int avc_parse_path(const lnode *n, search_items *s); static int parse_path(const lnode *n, search_items *s); static int parse_user(const lnode *n, search_items *s, anode *avc); static int parse_obj(const lnode *n, search_items *s); static int parse_login(const lnode *n, search_items *s); static int parse_daemon1(const lnode *n, search_items *s); static int parse_daemon2(const lnode *n, search_items *s); static int parse_sockaddr(const lnode *n, search_items *s); static int parse_avc(const lnode *n, search_items *s); static int parse_integrity(const lnode *n, search_items *s); static int parse_kernel_anom(const lnode *n, search_items *s); static int parse_simple_message(const lnode *n, search_items *s); static int parse_tty(const lnode *n, search_items *s); static int parse_pkt(const lnode *n, search_items *s); static int parse_kernel(lnode *n, search_items *s); static int audit_avc_init(search_items *s) { if (s->avc == NULL) { //create s->avc = malloc(sizeof(alist)); if (s->avc == NULL) return -1; alist_create(s->avc); } return 0; } /* * This function will take the list and extract the searchable fields from it. * It returns 0 on success and 1 on failure. */ int extract_search_items(llist *l) { int ret = 0; lnode *n; search_items *s = &l->s; list_first(l); n = list_get_cur(l); if (n) { do { switch (n->type) { case AUDIT_SYSCALL: case AUDIT_URINGOP: ret = parse_syscall(n, s); break; case AUDIT_CWD: ret = parse_dir(n, s); break; case AUDIT_AVC_PATH: ret = avc_parse_path(n, s); break; case AUDIT_PATH: ret = parse_path(n, s); break; case AUDIT_USER: case AUDIT_FIRST_USER_MSG...AUDIT_USER_END: case AUDIT_USER_CHAUTHTOK...AUDIT_LAST_USER_MSG: case AUDIT_FIRST_USER_MSG2...AUDIT_LAST_USER_MSG2: ret = parse_user(n, s, NULL); break; case AUDIT_SOCKADDR: ret = parse_sockaddr(n, s); break; case AUDIT_LOGIN: ret = parse_login(n, s); break; case AUDIT_IPC: case AUDIT_OBJ_PID: ret = parse_obj(n, s); break; case AUDIT_DAEMON_START: case AUDIT_DAEMON_END: case AUDIT_DAEMON_ABORT: case AUDIT_DAEMON_CONFIG: case AUDIT_DAEMON_ROTATE: case AUDIT_DAEMON_RESUME: ret = parse_daemon1(n, s); break; case AUDIT_DAEMON_ACCEPT: case AUDIT_DAEMON_CLOSE: ret = parse_daemon2(n, s); break; case AUDIT_CONFIG_CHANGE: ret = parse_simple_message(n, s); // We use AVC parser because it just looks for // the one field. We don't care about return // code since older events don't have path= avc_parse_path(n, s); break; case AUDIT_AVC: case AUDIT_USER_AVC: ret = parse_avc(n, s); break; case AUDIT_NETFILTER_PKT: ret = parse_pkt(n, s); break; case AUDIT_FEATURE_CHANGE: case AUDIT_ANOM_LINK: case AUDIT_DM_CTRL: ret = parse_task_info(n, s); break; case AUDIT_SECCOMP: case AUDIT_ANOM_PROMISCUOUS: case AUDIT_ANOM_ABEND: // AUDIT_FIRST_KERN_ANOM_MSG...AUDIT_LAST_KERN_ANOM_MSG: ret = parse_kernel_anom(n, s); break; case AUDIT_MAC_POLICY_LOAD...AUDIT_MAC_UNLBL_STCDEL: ret = parse_simple_message(n, s); break; case AUDIT_INTEGRITY_DATA...AUDIT_INTEGRITY_RULE: ret = parse_integrity(n, s); break; case AUDIT_KERNEL: case AUDIT_SELINUX_ERR: case AUDIT_EXECVE: case AUDIT_IPC_SET_PERM: case AUDIT_MQ_OPEN: case AUDIT_MQ_SENDRECV: case AUDIT_MQ_NOTIFY: case AUDIT_MQ_GETSETATTR: case AUDIT_FD_PAIR: case AUDIT_BPRM_FCAPS: case AUDIT_CAPSET: case AUDIT_MMAP: case AUDIT_PROCTITLE: case AUDIT_REPLACE...AUDIT_BPF: case AUDIT_OPENAT2: case AUDIT_DM_EVENT: // Nothing to parse break; case AUDIT_NETFILTER_CFG: case AUDIT_EVENT_LISTENER: ret = parse_kernel(n, s); break; case AUDIT_TTY: ret = parse_tty(n, s); break; default: if (event_debug) fprintf(stderr, "Unparsed type:%d\n - skipped", n->type); break; } if (event_debug && ret) fprintf(stderr, "Malformed event skipped, rc=%d. %s\n", ret, n->message); } while ((n=list_next(l)) && ret == 0); } return ret; } /* * returns malloc'ed buffer on success and NULL on failure */ static nvlist uid_nvl; static int uid_list_created=0; static const char *lookup_uid(const char *field, uid_t uid) { const char *value; value = _auparse_lookup_interpretation(field); if (value) return value; if (uid == 0) return strdup("root"); else if (uid == -1) return strdup("unset"); if (uid_list_created == 0) { search_list_create(&uid_nvl); search_list_clear(&uid_nvl); uid_list_created = 1; } if (search_list_find_val(&uid_nvl, uid)) { return strdup(uid_nvl.cur->name); } else { struct passwd *pw; pw = getpwuid(uid); if (pw) { nvnode nv; nv.name = strdup(pw->pw_name); nv.val = uid; search_list_append(&uid_nvl, &nv); return strdup(pw->pw_name); } } return NULL; } void lookup_uid_destroy_list(void) { if (uid_list_created == 0) return; search_list_clear(&uid_nvl); uid_list_created = 0; } static int parse_task_info(lnode *n, search_items *s) { char *ptr, *str, *term; term = n->message; // ppid if (event_ppid != -1) { str = strstr(term, "ppid="); if (str != NULL) { // ppid is an optional field ptr = str + 5; term = strchr(ptr, ' '); if (term == NULL) return 14; *term = 0; errno = 0; s->ppid = strtoul(ptr, NULL, 10); if (errno) return 15; *term = ' '; } } // pid if (event_pid != -1) { str = strstr(term, " pid="); if (str == NULL) return 16; ptr = str + 5; term = strchr(ptr, ' '); if (term == NULL) return 17; *term = 0; errno = 0; s->pid = strtoul(ptr, NULL, 10); if (errno) return 18; *term = ' '; } // optionally get loginuid if (event_loginuid != -2 || event_tauid) { str = strstr(term, "auid="); if (str == NULL) { str = strstr(term, "loginuid="); if (str == NULL) return 19; ptr = str + 9; } else ptr = str + 5; term = strchr(ptr, ' '); if (term == NULL) return 20; *term = 0; errno = 0; s->loginuid = strtoul(ptr, NULL, 10); if (errno) return 21; *term = ' '; if (s->tauid) free((void *)s->tauid); s->tauid = lookup_uid("auid", s->loginuid); } // optionally get uid if (event_uid != -1 || event_tuid) { try_again: str = strstr(term, "uid="); if (str == NULL) return 22; // This sometimes hits auid instead of uid. If so, retry. if (*(str-1) == 'a') { term = str +1; goto try_again; } ptr = str + 4; term = strchr(ptr, ' '); if (term == NULL) return 23; *term = 0; errno = 0; s->uid = strtoul(ptr, NULL, 10); if (errno) return 24; *term = ' '; if (s->tuid) free((void *)s->tuid); s->tuid = lookup_uid("uid", s->uid); } // optionally get gid if (event_gid != -1) { str = strstr(term, "gid="); if (str == NULL) return 25; ptr = str + 4; term = strchr(ptr, ' '); if (term == NULL) return 26; *term = 0; errno = 0; s->gid = strtoul(ptr, NULL, 10); if (errno) return 27; *term = ' '; } // euid if (event_euid != -1 || event_teuid) { str = strstr(term, "euid="); if (str == NULL) return 28; ptr = str + 5; term = strchr(ptr, ' '); if (term == NULL) return 29; *term = 0; errno = 0; s->euid = strtoul(ptr, NULL, 10); if (errno) return 30; *term = ' '; s->teuid = lookup_uid("euid", s->euid); } // egid if (event_egid != -1) { str = strstr(term, "egid="); if (str == NULL) return 31; ptr = str + 5; term = strchr(ptr, ' '); if (term == NULL) return 32; *term = 0; errno = 0; s->egid = strtoul(ptr, NULL, 10); if (errno) return 33; *term = ' '; } if (event_terminal) { // dont do this search unless needed str = strstr(term, "tty="); if (str) { str += 4; term = strchr(str, ' '); if (term == NULL) return 34; *term = 0; if (s->terminal) // ANOM_NETLINK has one free(s->terminal); s->terminal = strdup(str); *term = ' '; } } // ses if (event_session_id != -2 ) { str = strstr(term, "ses="); if (str) { ptr = str + 4; term = strchr(ptr, ' '); if (term == NULL) return 35; *term = 0; errno = 0; s->session_id = strtoul(ptr, NULL, 10); if (errno) return 36; *term = ' '; } } if (event_comm) { // dont do this search unless needed str = strstr(term, "comm="); if (str) { /* Make the syscall one override */ if (s->comm) { free(s->comm); s->comm = NULL; } str += 5; if (*str == '"') { str++; term = strchr(str, '"'); if (term == NULL) return 37; *term = 0; s->comm = strdup(str); *term = '"'; } else s->comm = unescape(str); } else return 38; } if (event_exe) { // dont do this search unless needed str = strstr(n->message, "exe="); if (str) { str += 4; if (*str == '"') { str++; term = strchr(str, '"'); if (term == NULL) return 39; *term = 0; if (s->exe) // ANOM_NETLINK has one free(s->exe); s->exe = strdup(str); *term = '"'; } else s->exe = unescape(str); } else return 40; } if (event_subject) { // scontext str = strstr(term, "subj="); if (str != NULL) { str += 5; term = strchr(str, ' '); if (term == NULL) return 41; *term = 0; if (audit_avc_init(s) == 0) { anode an; anode_init(&an); an.scontext = strdup(str); alist_append(s->avc, &an); *term = ' '; } else return 42; } } // success if (event_success != S_UNSET) { if (term == NULL) term = n->message; str = strstr(term, "res="); if (str != NULL) { ptr = str + 4; term = strchr(ptr, ' '); if (term) *term = 0; errno = 0; s->success = strtoul(ptr, NULL, 10); if (errno) return 43; if (term) *term = ' '; } } return 0; } static int parse_syscall(lnode *n, search_items *s) { char *ptr, *str, *term; extern int event_machine; int ret; term = n->message; if ((report_format > RPT_DEFAULT || event_machine != -1) && n->type == AUDIT_SYSCALL) { // get arch str = strstr(term, "arch="); if (str == NULL) return 1; ptr = str + 5; term = strchr(ptr, ' '); if (term == NULL) return 2; *term = 0; errno = 0; s->arch = (int)strtoul(ptr, NULL, 16); if (errno) return 3; *term = ' '; } // get syscall if (n->type == AUDIT_SYSCALL) str = strstr(term, "syscall="); else if (n->type == AUDIT_URINGOP) { // or uring_op str = strstr(term, "uring_op="); s->arch = MACH_IO_URING; } else str = NULL; // unimplemented type if (str == NULL) return 4; ptr = str + 8; term = strchr(ptr, ' '); if (term == NULL) return 5; *term = 0; errno = 0; s->syscall = (int)strtoul(ptr, NULL, 10); if (errno) return 6; *term = ' '; // get success if (event_success != S_UNSET) { str = strstr(term, "success="); if (str) { // exit_group does not set success !?! ptr = str + 8; term = strchr(ptr, ' '); if (term == NULL) return 7; *term = 0; if (strcmp(ptr, "yes") == 0) s->success = S_SUCCESS; else s->success = S_FAILED; *term = ' '; } } // get exit if (event_exit_is_set) { str = strstr(term, "exit="); if (str == NULL) return 8; ptr = str + 5; term = strchr(ptr, ' '); if (term == NULL) return 9; *term = 0; errno = 0; s->exit = strtoll(ptr, NULL, 0); if (errno) return 10; s->exit_is_set = 1; *term = ' '; } if (n->type == AUDIT_SYSCALL) { // get a0 str = strstr(term, "a0="); if (str == NULL) return 11; ptr = str + 3; term = strchr(ptr, ' '); if (term == NULL) return 12; *term = 0; errno = 0; // 64 bit dump on 32 bit machine looks bad here - need long long n->a0 = strtoull(ptr, NULL, 16); // Hex if (errno) return 13; *term = ' '; // get a1 str = strstr(term, "a1="); if (str == NULL) return 11; ptr = str + 3; term = strchr(ptr, ' '); if (term == NULL) return 12; *term = 0; errno = 0; // 64 bit dump on 32 bit machine looks bad here - need long long n->a1 = strtoull(ptr, NULL, 16); // Hex if (errno) return 13; *term = ' '; } ret = parse_task_info(n, s); if (ret) return ret; if (event_key) { str = strstr(term, "key="); if (str) { if (!s->key) { //create s->key = malloc(sizeof(slist)); if (s->key == NULL) return 43; slist_create(s->key); } str += 4; if (*str == '"') { str++; term = strchr(str, '"'); if (term == NULL) return 44; *term = 0; if (s->key) { // append snode sn; sn.str = strdup(str); sn.key = NULL; sn.hits = 1; slist_append(s->key, &sn); } *term = '"'; } else { if (s->key) { char *saved; char *keyptr = unescape(str); if (keyptr == NULL) return 45; char *kptr = strtok_r(keyptr, key_sep, &saved); while (kptr) { snode sn; // append sn.str = strdup(kptr); sn.key = NULL; sn.hits = 1; slist_append(s->key, &sn); kptr = strtok_r(NULL, key_sep, &saved); } free(keyptr); } } } } return 0; } static int parse_dir(const lnode *n, search_items *s) { char *str, *term; if (event_filename) { // dont do this search unless needed str = strstr(n->message+NAME_OFFSET, " cwd="); if (str) { str += 5; if (*str == '"') { /* string is normal */ str++; term = strchr(str, '"'); if (term == NULL) return 1; *term = 0; if (!s->cwd) s->cwd = strdup(str); *term = '"'; } else if (!s->cwd) s->cwd = unescape(str); } } return 0; } static int common_path_parser(search_items *s, char *path) { char *term; if (!s->filename) { //create s->filename = malloc(sizeof(slist)); if (s->filename == NULL) return 1; slist_create(s->filename); } if (*path == '"') { /* string is normal */ path++; term = strchr(path, '"'); if (term == NULL) return 2; *term = 0; if (s->filename) { // append snode sn; sn.str = strdup(path); if (sn.str == NULL) { fprintf(stderr, "Out of memory. Check %s file, %d line\n", __FILE__, __LINE__); return 8; } sn.key = NULL; sn.hits = 1; // Attempt to rebuild path if relative if ((sn.str[0] == '.') && ((sn.str[1] == '.') || (sn.str[1] == '/')) && s->cwd) { char *tmp = malloc(PATH_MAX); if (tmp == NULL) { free(sn.str); return 3; } snprintf(tmp, PATH_MAX, "%s/%s", s->cwd, sn.str); free(sn.str); sn.str = tmp; } slist_append(s->filename, &sn); } *term = '"'; } else { if (s->filename) { // append snode sn; sn.key = NULL; sn.hits = 1; if (strncmp(path, "(null)", 6) == 0) { sn.str = strdup("(null)"); goto append; } if (!isxdigit(path[0])) return 4; if (path[0] == '0' && path[1] == '0') sn.str = unescape(&path[2]); // Abstract name else { term = strchr(path, ' '); if (term == NULL) return 5; *term = 0; sn.str = unescape(path); *term = ' '; } if (sn.str == NULL) return 7; // Attempt to rebuild path if relative if ((sn.str[0] == '.') && ((sn.str[1] == '.') || (sn.str[1] == '/')) && s->cwd) { char *tmp = malloc(PATH_MAX); if (tmp == NULL) { free(sn.str); return 6; } snprintf(tmp, PATH_MAX, "%s/%s", s->cwd, sn.str); free(sn.str); sn.str = tmp; } append: slist_append(s->filename, &sn); } } return 0; } /* Older AVCs have path separate from the AVC record */ static int avc_parse_path(const lnode *n, search_items *s) { char *str; if (event_filename) { // dont do this search unless needed str = strstr(n->message, " path="); if (str) { str += 6; return common_path_parser(s, str); } return 1; } return 0; } static int parse_path(const lnode *n, search_items *s) { // We add 32 to message because we do not need to look at // anything before that. Its only time and type. char *str, *term = n->message+NAME_OFFSET; if (event_filename) { // dont do this search unless needed str = strstr(term, " name="); if (str) { int rc; str += 6; rc = common_path_parser(s, str); if (rc) return rc; term = str; // Note that at this point we should be past beginning // and around the path element. The type we search for // is objtype or nametype. Searching for both will // slow us down. So, I'm using what is common to both. str = strstr(term, "type="); if (str) { str += 5; s->filename->cur->key = strdup(str); } } } if (event_object) { // tcontext str = strstr(term, "obj="); if (str != NULL) { str += 4; term = strchr(str, ' '); if (term) *term = 0; if (audit_avc_init(s) == 0) { anode an; anode_init(&an); an.tcontext = strdup(str); alist_append(s->avc, &an); if (term) *term = ' '; } else return 7; } } return 0; } static int parse_obj(const lnode *n, search_items *s) { char *str, *term; term = n->message; if (event_object) { // obj context str = strstr(term, "obj="); if (str != NULL) { str += 4; term = strchr(str, ' '); if (term) *term = 0; if (audit_avc_init(s) == 0) { anode an; anode_init(&an); an.tcontext = strdup(str); alist_append(s->avc, &an); if (term) *term = ' '; } else return 1; } } return 0; } static int parse_user(const lnode *n, search_items *s, anode *avc) { char *ptr, *str, *term, saved, *mptr; term = n->message; // get pid if (event_pid != -1) { str = strstr(term, "pid="); if (str == NULL) return 1; ptr = str + 4; term = strchr(ptr, ' '); if (term == NULL) return 2; *term = 0; errno = 0; s->pid = strtoul(ptr, NULL, 10); if (errno) return 3; *term = ' '; } // optionally get uid if (event_uid != -1 || event_tuid) { str = strstr(term, "uid="); if (str == NULL) return 4; ptr = str + 4; term = strchr(ptr, ' '); if (term == NULL) return 5; *term = 0; errno = 0; s->uid = strtoul(ptr, NULL, 10); if (errno) return 6; *term = ' '; s->tuid = lookup_uid("uid", s->uid); } // optionally get loginuid if (event_loginuid != -2 || event_tauid) { str = strstr(term, "auid="); if (str == NULL) { // Try the older one str = strstr(term, "loginuid="); if (str == NULL) return 7; ptr = str + 9; } else ptr = str + 5; term = strchr(ptr, ' '); if (term == NULL) return 8; *term = 0; errno = 0; s->loginuid = strtoul(ptr, NULL, 10); if (errno) return 9; *term = ' '; s->tauid = lookup_uid("auid", s->loginuid); } // ses if (event_session_id != -2 ) { str = strstr(term, "ses="); if (str) { ptr = str + 4; term = strchr(ptr, ' '); if (term == NULL) return 10; *term = 0; errno = 0; s->session_id = strtoul(ptr, NULL, 10); if (errno) return 11; *term = ' '; } } if (event_subject) { // scontext str = strstr(term, "subj="); if (str != NULL) { str += 5; term = strchr(str, ' '); if (term == NULL) return 12; *term = 0; if (avc) { avc->scontext = strdup(str); *term = ' '; } else if (audit_avc_init(s) == 0) { anode an; anode_init(&an); an.scontext = strdup(str); alist_append(s->avc, &an); *term = ' '; } else return 13; } } // optionally get tcontext if (avc && event_object) { // USER_AVC tcontext str = strstr(term, "tcontext="); if (str != NULL) { str += 9; term = strchr(str, ' '); if (term) { *term = 0; avc->tcontext = strdup(str); *term = ' '; } else term = str; } // Grab tclass if it exists str = strstr(term, "tclass="); if (str) { str += 7; term = strchr(str, ' '); if (term) { *term = 0; avc->avc_class = strdup(str); *term = ' '; } else term = str; } } // optionally get gid if (event_gid != -1) { if (n->type == AUDIT_ADD_GROUP || n->type == AUDIT_DEL_GROUP || n->type == AUDIT_GRP_MGMT) { str = strstr(term, " id="); // Take second shot in the case of MGMT events if (str == NULL && n->type == AUDIT_GRP_MGMT) str = strstr(term, "gid="); if (str) { ptr = str + 4; term = strchr(ptr, ' '); if (term == NULL) return 31; *term = 0; errno = 0; s->gid = strtoul(ptr, NULL, 10); if (errno) return 32; *term = ' '; } } } if (event_vmname) { str = strstr(term, "vm="); if (str) { str += 3; if (*str == '"') { str++; term = strchr(str, '"'); if (term == NULL) return 23; *term = 0; s->vmname = strdup(str); *term = '"'; } else s->vmname = unescape(str); } } if (event_uuid) { str = strstr(term, "uuid="); if (str) { str += 5; term = str; while (*term != ' ' && *term != ':' && *term) term++; if (term == str) return 24; saved = *term; *term = 0; s->uuid = strdup(str); *term = saved; } } if (n->type == AUDIT_VIRT_MACHINE_ID) { if (event_subject) { str = strstr(term, "vm-ctx="); if (str != NULL) { str += 7; term = strchr(str, ' '); if (term == NULL) return 27; *term = 0; if (audit_avc_init(s) == 0) { anode an; anode_init(&an); an.scontext = strdup(str); alist_append(s->avc, &an); *term = ' '; } else return 28; } } if (event_object) { str = strstr(term, "img-ctx="); if (str != NULL) { str += 8; term = strchr(str, ' '); if (term == NULL) return 29; *term = 0; if (audit_avc_init(s) == 0) { anode an; anode_init(&an); an.tcontext = strdup(str); alist_append(s->avc, &an); *term = ' '; } else return 30; } } } else if (n->type == AUDIT_VIRT_RESOURCE) { if (event_filename) { unsigned int incr = 6; str = strstr(term, " path="); if (str == NULL) { incr = 10; str = strstr(term, " new-disk="); } if (str != NULL) { int rc; str += incr; rc = common_path_parser(s, str); if (rc) return rc; term = str; } } } // optionally get uid - some records the second uid is what we want. // USER_LOGIN for example. if (event_uid != -1 || event_tuid) { try_again: str = strstr(term, "uid="); if (str) { // If we found auid, skip and try again if (*(str - 1) == 'a') { term = str +1; goto try_again; } if (*(str - 1) == 's' || *(str - 1) == 'u') goto skip; if (!(*(str - 1) == '\'' || *(str - 1) == ' ')) return 25; ptr = str + 4; term = ptr; while (isdigit((unsigned char)*term)) term++; if (term == ptr) return 14; saved = *term; *term = 0; errno = 0; s->uid = strtoul(ptr, NULL, 10); if (errno) return 15; *term = saved; if (s->tuid) free((void *)s->tuid); s->tuid = lookup_uid("uid", s->uid); } } skip: mptr = term; if (event_comm) { // dont do this search unless needed str = strstr(mptr, "comm="); if (str) { str += 5; if (*str == '"') { str++; term = strchr(str, '"'); if (term == NULL) return 16; *term = 0; s->comm = strdup(str); *term = '"'; } else s->comm = unescape(str); } } // Get acct for user/group add/del str = strstr(mptr, "acct="); if (str != NULL) { ptr = str + 5; term = ptr + 1; if (*ptr == '"') { while (*term != '"' && *term) term++; saved = *term; *term = 0; ptr++; if (!s->acct) //fuzzer induced duplicate s->acct = strdup(ptr); *term = saved; } else { /* Handle legacy accts */ char *end = ptr; int legacy = 0; while (*end != ' ' && *end) { if (!isxdigit(*end)) legacy = 1; end++; } term = end; if (!legacy) s->acct = unescape(ptr); else { saved = *term; *term = 0; s->acct = strdup(ptr); *term = saved; } } } mptr = term; // get hostname if (event_hostname) { // dont do this search unless needed str = strstr(mptr, "hostname="); if (str) { str += 9; term = strchr(str, ','); if (term == NULL) { term = strchr(str, ' '); if (term == NULL) return 17; } saved = *term; *term = 0; s->hostname = strdup(str); if (s->hostname == NULL) { fprintf(stderr, "Out of memory. Check %s file, %d line\n", __FILE__, __LINE__); return 33; } *term = saved; // Lets see if there is something more // meaningful in addr if (strcmp(s->hostname, "?") == 0) { term++; str = strstr(term, "addr="); if (str) { str += 5; term = strchr(str, ','); if (term == NULL) { term = strchr(str, ' '); if (term == NULL) return 18; } saved = *term; *term = 0; free(s->hostname); s->hostname = strdup(str); *term = saved; } } } } if (event_filename) { // dont do this search unless needed str = strstr(mptr, "cwd="); if (str) { str += 4; if (*str == '"') { str++; term = strchr(str, '"'); if (term == NULL) return 20; *term = 0; s->cwd = strdup(str); *term = '"'; } else { char *end = str; int legacy = 0; while (*end != ' ' && *end) { if (!isxdigit(*end)) { legacy = 1; } end++; } term = end; if (!legacy) s->cwd = unescape(str); else { saved = *term; *term = 0; s->cwd = strdup(str); *term = saved; } } } } if (event_terminal) { // dont do this search unless needed str = strstr(mptr, "terminal="); if (str) { str += 9; term = strchr(str, ' '); if (term == NULL) { term = strchr(str, ')'); if (term == NULL) return 19; } *term = 0; s->terminal = strdup(str); *term = ' '; } } if (event_exe) { // dont do this search unless needed str = strstr(mptr, "exe="); if (str) { str += 4; if (*str == '"') { str++; term = strchr(str, '"'); if (term == NULL) return 26; *term = 0; s->exe = strdup(str); *term = '"'; } else { char *end = str; int legacy = 0; while (*end != ' ' && *end) { if (!isxdigit(*end)) { legacy = 1; } end++; } term = end; if (!legacy) s->exe = unescape(str); else { saved = *term; *term = 0; s->exe = strdup(str); *term = saved; } } } } // get success if (event_success != S_UNSET) { str = strstr(mptr, "res="); if (str) { ptr = str + 4; term = strchr(ptr, '\''); if (term == NULL) return 21; *term = 0; if (strncmp(ptr, "failed", 6) == 0) s->success = S_FAILED; else s->success = S_SUCCESS; *term = '\''; } else if ((str = strstr(mptr, "result="))) { ptr = str + 7; term = strchr(ptr, ')'); if (term == NULL) return 22; *term = 0; if (strcasecmp(ptr, "success") == 0) s->success = S_SUCCESS; else s->success = S_FAILED; *term = ')'; } } /* last return code used = 24 */ return 0; } static int parse_login(const lnode *n, search_items *s) { char *ptr, *str, *term = n->message; // get pid if (event_pid != -1) { str = strstr(term, "pid="); if (str == NULL) return 1; ptr = str + 4; term = strchr(ptr, ' '); if (term == NULL) return 2; *term = 0; errno = 0; s->pid = strtoul(ptr, NULL, 10); if (errno) return 3; *term = ' '; } // optionally get uid if (event_uid != -1 || event_tuid) { str = strstr(term, "uid="); if (str == NULL) return 4; ptr = str + 4; term = strchr(ptr, ' '); if (term == NULL) return 5; *term = 0; errno = 0; s->uid = strtoul(ptr, NULL, 10); if (errno) return 6; *term = ' '; s->tuid = lookup_uid("uid", s->uid); } // optionally get subj if (event_subject) { str = strstr(term, "subj="); if (str) { ptr = str + 5; term = strchr(ptr, ' '); if (term == NULL) return 12; *term = 0; if (audit_avc_init(s) == 0) { anode an; anode_init(&an); an.scontext = strdup(str); alist_append(s->avc, &an); *term = ' '; } else return 13; *term = ' '; } } // optionally get loginuid if (event_loginuid != -2 || event_tauid) { str = strstr(term, "new auid="); if (str == NULL) { // 3.14 kernel changed it to the next line str = strstr(term, " auid="); if (str == NULL) { str = strstr(term, "new loginuid="); if (str == NULL) return 7; ptr = str + 13; } else ptr = str + 6; } else ptr = str + 9; term = strchr(ptr, ' '); if (term) *term = 0; errno = 0; s->loginuid = strtoul(ptr, NULL, 10); if (errno) return 8; if (term) *term = ' '; s->tauid = lookup_uid("auid", s->loginuid); } // success if (event_success != S_UNSET) { if (term == NULL) term = n->message; str = strstr(term, "res="); if (str != NULL) { ptr = str + 4; term = strchr(ptr, ' '); if (term) *term = 0; errno = 0; s->success = strtoul(ptr, NULL, 10); if (errno) return 9; if (term) *term = ' '; } else // Assume older kernel where always successful s->success = S_SUCCESS; } // ses if (event_session_id != -2 ) { if (term == NULL) term = n->message; str = strstr(term, "new ses="); if (str == NULL) { // The 3.14 kernel changed it to the next line str = strstr(term, " ses="); if (str == NULL) return 14; ptr = str + 5; } else ptr = str + 8; term = strchr(ptr, ' '); if (term) *term = 0; errno = 0; s->session_id = strtoul(ptr, NULL, 10); if (errno) return 11; if (term) *term = ' '; } return 0; } static int parse_daemon1(const lnode *n, search_items *s) { char *ptr, *str, *term, saved, *mptr; // Not all messages have a ')', use it if its there mptr = strchr(n->message, ')'); if (mptr == NULL) mptr = n->message; term = mptr; // optionally get auid if (event_loginuid != -2 || event_tauid) { str = strstr(mptr, "auid="); if (str == NULL) return 1; ptr = str + 5; term = strchr(ptr, ' '); if (term == NULL) return 2; saved = *term; *term = 0; errno = 0; s->loginuid = strtoul(ptr, NULL, 10); if (errno) return 3; *term = saved; s->tauid = lookup_uid("auid", s->loginuid); } // pid if (event_pid != -1) { str = strstr(term, "pid="); if (str == NULL) return 4; ptr = str + 4; term = strchr(ptr, ' '); if (term == NULL) return 5; saved = *term; *term = 0; errno = 0; s->pid = strtoul(ptr, NULL, 10); if (errno) return 6; *term = saved; } // uid - optional if (event_uid != -1) { ptr = term; str = strstr(term, " uid="); if (str) { ptr = str + 5; term = strchr(ptr, ' '); if (term == NULL) return 7; saved = *term; *term = 0; errno = 0; s->uid = strtoul(ptr, NULL, 10); if (errno) return 8; *term = saved; } else term = ptr; } // ses - optional if (event_session_id != -2) { ptr = term; str = strstr(term, "ses="); if (str) { ptr = str + 4; term = strchr(ptr, ' '); if (term == NULL) return 9; saved = *term; *term = 0; errno = 0; s->session_id = strtoul(ptr, NULL, 10); if (errno) return 10; *term = saved; } else term = ptr; } if (event_subject) { // scontext str = strstr(term, "subj="); if (str != NULL) { str += 5; term = strchr(str, ' '); if (term) *term = 0; if (audit_avc_init(s) == 0) { anode an; anode_init(&an); an.scontext = strdup(str); alist_append(s->avc, &an); } else return 11; if (term) *term = ' '; } } // success if (event_success != S_UNSET) { str = strstr(mptr, "res="); if (str) { ptr = term = str + 4; while (isalpha(*term)) term++; if (term == ptr) return 12; saved = *term; *term = 0; if (strncmp(ptr, "failed", 6) == 0) s->success = S_FAILED; else s->success = S_SUCCESS; *term = saved; } } return 0; } static int parse_daemon2(const lnode *n, search_items *s) { char *str, saved, *term = n->message; if (event_hostname) { str = strstr(term, "addr="); if (str) { str += 5; term = strchr(str, ':'); if (term == NULL) { term = strchr(str, ' '); if (term == NULL) return 1; } saved = *term; *term = 0; free(s->hostname); s->hostname = strdup(str); *term = saved; } } if (event_success != S_UNSET) { str = strstr(term, "res="); if (str) { char *ptr; ptr = term = str + 4; while (isalpha(*term)) term++; if (term == ptr) return 2; saved = *term; *term = 0; if (strncmp(ptr, "failed", 6) == 0) s->success = S_FAILED; else s->success = S_SUCCESS; *term = saved; } } return 0; } static int parse_sockaddr(const lnode *n, search_items *s) { char *str; if (event_hostname || event_filename) { str = strstr(n->message, "saddr="); if (str) { unsigned int len = 0; struct sockaddr *saddr; char name[NI_MAXHOST]; str += 6; const char *ptr = str; if (*ptr == '(') { const char *ptr2 = strchr(ptr, ')'); if (ptr2) len = (ptr2 - ptr) + 1; } else { while (isxdigit(ptr[len])) len++; len /= 2; } s->hostname = unescape(str); if (s->hostname == NULL) return 4; saddr = (struct sockaddr *)s->hostname; if (saddr->sa_family == AF_INET) { if (len < sizeof(struct sockaddr_in)) { fprintf(stderr, "sockaddr len too short\n"); return 1; } len = sizeof(struct sockaddr_in); } else if (saddr->sa_family == AF_INET6) { if (len < sizeof(struct sockaddr_in6)) { fprintf(stderr, "sockaddr6 len too short\n"); return 2; } len = sizeof(struct sockaddr_in6); } else if (saddr->sa_family == AF_UNIX) { struct sockaddr_un *un = (struct sockaddr_un *)saddr; if (len != sizeof(saddr->sa_family) && len < 4) { fprintf(stderr, "sun_path len too short (%u)\n", len); return 4; } if (event_filename) { if (!s->filename) { //create s->filename = malloc(sizeof(slist)); if (s->filename == NULL) return 5; slist_create(s->filename); } if (s->filename) { // append snode sn; if (un->sun_path[0]) sn.str = strdup(un->sun_path); else if (un->sun_path[1]) sn.str = strdup(un->sun_path+1); else return 6; sn.key = NULL; sn.hits = 1; slist_append(s->filename, &sn); } free(s->hostname); s->hostname = NULL; return 0; } else { // No file name - no need for socket free(s->hostname); s->hostname = NULL; return 0; } } else { // addr family we don't care about free(s->hostname); s->hostname = NULL; return 0; } if (!event_hostname) { // we entered here for files - discard free(s->hostname); s->hostname = NULL; return 0; } if (getnameinfo(saddr, len, name, NI_MAXHOST, NULL, 0, NI_NUMERICHOST) ) { free(s->hostname); s->hostname = NULL; } else { free(s->hostname); s->hostname = strdup(name); } } } return 0; } static int parse_integrity(const lnode *n, search_items *s) { char *ptr, *str, *term; term = n->message; // get pid str = strstr(term, "pid="); if (str) { ptr = str + 4; term = strchr(ptr, ' '); if (term == NULL) return 1; *term = 0; errno = 0; s->pid = strtoul(ptr, NULL, 10); if (errno) return 2; *term = ' '; } // optionally get uid if (event_uid != -1 || event_tuid) { str = strstr(term, " uid="); if (str) { ptr = str + 4; term = strchr(ptr, ' '); if (term == NULL) return 3; *term = 0; errno = 0; s->uid = strtoul(ptr, NULL, 10); if (errno) return 4; *term = ' '; s->tuid = lookup_uid("uid", s->uid); } } // optionally get loginuid if (event_loginuid != -2 || event_tauid) { str = strstr(n->message, "auid="); if (str) { ptr = str + 5; term = strchr(ptr, ' '); if (term == NULL) return 5; *term = 0; errno = 0; s->loginuid = strtoul(ptr, NULL, 10); if (errno) return 6; *term = ' '; s->tauid = lookup_uid("auid", s->loginuid); } } // ses if (event_session_id != -2 ) { str = strstr(term, "ses="); if (str) { ptr = str + 4; term = strchr(ptr, ' '); if (term == NULL) return 10; *term = 0; errno = 0; s->session_id = strtoul(ptr, NULL, 10); if (errno) return 11; *term = ' '; } } if (event_subject) { // scontext str = strstr(term, "subj="); if (str) { str += 5; term = strchr(str, ' '); if (term == NULL) return 12; *term = 0; if (audit_avc_init(s) == 0) { anode an; anode_init(&an); an.scontext = strdup(str); alist_append(s->avc, &an); *term = ' '; } else return 13; } } if (event_comm) { str = strstr(term, "comm="); if (str) { str += 5; if (*str == '"') { str++; term = strchr(str, '"'); if (term == NULL) return 7; *term = 0; s->comm = strdup(str); *term = '"'; } else s->comm = unescape(str); } } if (event_filename) { str = strstr(term, " name="); if (str) { str += 6; if (common_path_parser(s, str)) return 8; } } // and results (usually last) if (event_success != S_UNSET) { str = strstr(term, "res="); if (str != NULL) { ptr = str + 4; term = strchr(ptr, ' '); if (term) *term = 0; errno = 0; s->success = strtoul(ptr, NULL, 10); if (errno) return 9; if (term) *term = ' '; } } return 0; } /* FIXME: If they are in permissive mode or hit an auditallow, there can * be more than 1 avc in the same syscall. For now, we pickup just the first. */ static int parse_avc(const lnode *n, search_items *s) { char *str, *term; anode an; int rc=0; term = n->message; anode_init(&an); // get the avc message info. str = strstr(term, "avc: "); if (str) { str += 5; term = strchr(str, '{'); if (term == NULL) { term = n->message; goto other_avc; } if (event_success != S_UNSET) { *term = 0; // FIXME. Do not override syscall success if already // set. Syscall pass/fail is the authoritative value. if (strstr(str, "denied")) { s->success = S_FAILED; an.avc_result = AVC_DENIED; } else { s->success = S_SUCCESS; an.avc_result = AVC_GRANTED; } *term = '{'; } // Now get permission str = term + 1; while (*str == ' ') str++; term = strchr(str, '}'); if (term == NULL) return 2; while (*(term-1) == ' ') term--; *term = 0; an.avc_perm = strdup(str); *term = ' '; } other_avc: // User AVC's are not formatted like a kernel AVC if (n->type == AUDIT_USER_AVC) { rc = parse_user(n, s, &an); if (rc > 20) rc = 0; if (audit_avc_init(s) == 0) { alist_append(s->avc, &an); } else { rc = 10; goto err; } return rc; } // get pid if (event_pid != -1) { str = strstr(term, "pid="); if (str) { str = str + 4; term = strchr(str, ' '); if (term == NULL) { rc = 3; goto err; } *term = 0; errno = 0; s->pid = strtoul(str, NULL, 10); if (errno) { rc = 4; goto err; } *term = ' '; } } if (event_comm && s->comm == NULL) { // dont do this search unless needed str = strstr(term, "comm="); if (str == NULL) { rc = 5; goto err; } str += 5; if (*str == '"') { str++; term = strchr(str, '"'); if (term == NULL) { rc = 6; goto err; } *term = 0; s->comm = strdup(str); *term = '"'; } else { s->comm = unescape(str); if (s->comm == NULL) { rc = 11; goto err; } term = str + 6; } } if (event_filename) { // do we have a path? str = strstr(term, " path="); if (str) { str += 6; rc = common_path_parser(s, str); if (rc) goto err; term += 7; } else { str = strstr(term, " name="); if (str) { str += 6; rc = common_path_parser(s, str); if (rc) goto err; term += 7; } } } if (event_subject) { // scontext str = strstr(term, "scontext="); if (str != NULL) { str += 9; term = strchr(str, ' '); if (term == NULL) { rc = 7; goto err; } *term = 0; an.scontext = strdup(str); *term = ' '; } } if (event_object) { // tcontext str = strstr(term, "tcontext="); if (str != NULL) { str += 9; term = strchr(str, ' '); if (term == NULL) { rc = 8; goto err; } *term = 0; an.tcontext = strdup(str); *term = ' '; } } // Now get the class...its at the end, so we do things different str = strstr(term, "tclass="); if (str == NULL) { rc = 9; goto err; } str += 7; term = strchr(str, ' '); if (term) *term = 0; an.avc_class = strdup(str); if (term) *term = ' '; if (audit_avc_init(s) == 0) { alist_append(s->avc, &an); } else { rc = 10; goto err; } return 0; err: anode_clear(&an); return rc; } static int parse_kernel_anom(const lnode *n, search_items *s) { char *str, *ptr, *term = n->message; // optionally get loginuid if (event_loginuid != -2 || event_tauid) { str = strstr(term, "auid="); if (str == NULL) return 1; ptr = str + 5; term = strchr(ptr, ' '); if (term) *term = 0; errno = 0; s->loginuid = strtoul(ptr, NULL, 10); if (errno) return 2; if (term) *term = ' '; else term = ptr; s->tauid = lookup_uid("auid", s->loginuid); } // optionally get uid if (event_uid != -1 || event_tuid) { str = strstr(term, "uid="); // if promiscuous, we start over if (str) { ptr = str + 4; term = strchr(ptr, ' '); if (term == NULL) return 3; *term = 0; errno = 0; s->uid = strtoul(ptr, NULL, 10); if (errno) return 4; *term = ' '; s->tuid = lookup_uid("uid", s->uid); } } // optionally get gid if (event_gid != -1) { str = strstr(term, "gid="); if (str) { ptr = str + 4; term = strchr(ptr, ' '); if (term == NULL) return 5; *term = 0; errno = 0; s->gid = strtoul(ptr, NULL, 10); if (errno) return 6; *term = ' '; } } if (event_session_id != -2) { str = strstr(term, "ses="); if (str) { ptr = str + 4; term = strchr(ptr, ' '); if (term) *term = 0; errno = 0; s->session_id = strtoul(ptr, NULL, 10); if (errno) return 7; if (term) *term = ' '; else term = ptr; } } if (n->type == AUDIT_ANOM_PROMISCUOUS) return 0; // Nothing else in the event if (event_subject) { // scontext str = strstr(term, "subj="); if (str) { str += 5; term = strchr(str, ' '); if (term == NULL) return 8; *term = 0; if (audit_avc_init(s) == 0) { anode an; anode_init(&an); an.scontext = strdup(str); alist_append(s->avc, &an); *term = ' '; } else return 9; } } // get pid if (event_pid != -1) { str = strstr(term, "pid="); if (str) { ptr = str + 4; term = strchr(ptr, ' '); if (term == NULL) return 10; *term = 0; errno = 0; s->pid = strtoul(ptr, NULL, 10); if (errno) return 11; *term = ' '; } } if (event_comm) { // dont do this search unless needed str = strstr(term, "comm="); if (str) { str += 5; if (*str == '"') { str++; term = strchr(str, '"'); if (term == NULL) return 12; *term = 0; s->comm = strdup(str); *term = '"'; } else s->comm = unescape(str); } } if (event_exe) { // dont do this search unless needed str = strstr(term, "exe="); if (str) { str += 4; if (*str == '"') { str++; term = strchr(str, '"'); if (term == NULL) return 13; *term = 0; s->exe = strdup(str); *term = '"'; } else s->exe = unescape(str); } else if (n->type != AUDIT_ANOM_ABEND) return 14; } if (n->type == AUDIT_SECCOMP) { // get arch str = strstr(term, "arch="); if (str == NULL) return 0; // A few kernel versions don't have it ptr = str + 5; term = strchr(ptr, ' '); if (term == NULL) return 15; *term = 0; errno = 0; s->arch = (int)strtoul(ptr, NULL, 16); if (errno) return 16; *term = ' '; // get syscall str = strstr(term, "syscall="); if (str == NULL) return 17; ptr = str + 8; term = strchr(ptr, ' '); if (term == NULL) return 18; *term = 0; errno = 0; s->syscall = (int)strtoul(ptr, NULL, 10); if (errno) return 19; *term = ' '; } // optionally get res if (event_success != S_UNSET) { str = strstr(term, "res="); if (str != NULL) { ptr = str + 4; term = strchr(ptr, ' '); if (term) *term = 0; errno = 0; s->success = strtoul(ptr, NULL, 10); if (errno) return 68; if (term) *term = ' '; } } return 0; } // This is for messages that only have the loginuid as the item // of interest. static int parse_simple_message(const lnode *n, search_items *s) { char *str, *ptr, *term = n->message; // optionally get loginuid - old kernels skip auid for CONFIG_CHANGE if (event_loginuid != -2 || event_tauid) { str = strstr(term, "auid="); if (str == NULL && n->type != AUDIT_CONFIG_CHANGE) return 1; if (str) { ptr = str + 5; term = strchr(ptr, ' '); if (term) *term = 0; errno = 0; s->loginuid = strtoul(ptr, NULL, 10); if (errno) return 2; if (term) *term = ' '; else term = ptr; s->tauid = lookup_uid("auid", s->loginuid); } } // ses if (event_session_id != -2 ) { str = strstr(term, "ses="); if (str) { ptr = str + 4; term = strchr(ptr, ' '); if (term) *term = 0; errno = 0; s->session_id = strtoul(ptr, NULL, 10); if (errno) return 3; if (term) *term = ' '; else term = ptr; } } // Now get subj label if (event_subject) { // scontext str = strstr(term, "subj="); if (str != NULL) { str += 5; term = strchr(str, ' '); if (term) *term = 0; if (audit_avc_init(s) == 0) { anode an; anode_init(&an); an.scontext = strdup(str); alist_append(s->avc, &an); if (term) *term = ' '; else // Set it back to something sane term = str; } else return 4; } } if (event_key) { str = strstr(term, "key="); if (str != NULL) { if (!s->key) { //create s->key = malloc(sizeof(slist)); if (s->key == NULL) return 5; slist_create(s->key); } ptr = str + 4; if (*ptr == '"') { ptr++; term = strchr(ptr, '"'); if (term != NULL) { *term = 0; if (s->key) { // append snode sn; sn.str = strdup(ptr); sn.key = NULL; sn.hits = 1; slist_append(s->key, &sn); } *term = '"'; } else return 6; } else { if (s->key) { char *saved; char *keyptr = unescape(ptr); if (keyptr == NULL) return 8; char *kptr = strtok_r(keyptr, key_sep, &saved); while (kptr) { snode sn; // append sn.str = strdup(kptr); sn.key = NULL; sn.hits = 1; slist_append(s->key, &sn); kptr = strtok_r(NULL, key_sep, &saved); } free(keyptr); } } } } // defaulting this to 1 for these messages. The kernel generally // does not log the res since it can be nothing but success. // But it can still be overridden below if res= is found in the event if (n->type == AUDIT_CONFIG_CHANGE) s->success = S_SUCCESS; // and results (usually last) if (event_success != S_UNSET) { str = strstr(term, "res="); if (str != NULL) { ptr = str + 4; term = strchr(ptr, ' '); if (term) *term = 0; errno = 0; s->success = strtoul(ptr, NULL, 10); if (errno) return 7; if (term) *term = ' '; } } return 0; } static int parse_tty(const lnode *n, search_items *s) { char *str, *ptr, *term=n->message; // get pid if (event_pid != -1) { str = strstr(n->message, "pid="); if (str) { ptr = str + 4; term = strchr(ptr, ' '); if (term == NULL) return 1; *term = 0; errno = 0; s->pid = strtoul(ptr, NULL, 10); if (errno) return 2; *term = ' '; } } // optionally get uid if (event_uid != -1 || event_tuid) { str = strstr(term, " uid="); // if promiscuous, we start over if (str) { ptr = str + 4; term = strchr(ptr, ' '); if (term == NULL) return 3; *term = 0; errno = 0; s->uid = strtoul(ptr, NULL, 10); if (errno) return 4; *term = ' '; s->tuid = lookup_uid("uid", s->uid); } } // optionally get loginuid if (event_loginuid != -2 || event_tauid) { str = strstr(term, "auid="); if (str == NULL) return 5; ptr = str + 5; term = strchr(ptr, ' '); if (term) *term = 0; errno = 0; s->loginuid = strtoul(ptr, NULL, 10); if (errno) return 6; if (term) *term = ' '; else term = ptr; s->tauid = lookup_uid("auid", s->loginuid); } // ses if (event_session_id != -2 ) { str = strstr(term, "ses="); if (str) { ptr = str + 4; term = strchr(ptr, ' '); if (term == NULL) return 7; *term = 0; errno = 0; s->session_id = strtoul(ptr, NULL, 10); if (errno) return 8; *term = ' '; } } /* if (event_subject) { // scontext str = strstr(term, "subj="); if (str) { str += 5; term = strchr(str, ' '); if (term == NULL) return 9; *term = 0; if (audit_avc_init(s) == 0) { anode an; anode_init(&an); an.scontext = strdup(str); alist_append(s->avc, &an); *term = ' '; } else return 10; } } */ if (event_comm) { // dont do this search unless needed str = strstr(term, "comm="); if (str) { str += 5; if (*str == '"') { str++; term = strchr(str, '"'); if (term == NULL) return 11; *term = 0; s->comm = strdup(str); *term = '"'; } else s->comm = unescape(str); } } return 0; } static int parse_pkt(const lnode *n, search_items *s) { char *str, *ptr, *term=n->message; // get hostname if (event_hostname) { str = strstr(n->message, "saddr="); if (str) { ptr = str + 6; term = strchr(ptr, ' '); if (term == NULL) return 1; *term = 0; s->hostname = strdup(ptr); *term = ' '; } } // obj context if (event_object) { str = strstr(term, "obj="); if (str != NULL) { str += 4; term = strchr(str, ' '); if (term) *term = 0; if (audit_avc_init(s) == 0) { anode an; anode_init(&an); an.tcontext = strdup(str); alist_append(s->avc, &an); if (term) *term = ' '; } else return 2; } } return 0; } // parse Yet Another Audit Subject Attributes Order // /pid.*uid.*auid.*tty.*ses.*subj.*comm.*exe static int parse_kernel(lnode *n, search_items *s) { char *ptr, *str, *term; term = n->message; // get pid if not already filled if (event_pid != -1 && s->pid == -1) { str = strstr(term, " pid="); if (str) { ptr = str + 5; term = strchr(ptr, ' '); if (term == NULL) return 52; *term = 0; errno = 0; s->pid = strtoul(ptr, NULL, 10); if (errno) return 53; *term = ' '; } else return 54; } // optionally get uid if not already filled if ((s->uid == -1 && !s->tuid) && (event_uid != -1 || event_tuid)) { str = strstr(term, "uid="); if (str) { ptr = str + 4; term = strchr(ptr, ' '); if (term == NULL) return 55; *term = 0; errno = 0; s->uid = strtoul(ptr, NULL, 10); if (errno) return 56; *term = ' '; } else s->uid = 0; if (s->tuid) free((void *)s->tuid); s->tuid = lookup_uid("uid", s->uid); } // optionally get loginuid if not already filled if ((s->loginuid == -2 && !s->tauid) && (event_loginuid != -2 || event_tauid)) { str = strstr(term, "auid="); if (str) { ptr = str + 5; term = strchr(ptr, ' '); if (term == NULL) return 57; *term = 0; errno = 0; s->loginuid = strtoul(ptr, NULL, 10); if (errno) return 58; *term = ' '; } else s->loginuid = (uid_t)-1; if (s->tauid) free((void *)s->tauid); s->tauid = lookup_uid("auid", s->loginuid); } // optionally get tty if not already filled if (!s->terminal && event_terminal) { // dont do this search unless needed str = strstr(term, "tty="); if (str) { str += 4; term = strchr(str, ' '); if (term == NULL) return 59; *term = 0; if (s->terminal) // ANOM_NETLINK has one free(s->terminal); s->terminal = strdup(str); *term = ' '; } else s->terminal = strdup("(none)"); } // optionally get ses if not already filled if (s->session_id == -2 && event_session_id != -2 ) { str = strstr(term, "ses="); if (str) { ptr = str + 4; term = strchr(ptr, ' '); if (term == NULL) return 60; *term = 0; errno = 0; s->session_id = strtoul(ptr, NULL, 10); if (errno) return 61; *term = ' '; } else s->session_id = (uint32_t)-1; } // get subject if not already filled if (!s->avc && event_subject) { // scontext str = strstr(term, "subj="); if (str) { str += 5; term = strchr(str, ' '); if (term == NULL) return 62; *term = 0; if (audit_avc_init(s) == 0) { anode an; anode_init(&an); an.scontext = strdup(str); alist_append(s->avc, &an); *term = ' '; } else return 63; } else return 64; } // get command line if not already filled if (!s->comm && event_comm) { // dont do this search unless needed str = strstr(term, "comm="); if (str) { /* Make the syscall one override */ if (s->comm) { free(s->comm); s->comm = NULL; } str += 5; if (*str == '"') { str++; term = strchr(str, '"'); if (term == NULL) return 65; *term = 0; s->comm = strdup(str); *term = '"'; } else s->comm = unescape(str); } else return 66; } // optionally get exe if not already filled if (!s->exe && event_exe) { // dont do this search unless needed str = strstr(n->message, "exe="); if (str) { str += 4; if (*str == '"') { str++; term = strchr(str, '"'); if (term == NULL) return 67; *term = 0; s->exe = strdup(str); *term = '"'; } else s->exe = unescape(str); } else s->exe = strdup("(null)"); } // optionally get res if (event_success != S_UNSET) { str = strstr(term, "res="); if (str != NULL) { ptr = str + 4; term = strchr(ptr, ' '); if (term) *term = 0; errno = 0; s->success = strtoul(ptr, NULL, 10); if (errno) return 69; if (term) *term = ' '; } } return 0; } audit-4.0.2/src/aureport-options.c0000644001034500103450000004470514655201403012603 /* aureport-options.c - parse commandline options and configure aureport * Copyright 2005-08,2010-11,2014,2018 Red Hat Inc., Durham, North Carolina. * Copyright (c) 2011 IBM Corp. * All Rights Reserved. * * 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 * * Authors: * Steve Grubb * Marcelo Henrique Cerri */ #include "config.h" #include #include #include #include #include #include #include #include #include #include "aureport-options.h" #include "ausearch-time.h" #include "libaudit.h" #include "auparse-defs.h" /* Global vars that will be accessed by the main program */ char *user_file = NULL; int force_logs = 0; int no_config = 0; /* These are for compatibility with parser */ unsigned int event_id = -1; uid_t event_uid = -1, event_loginuid = -2, event_euid = -1; const char *event_tuid = NULL, *event_teuid = NULL, *event_tauid = NULL; gid_t event_gid = -1, event_egid = -1; slist *event_node_list = NULL; const char *event_key = NULL; const char *event_filename = NULL; const char *event_exe = NULL; const char *event_comm = NULL; const char *event_hostname = NULL; const char *event_terminal = NULL; const char *event_subject = NULL; const char *event_object = NULL; const char *event_uuid = NULL; const char *event_vmname = NULL; long long event_exit = 0; int event_exit_is_set = 0; pid_t event_ppid = -1; uint32_t event_session_id = -2; int event_debug = 0, event_machine = -1; time_t arg_eoe_timeout = (time_t)0; /* These are used by aureport */ const char *dummy = "dummy"; report_type_t report_type = RPT_UNSET; report_det_t report_detail = D_UNSET; report_t report_format = RPT_DEFAULT; failed_t event_failed = F_BOTH; conf_act_t event_conf_act = C_NEITHER; success_t event_success = S_SUCCESS; int event_pid = 0; auparse_esc_t escape_mode = AUPARSE_ESC_TTY; struct nv_pair { int value; const char *name; }; enum { R_INFILE, R_TIME_END, R_TIME_START, R_VERSION, R_LOG_TIMES, R_CONFIGS, R_LOGINS, R_USERS, R_TERMINALS, R_HOSTS, R_EXES, R_FILES, R_AVCS, R_SYSCALLS, R_PIDS, R_EVENTS, R_ACCT_MODS, R_INTERPRET, R_HELP, R_ANOMALY, R_RESPONSE, R_SUMMARY_DET, R_CRYPTO, R_MAC, R_FAILED, R_SUCCESS, R_ADD, R_DEL, R_AUTH, R_NODE, R_IN_LOGS, R_KEYS, R_TTY, R_NO_CONFIG, R_COMM, R_VIRT, R_INTEG, R_ESCAPE, R_DEBUG, R_EOE_TMO }; static const struct nv_pair optiontab[] = { { R_AUTH, "-au" }, { R_AUTH, "--auth" }, { R_AVCS, "-a" }, { R_AVCS, "--avc" }, { R_ADD, "--add" }, { R_CONFIGS, "-c" }, { R_COMM, "--comm" }, { R_CONFIGS, "--config" }, { R_CRYPTO, "-cr" }, { R_CRYPTO, "--crypto" }, { R_DEBUG, "--debug" }, { R_DEL, "--delete" }, { R_EVENTS, "-e" }, { R_EVENTS, "--event" }, { R_ESCAPE, "--escape" }, { R_EOE_TMO, "--eoe-timeout" }, { R_FILES, "-f" }, { R_FILES, "--file" }, { R_FAILED, "--failed" }, { R_HOSTS, "-h" }, { R_HOSTS, "--host" }, { R_HELP, "--help" }, { R_INTERPRET, "-i" }, { R_INTERPRET, "--interpret" }, { R_INFILE, "-if" }, { R_INFILE, "--input" }, { R_IN_LOGS, "--input-logs" }, { R_INTEG, "--integrity" }, { R_KEYS, "-k" }, { R_KEYS, "--key" }, { R_LOGINS, "-l" }, { R_LOGINS, "--login" }, { R_ACCT_MODS, "-m" }, { R_ACCT_MODS, "--mods" }, { R_MAC, "-ma" }, { R_MAC, "--mac" }, { R_NODE, "--node" }, { R_NO_CONFIG, "-nc" }, { R_NO_CONFIG, "--no-config" }, { R_ANOMALY, "-n" }, { R_ANOMALY, "--anomaly" }, { R_PIDS, "-p" }, { R_PIDS, "--pid" }, { R_RESPONSE, "-r" }, { R_RESPONSE, "--response" }, { R_SYSCALLS, "-s" }, { R_SYSCALLS, "--syscall" }, { R_SUCCESS, "--success" }, { R_SUMMARY_DET, "--summary" }, { R_LOG_TIMES, "-t" }, { R_LOG_TIMES, "--log" }, { R_TIME_END, "-te"}, { R_TIME_END, "--end"}, { R_TERMINALS, "-tm"}, // don't like this { R_TERMINALS, "--terminal"}, // don't like this { R_TIME_START, "-ts" }, { R_TTY, "--tty" }, { R_TIME_START, "--start" }, { R_USERS, "-u" }, { R_USERS, "--user" }, { R_VERSION, "-v" }, { R_VERSION, "--version" }, { R_EXES, "-x" }, { R_EXES, "--executable" }, { R_VIRT, "--virt" } }; #define OPTION_NAMES (sizeof(optiontab)/sizeof(optiontab[0])) static int audit_lookup_option(const char *name) { unsigned int i; for (i = 0; i < OPTION_NAMES; i++) if (!strcmp(optiontab[i].name, name)) return optiontab[i].value; return -1; } static void usage(void) { printf("usage: aureport [options]\n" "\t-a,--avc\t\t\tAvc report\n" "\t-au,--auth\t\t\tAuthentication report\n" "\t--comm\t\t\t\tCommands run report\n" "\t-c,--config\t\t\tConfig change report\n" "\t-cr,--crypto\t\t\tCrypto report\n" "\t--debug\t\t\t\tWrite malformed events that are skipped to stderr\n" "\t--eoe-timeout secs\t\tEnd of Event Timeout\n" "\t-e,--event\t\t\tEvent report\n" "\t--escape option\t\t\tEscape output\n" "\t-f,--file\t\t\tFile name report\n" "\t--failed\t\t\tonly failed events in report\n" "\t-h,--host\t\t\tRemote Host name report\n" "\t--help\t\t\t\thelp\n" "\t-i,--interpret\t\t\tInterpretive mode\n" "\t-if,--input \tuse this file as input\n" "\t--input-logs\t\t\tUse the logs even if stdin is a pipe\n" "\t--integrity\t\t\tIntegrity event report\n" "\t-k,--key\t\t\tKey report\n" "\t-l,--login\t\t\tLogin report\n" "\t-m,--mods\t\t\tModification to accounts report\n" "\t-ma,--mac\t\t\tMandatory Access Control (MAC) report\n" "\t-n,--anomaly\t\t\taNomaly report\n" "\t-nc,--no-config\t\t\tDon't include config events\n" "\t--node \t\tOnly events from a specific node\n" "\t-p,--pid\t\t\tPid report\n" "\t-r,--response\t\t\tResponse to anomaly report\n" "\t-s,--syscall\t\t\tSyscall report\n" "\t--success\t\t\tonly success events in report\n" "\t--summary\t\t\tsorted totals for main object in report\n" "\t-t,--log\t\t\tLog time range report\n" "\t-te,--end [end date] [end time]\tending date & time for reports\n" "\t-tm,--terminal\t\t\tTerMinal name report\n" "\t-ts,--start [start date] [start time]\tstarting data & time for reports\n" "\t--tty\t\t\t\tReport about tty keystrokes\n" "\t-u,--user\t\t\tUser name report\n" "\t-v,--version\t\t\tVersion\n" "\t--virt\t\t\t\tVirtualization report\n" "\t-x,--executable\t\t\teXecutable name report\n" "\tIf no report is given, the summary report will be displayed\n" ); } static int set_report(report_type_t r) { if (report_type == RPT_UNSET) { report_type = r; return 0; } else { fprintf(stderr, "Error - only one report can be specified"); return 1; } } static int set_detail(report_det_t d) { if (report_detail == D_UNSET) { report_detail = d; return 0; } else if (d == D_SUM) { report_detail = d; return 0; } else { return 1; } } /* * This function examines the commandline parameters and sets various * search options. It returns a 0 on success and < 0 on failure */ int check_params(int count, char *vars[]) { int c = 1; int retval = 0; const char *optarg; while (c < count && retval == 0) { // Go ahead and point to the next argument if (c+1 < count) { if (vars[c+1][0] != '-') optarg = vars[c+1]; else optarg = NULL; } else optarg = NULL; switch (audit_lookup_option(vars[c])) { case R_INFILE: if (!optarg) { fprintf(stderr, "Argument is required for %s\n", vars[c]); retval = -1; } else { if (strlen(optarg) >= PATH_MAX-32) { fprintf(stderr, "File name is too long %s\n", optarg); retval = -1; break; } user_file = strdup(optarg); if (user_file == NULL) retval = -1; c++; } break; case R_LOG_TIMES: if (set_report(RPT_TIME)) retval = -1; else set_detail(D_DETAILED); break; case R_AVCS: if (set_report(RPT_AVC)) retval = -1; else { set_detail(D_DETAILED); event_comm = dummy; event_subject = dummy; event_object = dummy; } break; case R_AUTH: if (set_report(RPT_AUTH)) retval = -1; else { set_detail(D_DETAILED); event_exe = dummy; event_hostname = dummy; event_terminal = dummy; event_uid = 1; } break; case R_MAC: if (set_report(RPT_MAC)) retval = -1; else { set_detail(D_DETAILED); event_loginuid = 1; event_tauid = dummy; } break; case R_INTEG: if (set_report(RPT_INTEG)) retval = -1; else { set_detail(D_DETAILED); event_loginuid = 1; event_tauid = dummy; } break; case R_VIRT: if (set_report(RPT_VIRT)) retval = -1; else { set_detail(D_DETAILED); } break; case R_CONFIGS: if (set_report(RPT_CONFIG)) retval = -1; else { set_detail(D_DETAILED); event_loginuid = 1; event_tauid = dummy; } break; case R_CRYPTO: if (set_report(RPT_CRYPTO)) retval = -1; else { set_detail(D_DETAILED); event_loginuid = 1; event_tauid = dummy; } break; case R_LOGINS: if (set_report(RPT_LOGIN)) retval = -1; else { set_detail(D_DETAILED); event_exe = dummy; event_hostname = dummy; event_terminal = dummy; event_loginuid = 1; event_tauid = dummy; } break; case R_ACCT_MODS: if (set_report(RPT_ACCT_MOD)) retval = -1; else { set_detail(D_DETAILED); event_exe = dummy; event_hostname = dummy; event_terminal = dummy; event_loginuid = 1; event_tauid = dummy; } break; case R_EVENTS: if (set_report(RPT_EVENT)) retval = -1; else { // if (!optarg) { set_detail(D_DETAILED); event_loginuid = 1; event_tauid = dummy; // } else { // UNIMPLEMENTED; // set_detail(D_SPECIFIC); // if (isdigit((unsigned char)optarg[0])) { // errno = 0; // event_id = strtoul(optarg, // NULL, 10); // if (errno) { // fprintf(stderr, // "Illegal value for audit event ID"); // retval = -1; // } // c++; // } else { // fprintf(stderr, // "Audit event id must be a numeric value, was %s\n", // optarg); // retval = -1; // } // } } break; case R_FILES: if (set_report(RPT_FILE)) retval = -1; else { if (!optarg) { set_detail(D_DETAILED); event_filename = dummy; event_exe = dummy; event_loginuid = 1; event_tauid = dummy; } else { UNIMPLEMENTED; } } break; case R_HOSTS: if (set_report(RPT_HOST)) retval = -1; else { if (!optarg) { set_detail(D_DETAILED); event_hostname = dummy; event_loginuid = 1; event_tauid = dummy; } else { UNIMPLEMENTED; } } break; case R_INTERPRET: report_format = RPT_INTERP; if (optarg) { fprintf(stderr, "Argument is NOT required for %s\n", vars[c]); retval = -1; } break; case R_PIDS: if (set_report(RPT_PID)) retval = -1; else { if (!optarg) { set_detail(D_DETAILED); event_exe = dummy; event_loginuid = 1; event_tauid = dummy; } else { UNIMPLEMENTED; } } break; case R_SYSCALLS: if (set_report(RPT_SYSCALL)) retval = -1; else { if (!optarg) { set_detail(D_DETAILED); event_comm = dummy; event_loginuid = 1; event_tauid = dummy; } else { UNIMPLEMENTED; } } break; case R_TERMINALS: if (set_report(RPT_TERM)) retval = -1; else { if (!optarg) { set_detail(D_DETAILED); event_terminal = dummy; event_hostname = dummy; event_exe = dummy; event_loginuid = 1; event_tauid = dummy; } else { UNIMPLEMENTED; } } break; case R_USERS: if (set_report(RPT_USER)) retval = -1; else { if (!optarg) { set_detail(D_DETAILED); event_terminal = dummy; event_hostname = dummy; event_exe = dummy; event_uid = 1; event_loginuid = 1; event_tauid = dummy; } else { UNIMPLEMENTED; } } break; case R_EXES: if (set_report(RPT_EXE)) retval = -1; else { if (!optarg) { set_detail(D_DETAILED); event_terminal = dummy; event_hostname = dummy; event_exe = dummy; event_loginuid = 1; event_tauid = dummy; } else { UNIMPLEMENTED; } } break; case R_COMM: if (set_report(RPT_COMM)) retval = -1; else { if (!optarg) { set_detail(D_DETAILED); event_terminal = dummy; event_hostname = dummy; event_comm = dummy; event_loginuid = 1; event_tauid = dummy; } else { UNIMPLEMENTED; } } break; case R_ANOMALY: if (set_report(RPT_ANOMALY)) retval = -1; else { if (!optarg) { set_detail(D_DETAILED); event_terminal = dummy; event_hostname = dummy; event_exe = dummy; event_comm = dummy; event_loginuid = 1; event_tauid = dummy; } else { UNIMPLEMENTED; } } break; case R_RESPONSE: if (set_report(RPT_RESPONSE)) retval = -1; else { if (!optarg) { set_detail(D_DETAILED); } else { UNIMPLEMENTED; } } break; case R_KEYS: if (set_report(RPT_KEY)) retval = -1; else { if (!optarg) { set_detail(D_DETAILED); event_exe = dummy; event_key = dummy; event_loginuid = 1; event_tauid = dummy; } else { UNIMPLEMENTED; } } break; case R_TTY: if (set_report(RPT_TTY)) retval = -1; else { set_detail(D_DETAILED); event_session_id = 1; event_loginuid = 1; event_tauid = dummy; event_terminal = dummy; event_comm = dummy; } break; case R_TIME_END: if (optarg) { if ( (c+2 < count) && vars[c+2] && (vars[c+2][0] != '-') ) { /* Have both date and time - check order*/ if (strchr(optarg, ':')) { if (ausearch_time_end(vars[c+2], optarg) != 0) retval = -1; } else { if (ausearch_time_end(optarg, vars[c+2]) != 0) retval = -1; } c++; } else { // Check against recognized words int t = lookup_time(optarg); if (t >= 0) { if (ausearch_time_end(optarg, "00:00:00") != 0) retval = -1; } else if ( (strchr(optarg, ':')) == NULL) { /* Only have date */ if (ausearch_time_end(optarg, NULL) != 0) retval = -1; } else { /* Only have time */ if (ausearch_time_end(NULL, optarg) != 0) retval = -1; } } c++; break; } fprintf(stderr, "%s requires either date and/or time\n", vars[c]); retval = -1; break; case R_TIME_START: if (optarg) { if ( (c+2 < count) && vars[c+2] && (vars[c+2][0] != '-') ) { /* Have both date and time - check order */ if (strchr(optarg, ':')) { if (ausearch_time_start( vars[c+2], optarg) != 0) retval = -1; } else { if (ausearch_time_start(optarg, vars[c+2]) != 0) retval = -1; } c++; } else { // Check against recognized words int t = lookup_time(optarg); if (t >= 0) { if (ausearch_time_start(optarg, "00:00:00") != 0) retval = -1; } else if ( strchr(optarg, ':') == NULL) { /* Only have date */ if (ausearch_time_start(optarg, "00:00:00") != 0) retval = -1; } else { /* Only have time */ if (ausearch_time_start(NULL, optarg) != 0) retval = -1; } } c++; break; } fprintf(stderr, "%s requires either date and/or time\n", vars[c]); retval = -1; break; case R_NODE: if (!optarg) { fprintf(stderr, "Argument is required for %s\n", vars[c]); retval = -1; } else { snode sn; c++; if (!event_node_list) { event_node_list = malloc(sizeof (slist)); if (!event_node_list) { retval = -1; break; } slist_create(event_node_list); } sn.str = strdup(optarg); sn.key = NULL; sn.hits=0; slist_append(event_node_list, &sn); } break; case R_ESCAPE: if (!optarg) { fprintf(stderr, "Argument is required for %s\n", vars[c]); retval = -1; } else { if (strcmp(optarg, "raw") == 0) escape_mode = AUPARSE_ESC_RAW; else if (strcmp(optarg, "tty") == 0) escape_mode = AUPARSE_ESC_TTY; else if (strncmp(optarg, "shell", 6) == 0) escape_mode = AUPARSE_ESC_SHELL; else if (strcmp(optarg, "shell_quote") == 0) escape_mode = AUPARSE_ESC_SHELL_QUOTE; else { fprintf(stderr, "Unknown option (%s)\n", optarg); retval = -1; break; } c++; } break; case R_SUMMARY_DET: set_detail(D_SUM); break; case R_FAILED: event_failed = F_FAILED; break; case R_SUCCESS: event_failed = F_SUCCESS; break; case R_ADD: event_conf_act = C_ADD; break; case R_DEL: event_conf_act = C_DEL; break; case R_DEBUG: event_debug = 1; break; case R_IN_LOGS: force_logs = 1; break; case R_NO_CONFIG: no_config = 1; break; case R_VERSION: printf("aureport version %s\n", VERSION); exit(0); break; case R_HELP: usage(); exit(0); break; case R_EOE_TMO: if (!optarg) { fprintf(stderr, "Argument is required for %s\n", vars[c]); retval = -1; break; } if (isdigit((unsigned char)optarg[0])) { errno = 0; arg_eoe_timeout = (time_t)strtoul(optarg, NULL, 10); if (errno || arg_eoe_timeout == 0) { fprintf(stderr, "Illegal value for End of Event Timeout, was %s\n", optarg); retval = -1; } c++; } else { fprintf(stderr, "End of Event Timeout must be a numeric value, was %s\n", optarg); retval = -1; } break; default: fprintf(stderr, "%s is an unsupported option\n", vars[c]); retval = -1; break; } c++; } if (retval >= 0) { if (report_type == RPT_UNSET) { if (set_report(RPT_SUMMARY)) retval = -1; else { set_detail(D_SUM); event_filename = dummy; event_hostname = dummy; event_terminal = dummy; event_exe = dummy; event_comm = dummy; event_key = dummy; event_loginuid = 1; event_tauid = dummy; } } } else usage(); return retval; } audit-4.0.2/src/auditctl-llist.h0000644001034500103450000000344314655201403012206 /* * auditctl-llist.h - Header file for ausearch-llist.c * Copyright (c) 2005 Red Hat Inc. * All Rights Reserved. * * This software may be freely redistributed and/or modified 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, Inc., 51 Franklin Street, Fifth Floor * Boston, MA 02110-1335, USA. * * Authors: * Steve Grubb */ #ifndef CTLLIST_HEADER #define CTLLIST_HEADER #include "config.h" #include #include "libaudit.h" /* This is the node of the linked list. message & item are the only elements * at this time. Any data elements that are per item goes here. */ typedef struct _lnode{ struct audit_rule_data *r; // The rule from the kernel size_t size; // Size of the rule struct struct _lnode *next; // Next node pointer } lnode; /* This is the linked list head. Only data elements that are 1 per * event goes here. */ typedef struct { lnode *head; // List head lnode *cur; // Pointer to current node unsigned int cnt; // How many items in this list } llist; void list_create(llist *l); void list_first(llist *l); void list_last(llist *l); lnode *list_next(llist *l); static inline lnode *list_get_cur(const llist *l) { return l->cur; } int list_append(llist *l, const struct audit_rule_data *r, size_t sz); void list_clear(llist* l); #endif audit-4.0.2/src/ausearch-string.c0000644001034500103450000001142414655201403012340 /* * ausearch-string.c - Minimal linked list library for strings * Copyright (c) 2005,2008,2014,2023 Red Hat Inc. * All Rights Reserved. * * This software may be freely redistributed and/or modified 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, Inc., 51 Franklin Street, Fifth Floor * Boston, MA 02110-1335, USA. * * Authors: * Steve Grubb */ #pragma GCC optimize("O3,inline") #include "ausearch-string.h" #include #include void slist_create(slist *l) { l->head = NULL; l->cur = NULL; l->last = NULL; l->cnt = 0; } snode *slist_next(slist *l) { if (l->cur == NULL) return NULL; l->cur = l->cur->next; return l->cur; } int slist_append(slist *l, const snode *node) { snode* newnode; newnode = malloc(sizeof(snode)); if (newnode == NULL) return 1; if (node->str) newnode->str = node->str; else newnode->str = NULL; if (node->key) newnode->key = node->key; else newnode->key = NULL; newnode->hits = node->hits; newnode->next = NULL; // if the top is empty, add it there if (l->head == NULL) { l->head = newnode; l->last = newnode; } else { // Otherwise put at the end l->last->next = newnode; l->last = newnode; } // make newnode current l->cur = newnode; l->cnt++; return 0; } void slist_clear(slist* l) { snode* nextnode; register snode* current; current = l->head; while (current) { nextnode=current->next; free(current->str); free(current->key); free(current); current=nextnode; } l->head = NULL; l->cur = NULL; l->last = NULL; l->cnt = 0; } int slist_add_if_uniq(slist *l, const char *str) { snode sn; register snode *cur; if (str == NULL) return -1; cur = l->head; while (cur) { if (strcmp(str, cur->str) == 0) { cur->hits++; l->cur = cur; return 0; } else cur = cur->next; } /* No matches, append to the end */ sn.str = strdup(str); sn.key = NULL; sn.hits = 1; slist_append(l, &sn); return 1; } /*static void dump_list(slist *l) { if (l == NULL) return; register snode* cur = l->head; puts("start dump"); while (cur) { printf("%u\n", cur->hits); cur = cur->next; } }*/ // This will sort the list from most hits to least static void old_sort_by_hits(slist *l) { register snode* cur, *prev; int swapped; do { swapped = 0; prev = NULL; cur = l->head; // dump_list(l); while (cur && cur->next) { // If the next node is bigger if (cur->hits < cur->next->hits) { // swap the nodes if (prev) prev->next = cur->next; else l->head = cur->next; snode *temp = cur->next->next; cur->next->next = cur; cur->next = temp; swapped = 1; } prev = cur; cur = cur->next; } } while (swapped); // End with cur pointing at first record l->cur = l->head; } // Merge two sorted lists static snode* slist_merge_sorted_lists(snode *a, snode *b) { snode dummy; snode *tail = &dummy; dummy.next = NULL; while (a && b) { if (a->hits >= b->hits) { tail->next = a; a = a->next; } else { tail->next = b; b = b->next; } tail = tail->next; } tail->next = a ? a : b; return dummy.next; } // Split the list into two halves static void slist_split_list(snode *head, snode **front, snode **back) { snode *fast, *slow; slow = head; fast = head->next; while (fast) { fast = fast->next; if (fast) { slow = slow->next; fast = fast->next; } } *front = head; *back = slow->next; slow->next = NULL; } // Merge sort for linked list static void slist_merge_sort(snode **head_ref) { snode *head = *head_ref; snode *a, *b; if (!head || !head->next) return; slist_split_list(head, &a, &b); slist_merge_sort(&a); slist_merge_sort(&b); *head_ref = slist_merge_sorted_lists(a, b); } // This function dominates aureport --summary --kind output void slist_sort_by_hits(slist *l) { if (l->cnt <= 1) return; // If the list is small, use old algorithm because // the new one has some overhead that makes it slower // until the list is big enough that the inefficiencies // of the old algorithm cause slowness. The value chosen // below is just a guess. At 100, the old algorithm is // faster. At 1000, the new one is 5x faster. if (l->cnt < 200) return old_sort_by_hits(l); slist_merge_sort(&l->head); // End with cur pointing at first record l->cur = l->head; } audit-4.0.2/src/auditd-event.h0000644001034500103450000000325714655201403011644 /* auditd-event.h -- * Copyright 2004,2005,2008,2016,2018 Red Hat Inc., Durham, North Carolina. * All Rights Reserved. * * 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 * * Authors: * Steve Grubb * */ #ifndef AUDITD_EVENT_H #define AUDITD_EVENT_H #include #include "libaudit.h" typedef void (*ack_func_type)(void *ack_data, const unsigned char *header, const char *msg); struct auditd_event { struct audit_reply reply; ack_func_type ack_func; void *ack_data; unsigned long sequence_id; }; #include "auditd-config.h" int dispatch_network_events(void); void write_logging_state(FILE *f); void shutdown_events(void); int init_event(struct daemon_conf *config); void resume_logging(void); void cleanup_event(struct auditd_event *e); void format_event(struct auditd_event *e); void enqueue_event(struct auditd_event *e); void handle_event(struct auditd_event *e); struct auditd_event *create_event(const char *msg, ack_func_type ack_func, void *ack_data, uint32_t sequence_id); #endif audit-4.0.2/src/ausearch-nvpair.c0000644001034500103450000000374414655201403012337 /* * ausearch-nvpair.c - Minimal linked list library for name-value pairs * Copyright (c) 2006-08 Red Hat Inc. * All Rights Reserved. * * This software may be freely redistributed and/or modified 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, Inc., 51 Franklin Street, Fifth Floor * Boston, MA 02110-1335, USA. * * Authors: * Steve Grubb */ #include "config.h" #include #include "ausearch-nvpair.h" void search_list_create(nvlist *l) { l->head = NULL; l->cur = NULL; l->cnt = 0; } int search_list_append(nvlist *l, nvnode *node) { nvnode* newnode = malloc(sizeof(nvnode)); if (newnode == NULL) return 1; newnode->name = node->name; newnode->val = node->val; newnode->next = NULL; // if we are at top, fix this up if (l->head == NULL) l->head = newnode; else { // Add pointer to newnode and make sure we are at the end while (l->cur->next) l->cur = l->cur->next; l->cur->next = newnode; } // make newnode current l->cur = newnode; l->cnt++; return 0; } int search_list_find_val(nvlist *l, long val) { register nvnode* node = l->head; while (node) { if (node->val == val) { l->cur = node; return 1; } else node = node->next; } return 0; } void search_list_clear(nvlist* l) { nvnode* nextnode; register nvnode* current; current = l->head; while (current) { nextnode=current->next; free(current->name); free(current); current=nextnode; } l->head = NULL; l->cur = NULL; l->cnt = 0; } audit-4.0.2/src/ausearch-time.c0000644001034500103450000002500514655201403011770 /* ausearch-time.c - time handling utility functions * Copyright 2006-08,2011,2016-17 Red Hat Inc., Durham, North Carolina. * All Rights Reserved. * * 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 * * Authors: * Steve Grubb */ #define _XOPEN_SOURCE #include "config.h" #include #include #include #include #include #include #include "ausearch-time.h" #define SECONDS_IN_DAY 24*60*60 static void clear_tm(struct tm *t); static void replace_time(struct tm *t1, struct tm *t2); static void replace_date(struct tm *t1, struct tm *t2); time_t start_time = 0, end_time = 0; struct nv_pair { int value; const char *name; }; static const struct nv_pair timetab[] = { { T_NOW, "now" }, { T_RECENT, "recent" }, { T_THIS_HOUR, "this-hour" }, { T_BOOT, "boot" }, { T_TODAY, "today" }, { T_YESTERDAY, "yesterday" }, { T_THIS_WEEK, "this-week" }, { T_WEEK_AGO, "week-ago" }, { T_THIS_MONTH, "this-month" }, { T_THIS_YEAR, "this-year" }, }; #define TIME_NAMES (sizeof(timetab)/sizeof(timetab[0])) int lookup_time(const char *name) { unsigned int i; for (i = 0; i < TIME_NAMES; i++) { if (strcmp(timetab[i].name, name) == 0) { return timetab[i].value; } } return -1; } /* static void print_time(struct tm *d) { char outstr[200]; strftime(outstr, sizeof(outstr), "%c", d); printf("%s\n", outstr); } */ static void clear_tm(struct tm *t) { t->tm_sec = 0; /* seconds */ t->tm_min = 0; /* minutes */ t->tm_hour = 0; /* hours */ t->tm_mday = 0; /* day of the month */ t->tm_mon = 0; /* month */ t->tm_year = 0; /* year */ t->tm_wday = 0; /* not used */ t->tm_yday = 0; /* not used */ t->tm_isdst = 0; /* DST flag */ } static void set_tm_now(struct tm *d) { time_t t = time(NULL); struct tm *tv = localtime(&t); replace_time(d, tv); replace_date(d, tv); } static void set_tm_today(struct tm *d) { time_t t = time(NULL); struct tm *tv = localtime(&t); d->tm_sec = 0; /* seconds */ d->tm_min = 0; /* minutes */ d->tm_hour = 0; /* hours */ replace_date(d, tv); } static void set_tm_yesterday(struct tm *d) { time_t t = time(NULL) - (time_t)(SECONDS_IN_DAY); struct tm *tv = localtime(&t); d->tm_sec = 0; /* seconds */ d->tm_min = 0; /* minutes */ d->tm_hour = 0; /* hours */ replace_date(d, tv); } static void set_tm_recent(struct tm *d) { time_t t = time(NULL) - (time_t)(10*60); /* 10 minutes ago */ struct tm *tv = localtime(&t); replace_time(d, tv); replace_date(d, tv); } static void set_tm_hour(struct tm *d) { time_t t = time(NULL); struct tm *tv = localtime(&t); d->tm_sec = 0; /* seconds */ d->tm_min = 0; /* minutes */ replace_time(d, tv); } static int set_tm_boot(struct tm *d) { char buf[128]; time_t t; int rc, fd = open("/proc/uptime", O_RDONLY); if (fd < 0) { error_out: fprintf(stderr, "Can't read uptime (%s)\n", strerror(errno)); return -1; } t = time(NULL); rc = read(fd, buf, sizeof(buf)-1); close(fd); if (rc > 0) { struct tm *tv; float f_uptime; unsigned long uptime; char *ptr; buf[rc] = 0; ptr = strchr(buf, ' '); // Accurate only to the second if (ptr) *ptr = 0; errno = 0; f_uptime = strtof(buf, NULL); uptime = f_uptime + 0.5; if (errno) goto error_out; t -= uptime; tv = localtime(&t); replace_time(d, tv); replace_date(d, tv); } else goto error_out; return 0; } static void set_tm_this_week(struct tm *d) { time_t t = time(NULL); struct tm *tv = localtime(&t); d->tm_sec = 0; /* seconds */ d->tm_min = 0; /* minutes */ d->tm_hour = 0; /* hours */ t -= (time_t)(tv->tm_wday*(time_t)SECONDS_IN_DAY); tv = localtime(&t); replace_date(d, tv); } static void set_tm_week_ago(struct tm *d) { time_t t = time(NULL); struct tm *tv; d->tm_sec = 0; /* seconds */ d->tm_min = 0; /* minutes */ d->tm_hour = 0; /* hours */ t -= (time_t)(7*SECONDS_IN_DAY); tv = localtime(&t); replace_date(d, tv); } static void set_tm_this_month(struct tm *d) { time_t t = time(NULL); struct tm *tv = localtime(&t); d->tm_sec = 0; /* seconds */ d->tm_min = 0; /* minutes */ d->tm_hour = 0; /* hours */ replace_date(d, tv); d->tm_mday = 1; /* override day of month */ } static void set_tm_this_year(struct tm *d) { time_t t = time(NULL); struct tm *tv = localtime(&t); d->tm_sec = 0; /* seconds */ d->tm_min = 0; /* minutes */ d->tm_hour = 0; /* hours */ replace_date(d, tv); d->tm_mday = 1; /* override day of month */ d->tm_mon = 0; /* override month */ d->tm_isdst = 0; } /* The time in t1 is replaced by t2 */ static void replace_time(struct tm *t1, struct tm *t2) { t1->tm_sec = t2->tm_sec; /* seconds */ t1->tm_min = t2->tm_min; /* minutes */ t1->tm_hour = t2->tm_hour; /* hours */ } /* The date in t1 is replaced by t2 */ static void replace_date(struct tm *t1, struct tm *t2) { t1->tm_mday = t2->tm_mday; /* day */ t1->tm_mon = t2->tm_mon; /* month */ t1->tm_year = t2->tm_year; /* year */ t1->tm_isdst = t2->tm_isdst; /* daylight savings time */ t1->tm_wday = t2->tm_wday; /* Day of Week */ t1->tm_yday = t2->tm_yday; /* Day of Year */ } static int lookup_and_set_time(const char *da, struct tm *d) { int retval = lookup_time(da); if (retval >= 0) { switch (retval) { case T_NOW: set_tm_now(d); break; case T_RECENT: set_tm_recent(d); break; case T_THIS_HOUR: set_tm_hour(d); break; case T_BOOT: if (set_tm_boot(d)) return -2; break; case T_TODAY: set_tm_today(d); break; case T_YESTERDAY: set_tm_yesterday(d); break; case T_THIS_WEEK: set_tm_this_week(d); break; case T_WEEK_AGO: set_tm_week_ago(d); break; case T_THIS_MONTH: set_tm_this_month(d); break; case T_THIS_YEAR: set_tm_this_year(d); break; } return 0; } else return -1; } int ausearch_time_start(const char *da, const char *ti) { /* If da == NULL, use current date */ /* If ti == NULL, then use midnight 00:00:00 */ int rc = 0; struct tm d; char *ret; clear_tm(&d); if (da == NULL) set_tm_now(&d); else { if (lookup_and_set_time(da, &d) < 0) { ret = strptime(da, "%x", &d); if (ret == NULL) { fprintf(stderr, "Invalid start date (%s). Month, Day, and Year are required.\n", da); return 1; } if (*ret != 0) { fprintf(stderr, "Error parsing start date (%s)\n", da); return 1; } // FIX DST flag start_time = mktime(&d); } else { int keyword=lookup_time(da); if (keyword == T_RECENT || keyword == T_NOW || keyword == T_THIS_HOUR || keyword == T_BOOT) { if (ti == NULL || strcmp(ti, "00:00:00") == 0) goto set_it; } } } if (ti != NULL) { char tmp_t[64]; if (strlen(ti) <= 5) { snprintf(tmp_t, sizeof(tmp_t), "%s:00", ti); } else { tmp_t[0]=0; strncat(tmp_t, ti, sizeof(tmp_t)-1); } ret = strptime(tmp_t, "%X", &d); if (ret == NULL) { fprintf(stderr, "Invalid start time (%s). Hour, Minute, and Second are required.\n", ti); return 1; } if (*ret != 0) { fprintf(stderr, "Error parsing start time (%s)\n", ti); return 1; } } else clear_tm(&d); if (d.tm_year < 104) { fprintf(stderr, "Error - year is %d\n", d.tm_year+1900); return -1; } set_it: start_time = mktime(&d); // printf("start is: %s\n", ctime(&start_time)); if (start_time == -1) { fprintf(stderr, "Error converting start time\n"); rc = -1; } return rc; } int ausearch_time_end(const char *da, const char *ti) { /* If date == NULL, use current date */ /* If ti == NULL, use current time */ int rc = 0; struct tm d; char *ret; clear_tm(&d); if (da == NULL) set_tm_now(&d); else { if (lookup_and_set_time(da, &d) < 0) { ret = strptime(da, "%x", &d); if (ret == NULL) { fprintf(stderr, "Invalid end date (%s). Month, Day, and Year are required.\n", da); return 1; } if (*ret != 0) { fprintf(stderr, "Error parsing end date (%s)\n", da); return 1; } // FIX DST flag end_time = mktime(&d); } else { int keyword=lookup_time(da); if (keyword == T_RECENT || keyword == T_NOW || keyword == T_THIS_HOUR || keyword == T_BOOT) { if (ti == NULL || strcmp(ti, "00:00:00") == 0) goto set_it; } // Special case today if (keyword == T_TODAY) { set_tm_now(&d); if (ti == NULL || strcmp(ti, "00:00:00") == 0) goto set_it; } } } if (ti != NULL) { char tmp_t[64]; if (strlen(ti) <= 5) { snprintf(tmp_t, sizeof(tmp_t), "%s:00", ti); } else { tmp_t[0]=0; strncat(tmp_t, ti, sizeof(tmp_t)-1); } ret = strptime(tmp_t, "%X", &d); if (ret == NULL) { fprintf(stderr, "Invalid end time (%s). Hour, Minute, and Second are required.\n", ti); return 1; } if (*ret != 0) { fprintf(stderr, "Error parsing end time (%s)\n", ti); return 1; } } else { time_t tt = time(NULL); struct tm *tv = localtime(&tt); d.tm_hour = tv->tm_hour; d.tm_min = tv->tm_min; d.tm_sec = tv->tm_sec; d.tm_isdst = tv->tm_isdst; } if (d.tm_year < 104) { fprintf(stderr, "Error - year is %d\n", d.tm_year+1900); return -1; } set_it: end_time = mktime(&d); // printf("end is: %s\n", ctime(&end_time)); if (end_time == -1) { fprintf(stderr, "Error converting end time\n"); rc = -1; } return rc; } audit-4.0.2/src/ausearch-int.c0000644001034500103450000000633714655201403011633 /* * ausearch-int.c - Minimal linked list library for integers * Copyright (c) 2005,2008 Red Hat Inc. * All Rights Reserved. * * This software may be freely redistributed and/or modified 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, Inc., 51 Franklin Street, Fifth Floor * Boston, MA 02110-1335, USA. * * Authors: * Steve Grubb */ #include "config.h" #include #include "ausearch-int.h" void ilist_create(ilist *l) { l->head = NULL; l->cur = NULL; l->cnt = 0; } int_node *ilist_next(ilist *l) { if (l->cur == NULL) return NULL; l->cur = l->cur->next; return l->cur; } int ilist_append(ilist *l, int num, unsigned int hits, int aux) { int_node* newnode; newnode = malloc(sizeof(int_node)); if (newnode == NULL) return 1; newnode->num = num; newnode->hits = hits; newnode->aux1 = aux; newnode->next = NULL; // if we are at top, fix this up if (l->head == NULL) l->head = newnode; else // Otherwise add pointer to newnode l->cur->next = newnode; // make newnode current l->cur = newnode; l->cnt++; return 0; } void ilist_clear(ilist* l) { int_node* nextnode; register int_node* current; if (l == NULL) return; current = l->head; while (current) { nextnode=current->next; free(current); current=nextnode; } l->head = NULL; l->cur = NULL; l->cnt = 0; } int ilist_add_if_uniq(ilist *l, int num, int aux) { register int_node *cur, *prev; prev = cur = l->head; while (cur) { if (cur->num == num) { cur->hits++; return 0; } else if (num > cur->num) { prev = cur; cur = cur->next; } else { int head = 0; // Insert so list is from low to high if (cur == l->head) { l->head = NULL; head = 1; } else l->cur = prev; ilist_append(l, num, 1, aux); if (head) l->cur->next = prev; else l->cur->next = cur; return 1; } } if (prev) l->cur = prev; /* No matches, append to the end */ ilist_append(l, num, 1, aux); return 1; } // If lprev would be NULL, use l->head static void swap_nodes(int_node *lprev, int_node *left, int_node *right) { int_node *t = right->next; if (lprev) lprev->next = right; right->next = left; left->next = t; } // This will sort the list from most hits to least void ilist_sort_by_hits(ilist *l) { register int_node* cur, *prev; if (l->cnt <= 1) return; prev = cur = l->head; while (cur && cur->next) { /* If the next node is bigger */ if (cur->hits < cur->next->hits) { if (cur == l->head) { // Update the actual list head l->head = cur->next; prev = NULL; } swap_nodes(prev, cur, cur->next); // start over prev = cur = l->head; continue; } prev = cur; cur = cur->next; } // End with cur pointing at first record l->cur = l->head; } audit-4.0.2/src/ausearch-options.h0000644001034500103450000000306114655201403012530 /* ausearch-options.h -- * Copyright 2005,2008,2010 Red Hat Inc., Durham, North Carolina. * All Rights Reserved. * * 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 * * Authors: * Steve Grubb * */ #ifndef AUSEARCH_OPTIONS_H #define AUSEARCH_OPTIONS_H #include #include #include #include "ausearch-common.h" #include "ausearch-int.h" /* Global variables that describe what search is to be performed */ extern const char *event_key; extern const char *event_subject; extern const char *event_object; extern int event_se; extern int just_one; extern int line_buffered; extern int event_debug; extern pid_t event_ppid; extern uint32_t event_session_id; extern ilist *event_type; /* Data type to govern output format */ extern report_t report_format; /* Function to process commandline options */ extern int check_params(int count, char *vars[]); #endif audit-4.0.2/src/aureport-scan.h0000644001034500103450000000355114655201403012033 /* aureport-scan.h -- * Copyright 2005-06,2008,2014 Red Hat Inc., Durham, North Carolina. * All Rights Reserved. * * 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 * * Authors: * Steve Grubb * */ #ifndef AUREPORT_SCAN_H #define AUREPORT_SCAN_H #include "ausearch-llist.h" #include "ausearch-int.h" typedef struct sdata { slist users; slist terms; slist files; slist hosts; slist exes; slist comms; slist avc_objs; slist keys; ilist pids; slist sys_list; ilist anom_list; ilist resp_list; ilist mac_list; ilist crypto_list; ilist virt_list; ilist integ_list; unsigned long changes; unsigned long crypto; unsigned long acct_changes; unsigned long good_logins; unsigned long bad_logins; unsigned long good_auth; unsigned long bad_auth; unsigned long events; unsigned long avcs; unsigned long mac; unsigned long failed_syscalls; unsigned long anomalies; unsigned long responses; unsigned long virt; unsigned long integ; } summary_data; void reset_counters(void); void destroy_counters(void); int scan(llist *l); int per_event_processing(llist *l); void print_title(void); void print_per_event_item(llist *l); void print_wrap_up(void); extern summary_data sd; #endif audit-4.0.2/src/Makefile.in0000644001034500103450000016343114655201425011154 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am-- # Copyright 2004-2006, 2008,2011-16,2018 Red Hat Inc. # All Rights Reserved. # # 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; see the file COPYING. If not, write to the # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor # Boston, MA 02110-1335, USA. # # Authors: # Steve Grubb # 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@ sbin_PROGRAMS = auditd$(EXEEXT) auditctl$(EXEEXT) aureport$(EXEEXT) \ ausearch$(EXEEXT) @ENABLE_LISTENER_TRUE@am__append_1 = auditd-listen.c subdir = src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prog_cc_for_build.m4 \ $(top_srcdir)/m4/cap-ng.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/src/libev/libev.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(sbindir)" PROGRAMS = $(sbin_PROGRAMS) am_auditctl_OBJECTS = auditctl-auditctl.$(OBJEXT) \ auditctl-auditctl-llist.$(OBJEXT) \ auditctl-delete_all.$(OBJEXT) \ auditctl-auditctl-listing.$(OBJEXT) auditctl_OBJECTS = $(am_auditctl_OBJECTS) auditctl_DEPENDENCIES = ${top_builddir}/lib/libaudit.la \ ${top_builddir}/auparse/libauparse.la \ ${top_builddir}/common/libaucommon.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = auditctl_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(auditctl_CFLAGS) \ $(CFLAGS) $(auditctl_LDFLAGS) $(LDFLAGS) -o $@ am__auditd_SOURCES_DIST = auditd.c auditd-event.c auditd-config.c \ auditd-reconfig.c auditd-sendmail.c auditd-dispatch.c \ auditd-listen.c @ENABLE_LISTENER_TRUE@am__objects_1 = auditd-auditd-listen.$(OBJEXT) am_auditd_OBJECTS = auditd-auditd.$(OBJEXT) \ auditd-auditd-event.$(OBJEXT) auditd-auditd-config.$(OBJEXT) \ auditd-auditd-reconfig.$(OBJEXT) \ auditd-auditd-sendmail.$(OBJEXT) \ auditd-auditd-dispatch.$(OBJEXT) $(am__objects_1) auditd_OBJECTS = $(am_auditd_OBJECTS) am__DEPENDENCIES_1 = auditd_DEPENDENCIES = ${top_builddir}/src/libev/libev.la \ ${top_builddir}/audisp/libdisp.la \ ${top_builddir}/lib/libaudit.la \ ${top_builddir}/auparse/libauparse.la $(am__DEPENDENCIES_1) \ ${top_builddir}/common/libaucommon.la auditd_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(auditd_CFLAGS) $(CFLAGS) \ $(auditd_LDFLAGS) $(LDFLAGS) -o $@ am_aureport_OBJECTS = aureport.$(OBJEXT) auditd-config.$(OBJEXT) \ ausearch-llist.$(OBJEXT) aureport-options.$(OBJEXT) \ ausearch-string.$(OBJEXT) ausearch-parse.$(OBJEXT) \ aureport-scan.$(OBJEXT) aureport-output.$(OBJEXT) \ ausearch-lookup.$(OBJEXT) ausearch-int.$(OBJEXT) \ ausearch-time.$(OBJEXT) ausearch-nvpair.$(OBJEXT) \ ausearch-avc.$(OBJEXT) ausearch-lol.$(OBJEXT) aureport_OBJECTS = $(am_aureport_OBJECTS) aureport_DEPENDENCIES = ${top_builddir}/lib/libaudit.la \ ${top_builddir}/auparse/libauparse.la \ ${top_builddir}/common/libaucommon.la am_ausearch_OBJECTS = ausearch.$(OBJEXT) auditd-config.$(OBJEXT) \ ausearch-llist.$(OBJEXT) ausearch-options.$(OBJEXT) \ ausearch-report.$(OBJEXT) ausearch-match.$(OBJEXT) \ ausearch-string.$(OBJEXT) ausearch-parse.$(OBJEXT) \ ausearch-int.$(OBJEXT) ausearch-time.$(OBJEXT) \ ausearch-nvpair.$(OBJEXT) ausearch-lookup.$(OBJEXT) \ ausearch-avc.$(OBJEXT) ausearch-lol.$(OBJEXT) \ ausearch-checkpt.$(OBJEXT) ausearch_OBJECTS = $(am_ausearch_OBJECTS) ausearch_DEPENDENCIES = ${top_builddir}/lib/libaudit.la \ ${top_builddir}/auparse/libauparse.la \ ${top_builddir}/common/libaucommon.la AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/auditctl-auditctl-listing.Po \ ./$(DEPDIR)/auditctl-auditctl-llist.Po \ ./$(DEPDIR)/auditctl-auditctl.Po \ ./$(DEPDIR)/auditctl-delete_all.Po \ ./$(DEPDIR)/auditd-auditd-config.Po \ ./$(DEPDIR)/auditd-auditd-dispatch.Po \ ./$(DEPDIR)/auditd-auditd-event.Po \ ./$(DEPDIR)/auditd-auditd-listen.Po \ ./$(DEPDIR)/auditd-auditd-reconfig.Po \ ./$(DEPDIR)/auditd-auditd-sendmail.Po \ ./$(DEPDIR)/auditd-auditd.Po ./$(DEPDIR)/auditd-config.Po \ ./$(DEPDIR)/aureport-options.Po ./$(DEPDIR)/aureport-output.Po \ ./$(DEPDIR)/aureport-scan.Po ./$(DEPDIR)/aureport.Po \ ./$(DEPDIR)/ausearch-avc.Po ./$(DEPDIR)/ausearch-checkpt.Po \ ./$(DEPDIR)/ausearch-int.Po ./$(DEPDIR)/ausearch-llist.Po \ ./$(DEPDIR)/ausearch-lol.Po ./$(DEPDIR)/ausearch-lookup.Po \ ./$(DEPDIR)/ausearch-match.Po ./$(DEPDIR)/ausearch-nvpair.Po \ ./$(DEPDIR)/ausearch-options.Po ./$(DEPDIR)/ausearch-parse.Po \ ./$(DEPDIR)/ausearch-report.Po ./$(DEPDIR)/ausearch-string.Po \ ./$(DEPDIR)/ausearch-time.Po ./$(DEPDIR)/ausearch.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(auditctl_SOURCES) $(auditd_SOURCES) $(aureport_SOURCES) \ $(ausearch_SOURCES) DIST_SOURCES = $(auditctl_SOURCES) $(am__auditd_SOURCES_DIST) \ $(aureport_SOURCES) $(ausearch_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILD_EXEEXT = @BUILD_EXEEXT@ BUILD_OBJEXT = @BUILD_OBJEXT@ CAPNG_LDADD = @CAPNG_LDADD@ CAPNG_PKG = @CAPNG_PKG@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_FOR_BUILD = @CC_FOR_BUILD@ CFLAGS = @CFLAGS@ CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ CPP_FOR_BUILD = @CPP_FOR_BUILD@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG = @DEBUG@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GOLANG = @GOLANG@ GOROOT = @GOROOT@ 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@ LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBWRAP_LIBS = @LIBWRAP_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PYTHON = @PYTHON@ PYTHON3_CFLAGS = @PYTHON3_CFLAGS@ PYTHON3_INCLUDES = @PYTHON3_INCLUDES@ PYTHON3_LIBS = @PYTHON3_LIBS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ VERSION = @VERSION@ WFLAGS = @WFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CC_FOR_BUILD = @ac_ct_CC_FOR_BUILD@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gss_libs = @gss_libs@ 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@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ use_python3 = @use_python3@ CONFIG_CLEAN_FILES = *.rej *.orig SUBDIRS = test AM_CPPFLAGS = -I${top_srcdir} -I${top_srcdir}/lib -I${top_srcdir}/src/libev -I${top_srcdir}/auparse -I${top_srcdir}/audisp -I${top_srcdir}/common AM_CFLAGS = -D_GNU_SOURCE -Wno-pointer-sign ${WFLAGS} noinst_HEADERS = auditd-config.h auditd-event.h auditd-listen.h ausearch-llist.h ausearch-options.h auditctl-llist.h aureport-options.h ausearch-parse.h aureport-scan.h ausearch-lookup.h ausearch-int.h auditd-dispatch.h ausearch-string.h ausearch-nvpair.h ausearch-common.h ausearch-avc.h ausearch-time.h ausearch-lol.h auditctl-listing.h ausearch-checkpt.h auditd_SOURCES = auditd.c auditd-event.c auditd-config.c \ auditd-reconfig.c auditd-sendmail.c auditd-dispatch.c \ $(am__append_1) auditd_CFLAGS = -fPIE -DPIE -g -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pthread -Wno-pointer-sign ${WFLAGS} auditd_LDFLAGS = -pie -Wl,-z,relro -Wl,-z,now auditd_LDADD = @LIBWRAP_LIBS@ ${top_builddir}/src/libev/libev.la ${top_builddir}/audisp/libdisp.la ${top_builddir}/lib/libaudit.la ${top_builddir}/auparse/libauparse.la -lpthread -lm $(gss_libs) ${top_builddir}/common/libaucommon.la auditctl_SOURCES = auditctl.c auditctl-llist.c delete_all.c auditctl-listing.c auditctl_CFLAGS = -fPIE -DPIE -g -D_GNU_SOURCE ${WFLAGS} auditctl_LDFLAGS = -pie -Wl,-z,relro -Wl,-z,now auditctl_LDADD = ${top_builddir}/lib/libaudit.la ${top_builddir}/auparse/libauparse.la ${top_builddir}/common/libaucommon.la aureport_SOURCES = aureport.c auditd-config.c ausearch-llist.c aureport-options.c ausearch-string.c ausearch-parse.c aureport-scan.c aureport-output.c ausearch-lookup.c ausearch-int.c ausearch-time.c ausearch-nvpair.c ausearch-avc.c ausearch-lol.c aureport_LDADD = ${top_builddir}/lib/libaudit.la ${top_builddir}/auparse/libauparse.la ${top_builddir}/common/libaucommon.la ausearch_SOURCES = ausearch.c auditd-config.c ausearch-llist.c ausearch-options.c ausearch-report.c ausearch-match.c ausearch-string.c ausearch-parse.c ausearch-int.c ausearch-time.c ausearch-nvpair.c ausearch-lookup.c ausearch-avc.c ausearch-lol.c ausearch-checkpt.c ausearch_LDADD = ${top_builddir}/lib/libaudit.la ${top_builddir}/auparse/libauparse.la ${top_builddir}/common/libaucommon.la all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(sbindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ } \ ; done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(sbindir)" && rm -f $$files clean-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list auditctl$(EXEEXT): $(auditctl_OBJECTS) $(auditctl_DEPENDENCIES) $(EXTRA_auditctl_DEPENDENCIES) @rm -f auditctl$(EXEEXT) $(AM_V_CCLD)$(auditctl_LINK) $(auditctl_OBJECTS) $(auditctl_LDADD) $(LIBS) auditd$(EXEEXT): $(auditd_OBJECTS) $(auditd_DEPENDENCIES) $(EXTRA_auditd_DEPENDENCIES) @rm -f auditd$(EXEEXT) $(AM_V_CCLD)$(auditd_LINK) $(auditd_OBJECTS) $(auditd_LDADD) $(LIBS) aureport$(EXEEXT): $(aureport_OBJECTS) $(aureport_DEPENDENCIES) $(EXTRA_aureport_DEPENDENCIES) @rm -f aureport$(EXEEXT) $(AM_V_CCLD)$(LINK) $(aureport_OBJECTS) $(aureport_LDADD) $(LIBS) ausearch$(EXEEXT): $(ausearch_OBJECTS) $(ausearch_DEPENDENCIES) $(EXTRA_ausearch_DEPENDENCIES) @rm -f ausearch$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ausearch_OBJECTS) $(ausearch_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/auditctl-auditctl-listing.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/auditctl-auditctl-llist.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/auditctl-auditctl.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/auditctl-delete_all.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/auditd-auditd-config.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/auditd-auditd-dispatch.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/auditd-auditd-event.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/auditd-auditd-listen.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/auditd-auditd-reconfig.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/auditd-auditd-sendmail.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/auditd-auditd.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/auditd-config.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aureport-options.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aureport-output.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aureport-scan.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aureport.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ausearch-avc.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ausearch-checkpt.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ausearch-int.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ausearch-llist.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ausearch-lol.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ausearch-lookup.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ausearch-match.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ausearch-nvpair.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ausearch-options.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ausearch-parse.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ausearch-report.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ausearch-string.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ausearch-time.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ausearch.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< auditctl-auditctl.o: auditctl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(auditctl_CFLAGS) $(CFLAGS) -MT auditctl-auditctl.o -MD -MP -MF $(DEPDIR)/auditctl-auditctl.Tpo -c -o auditctl-auditctl.o `test -f 'auditctl.c' || echo '$(srcdir)/'`auditctl.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/auditctl-auditctl.Tpo $(DEPDIR)/auditctl-auditctl.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='auditctl.c' object='auditctl-auditctl.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(auditctl_CFLAGS) $(CFLAGS) -c -o auditctl-auditctl.o `test -f 'auditctl.c' || echo '$(srcdir)/'`auditctl.c auditctl-auditctl.obj: auditctl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(auditctl_CFLAGS) $(CFLAGS) -MT auditctl-auditctl.obj -MD -MP -MF $(DEPDIR)/auditctl-auditctl.Tpo -c -o auditctl-auditctl.obj `if test -f 'auditctl.c'; then $(CYGPATH_W) 'auditctl.c'; else $(CYGPATH_W) '$(srcdir)/auditctl.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/auditctl-auditctl.Tpo $(DEPDIR)/auditctl-auditctl.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='auditctl.c' object='auditctl-auditctl.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(auditctl_CFLAGS) $(CFLAGS) -c -o auditctl-auditctl.obj `if test -f 'auditctl.c'; then $(CYGPATH_W) 'auditctl.c'; else $(CYGPATH_W) '$(srcdir)/auditctl.c'; fi` auditctl-auditctl-llist.o: auditctl-llist.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(auditctl_CFLAGS) $(CFLAGS) -MT auditctl-auditctl-llist.o -MD -MP -MF $(DEPDIR)/auditctl-auditctl-llist.Tpo -c -o auditctl-auditctl-llist.o `test -f 'auditctl-llist.c' || echo '$(srcdir)/'`auditctl-llist.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/auditctl-auditctl-llist.Tpo $(DEPDIR)/auditctl-auditctl-llist.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='auditctl-llist.c' object='auditctl-auditctl-llist.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(auditctl_CFLAGS) $(CFLAGS) -c -o auditctl-auditctl-llist.o `test -f 'auditctl-llist.c' || echo '$(srcdir)/'`auditctl-llist.c auditctl-auditctl-llist.obj: auditctl-llist.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(auditctl_CFLAGS) $(CFLAGS) -MT auditctl-auditctl-llist.obj -MD -MP -MF $(DEPDIR)/auditctl-auditctl-llist.Tpo -c -o auditctl-auditctl-llist.obj `if test -f 'auditctl-llist.c'; then $(CYGPATH_W) 'auditctl-llist.c'; else $(CYGPATH_W) '$(srcdir)/auditctl-llist.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/auditctl-auditctl-llist.Tpo $(DEPDIR)/auditctl-auditctl-llist.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='auditctl-llist.c' object='auditctl-auditctl-llist.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(auditctl_CFLAGS) $(CFLAGS) -c -o auditctl-auditctl-llist.obj `if test -f 'auditctl-llist.c'; then $(CYGPATH_W) 'auditctl-llist.c'; else $(CYGPATH_W) '$(srcdir)/auditctl-llist.c'; fi` auditctl-delete_all.o: delete_all.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(auditctl_CFLAGS) $(CFLAGS) -MT auditctl-delete_all.o -MD -MP -MF $(DEPDIR)/auditctl-delete_all.Tpo -c -o auditctl-delete_all.o `test -f 'delete_all.c' || echo '$(srcdir)/'`delete_all.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/auditctl-delete_all.Tpo $(DEPDIR)/auditctl-delete_all.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='delete_all.c' object='auditctl-delete_all.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(auditctl_CFLAGS) $(CFLAGS) -c -o auditctl-delete_all.o `test -f 'delete_all.c' || echo '$(srcdir)/'`delete_all.c auditctl-delete_all.obj: delete_all.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(auditctl_CFLAGS) $(CFLAGS) -MT auditctl-delete_all.obj -MD -MP -MF $(DEPDIR)/auditctl-delete_all.Tpo -c -o auditctl-delete_all.obj `if test -f 'delete_all.c'; then $(CYGPATH_W) 'delete_all.c'; else $(CYGPATH_W) '$(srcdir)/delete_all.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/auditctl-delete_all.Tpo $(DEPDIR)/auditctl-delete_all.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='delete_all.c' object='auditctl-delete_all.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(auditctl_CFLAGS) $(CFLAGS) -c -o auditctl-delete_all.obj `if test -f 'delete_all.c'; then $(CYGPATH_W) 'delete_all.c'; else $(CYGPATH_W) '$(srcdir)/delete_all.c'; fi` auditctl-auditctl-listing.o: auditctl-listing.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(auditctl_CFLAGS) $(CFLAGS) -MT auditctl-auditctl-listing.o -MD -MP -MF $(DEPDIR)/auditctl-auditctl-listing.Tpo -c -o auditctl-auditctl-listing.o `test -f 'auditctl-listing.c' || echo '$(srcdir)/'`auditctl-listing.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/auditctl-auditctl-listing.Tpo $(DEPDIR)/auditctl-auditctl-listing.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='auditctl-listing.c' object='auditctl-auditctl-listing.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(auditctl_CFLAGS) $(CFLAGS) -c -o auditctl-auditctl-listing.o `test -f 'auditctl-listing.c' || echo '$(srcdir)/'`auditctl-listing.c auditctl-auditctl-listing.obj: auditctl-listing.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(auditctl_CFLAGS) $(CFLAGS) -MT auditctl-auditctl-listing.obj -MD -MP -MF $(DEPDIR)/auditctl-auditctl-listing.Tpo -c -o auditctl-auditctl-listing.obj `if test -f 'auditctl-listing.c'; then $(CYGPATH_W) 'auditctl-listing.c'; else $(CYGPATH_W) '$(srcdir)/auditctl-listing.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/auditctl-auditctl-listing.Tpo $(DEPDIR)/auditctl-auditctl-listing.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='auditctl-listing.c' object='auditctl-auditctl-listing.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(auditctl_CFLAGS) $(CFLAGS) -c -o auditctl-auditctl-listing.obj `if test -f 'auditctl-listing.c'; then $(CYGPATH_W) 'auditctl-listing.c'; else $(CYGPATH_W) '$(srcdir)/auditctl-listing.c'; fi` auditd-auditd.o: auditd.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(auditd_CFLAGS) $(CFLAGS) -MT auditd-auditd.o -MD -MP -MF $(DEPDIR)/auditd-auditd.Tpo -c -o auditd-auditd.o `test -f 'auditd.c' || echo '$(srcdir)/'`auditd.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/auditd-auditd.Tpo $(DEPDIR)/auditd-auditd.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='auditd.c' object='auditd-auditd.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(auditd_CFLAGS) $(CFLAGS) -c -o auditd-auditd.o `test -f 'auditd.c' || echo '$(srcdir)/'`auditd.c auditd-auditd.obj: auditd.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(auditd_CFLAGS) $(CFLAGS) -MT auditd-auditd.obj -MD -MP -MF $(DEPDIR)/auditd-auditd.Tpo -c -o auditd-auditd.obj `if test -f 'auditd.c'; then $(CYGPATH_W) 'auditd.c'; else $(CYGPATH_W) '$(srcdir)/auditd.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/auditd-auditd.Tpo $(DEPDIR)/auditd-auditd.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='auditd.c' object='auditd-auditd.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(auditd_CFLAGS) $(CFLAGS) -c -o auditd-auditd.obj `if test -f 'auditd.c'; then $(CYGPATH_W) 'auditd.c'; else $(CYGPATH_W) '$(srcdir)/auditd.c'; fi` auditd-auditd-event.o: auditd-event.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(auditd_CFLAGS) $(CFLAGS) -MT auditd-auditd-event.o -MD -MP -MF $(DEPDIR)/auditd-auditd-event.Tpo -c -o auditd-auditd-event.o `test -f 'auditd-event.c' || echo '$(srcdir)/'`auditd-event.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/auditd-auditd-event.Tpo $(DEPDIR)/auditd-auditd-event.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='auditd-event.c' object='auditd-auditd-event.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(auditd_CFLAGS) $(CFLAGS) -c -o auditd-auditd-event.o `test -f 'auditd-event.c' || echo '$(srcdir)/'`auditd-event.c auditd-auditd-event.obj: auditd-event.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(auditd_CFLAGS) $(CFLAGS) -MT auditd-auditd-event.obj -MD -MP -MF $(DEPDIR)/auditd-auditd-event.Tpo -c -o auditd-auditd-event.obj `if test -f 'auditd-event.c'; then $(CYGPATH_W) 'auditd-event.c'; else $(CYGPATH_W) '$(srcdir)/auditd-event.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/auditd-auditd-event.Tpo $(DEPDIR)/auditd-auditd-event.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='auditd-event.c' object='auditd-auditd-event.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(auditd_CFLAGS) $(CFLAGS) -c -o auditd-auditd-event.obj `if test -f 'auditd-event.c'; then $(CYGPATH_W) 'auditd-event.c'; else $(CYGPATH_W) '$(srcdir)/auditd-event.c'; fi` auditd-auditd-config.o: auditd-config.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(auditd_CFLAGS) $(CFLAGS) -MT auditd-auditd-config.o -MD -MP -MF $(DEPDIR)/auditd-auditd-config.Tpo -c -o auditd-auditd-config.o `test -f 'auditd-config.c' || echo '$(srcdir)/'`auditd-config.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/auditd-auditd-config.Tpo $(DEPDIR)/auditd-auditd-config.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='auditd-config.c' object='auditd-auditd-config.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(auditd_CFLAGS) $(CFLAGS) -c -o auditd-auditd-config.o `test -f 'auditd-config.c' || echo '$(srcdir)/'`auditd-config.c auditd-auditd-config.obj: auditd-config.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(auditd_CFLAGS) $(CFLAGS) -MT auditd-auditd-config.obj -MD -MP -MF $(DEPDIR)/auditd-auditd-config.Tpo -c -o auditd-auditd-config.obj `if test -f 'auditd-config.c'; then $(CYGPATH_W) 'auditd-config.c'; else $(CYGPATH_W) '$(srcdir)/auditd-config.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/auditd-auditd-config.Tpo $(DEPDIR)/auditd-auditd-config.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='auditd-config.c' object='auditd-auditd-config.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(auditd_CFLAGS) $(CFLAGS) -c -o auditd-auditd-config.obj `if test -f 'auditd-config.c'; then $(CYGPATH_W) 'auditd-config.c'; else $(CYGPATH_W) '$(srcdir)/auditd-config.c'; fi` auditd-auditd-reconfig.o: auditd-reconfig.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(auditd_CFLAGS) $(CFLAGS) -MT auditd-auditd-reconfig.o -MD -MP -MF $(DEPDIR)/auditd-auditd-reconfig.Tpo -c -o auditd-auditd-reconfig.o `test -f 'auditd-reconfig.c' || echo '$(srcdir)/'`auditd-reconfig.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/auditd-auditd-reconfig.Tpo $(DEPDIR)/auditd-auditd-reconfig.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='auditd-reconfig.c' object='auditd-auditd-reconfig.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(auditd_CFLAGS) $(CFLAGS) -c -o auditd-auditd-reconfig.o `test -f 'auditd-reconfig.c' || echo '$(srcdir)/'`auditd-reconfig.c auditd-auditd-reconfig.obj: auditd-reconfig.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(auditd_CFLAGS) $(CFLAGS) -MT auditd-auditd-reconfig.obj -MD -MP -MF $(DEPDIR)/auditd-auditd-reconfig.Tpo -c -o auditd-auditd-reconfig.obj `if test -f 'auditd-reconfig.c'; then $(CYGPATH_W) 'auditd-reconfig.c'; else $(CYGPATH_W) '$(srcdir)/auditd-reconfig.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/auditd-auditd-reconfig.Tpo $(DEPDIR)/auditd-auditd-reconfig.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='auditd-reconfig.c' object='auditd-auditd-reconfig.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(auditd_CFLAGS) $(CFLAGS) -c -o auditd-auditd-reconfig.obj `if test -f 'auditd-reconfig.c'; then $(CYGPATH_W) 'auditd-reconfig.c'; else $(CYGPATH_W) '$(srcdir)/auditd-reconfig.c'; fi` auditd-auditd-sendmail.o: auditd-sendmail.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(auditd_CFLAGS) $(CFLAGS) -MT auditd-auditd-sendmail.o -MD -MP -MF $(DEPDIR)/auditd-auditd-sendmail.Tpo -c -o auditd-auditd-sendmail.o `test -f 'auditd-sendmail.c' || echo '$(srcdir)/'`auditd-sendmail.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/auditd-auditd-sendmail.Tpo $(DEPDIR)/auditd-auditd-sendmail.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='auditd-sendmail.c' object='auditd-auditd-sendmail.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(auditd_CFLAGS) $(CFLAGS) -c -o auditd-auditd-sendmail.o `test -f 'auditd-sendmail.c' || echo '$(srcdir)/'`auditd-sendmail.c auditd-auditd-sendmail.obj: auditd-sendmail.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(auditd_CFLAGS) $(CFLAGS) -MT auditd-auditd-sendmail.obj -MD -MP -MF $(DEPDIR)/auditd-auditd-sendmail.Tpo -c -o auditd-auditd-sendmail.obj `if test -f 'auditd-sendmail.c'; then $(CYGPATH_W) 'auditd-sendmail.c'; else $(CYGPATH_W) '$(srcdir)/auditd-sendmail.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/auditd-auditd-sendmail.Tpo $(DEPDIR)/auditd-auditd-sendmail.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='auditd-sendmail.c' object='auditd-auditd-sendmail.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(auditd_CFLAGS) $(CFLAGS) -c -o auditd-auditd-sendmail.obj `if test -f 'auditd-sendmail.c'; then $(CYGPATH_W) 'auditd-sendmail.c'; else $(CYGPATH_W) '$(srcdir)/auditd-sendmail.c'; fi` auditd-auditd-dispatch.o: auditd-dispatch.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(auditd_CFLAGS) $(CFLAGS) -MT auditd-auditd-dispatch.o -MD -MP -MF $(DEPDIR)/auditd-auditd-dispatch.Tpo -c -o auditd-auditd-dispatch.o `test -f 'auditd-dispatch.c' || echo '$(srcdir)/'`auditd-dispatch.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/auditd-auditd-dispatch.Tpo $(DEPDIR)/auditd-auditd-dispatch.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='auditd-dispatch.c' object='auditd-auditd-dispatch.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(auditd_CFLAGS) $(CFLAGS) -c -o auditd-auditd-dispatch.o `test -f 'auditd-dispatch.c' || echo '$(srcdir)/'`auditd-dispatch.c auditd-auditd-dispatch.obj: auditd-dispatch.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(auditd_CFLAGS) $(CFLAGS) -MT auditd-auditd-dispatch.obj -MD -MP -MF $(DEPDIR)/auditd-auditd-dispatch.Tpo -c -o auditd-auditd-dispatch.obj `if test -f 'auditd-dispatch.c'; then $(CYGPATH_W) 'auditd-dispatch.c'; else $(CYGPATH_W) '$(srcdir)/auditd-dispatch.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/auditd-auditd-dispatch.Tpo $(DEPDIR)/auditd-auditd-dispatch.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='auditd-dispatch.c' object='auditd-auditd-dispatch.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(auditd_CFLAGS) $(CFLAGS) -c -o auditd-auditd-dispatch.obj `if test -f 'auditd-dispatch.c'; then $(CYGPATH_W) 'auditd-dispatch.c'; else $(CYGPATH_W) '$(srcdir)/auditd-dispatch.c'; fi` auditd-auditd-listen.o: auditd-listen.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(auditd_CFLAGS) $(CFLAGS) -MT auditd-auditd-listen.o -MD -MP -MF $(DEPDIR)/auditd-auditd-listen.Tpo -c -o auditd-auditd-listen.o `test -f 'auditd-listen.c' || echo '$(srcdir)/'`auditd-listen.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/auditd-auditd-listen.Tpo $(DEPDIR)/auditd-auditd-listen.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='auditd-listen.c' object='auditd-auditd-listen.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(auditd_CFLAGS) $(CFLAGS) -c -o auditd-auditd-listen.o `test -f 'auditd-listen.c' || echo '$(srcdir)/'`auditd-listen.c auditd-auditd-listen.obj: auditd-listen.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(auditd_CFLAGS) $(CFLAGS) -MT auditd-auditd-listen.obj -MD -MP -MF $(DEPDIR)/auditd-auditd-listen.Tpo -c -o auditd-auditd-listen.obj `if test -f 'auditd-listen.c'; then $(CYGPATH_W) 'auditd-listen.c'; else $(CYGPATH_W) '$(srcdir)/auditd-listen.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/auditd-auditd-listen.Tpo $(DEPDIR)/auditd-auditd-listen.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='auditd-listen.c' object='auditd-auditd-listen.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(auditd_CFLAGS) $(CFLAGS) -c -o auditd-auditd-listen.obj `if test -f 'auditd-listen.c'; then $(CYGPATH_W) 'auditd-listen.c'; else $(CYGPATH_W) '$(srcdir)/auditd-listen.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(PROGRAMS) $(HEADERS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(sbindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool clean-sbinPROGRAMS \ mostlyclean-am distclean: distclean-recursive -rm -f ./$(DEPDIR)/auditctl-auditctl-listing.Po -rm -f ./$(DEPDIR)/auditctl-auditctl-llist.Po -rm -f ./$(DEPDIR)/auditctl-auditctl.Po -rm -f ./$(DEPDIR)/auditctl-delete_all.Po -rm -f ./$(DEPDIR)/auditd-auditd-config.Po -rm -f ./$(DEPDIR)/auditd-auditd-dispatch.Po -rm -f ./$(DEPDIR)/auditd-auditd-event.Po -rm -f ./$(DEPDIR)/auditd-auditd-listen.Po -rm -f ./$(DEPDIR)/auditd-auditd-reconfig.Po -rm -f ./$(DEPDIR)/auditd-auditd-sendmail.Po -rm -f ./$(DEPDIR)/auditd-auditd.Po -rm -f ./$(DEPDIR)/auditd-config.Po -rm -f ./$(DEPDIR)/aureport-options.Po -rm -f ./$(DEPDIR)/aureport-output.Po -rm -f ./$(DEPDIR)/aureport-scan.Po -rm -f ./$(DEPDIR)/aureport.Po -rm -f ./$(DEPDIR)/ausearch-avc.Po -rm -f ./$(DEPDIR)/ausearch-checkpt.Po -rm -f ./$(DEPDIR)/ausearch-int.Po -rm -f ./$(DEPDIR)/ausearch-llist.Po -rm -f ./$(DEPDIR)/ausearch-lol.Po -rm -f ./$(DEPDIR)/ausearch-lookup.Po -rm -f ./$(DEPDIR)/ausearch-match.Po -rm -f ./$(DEPDIR)/ausearch-nvpair.Po -rm -f ./$(DEPDIR)/ausearch-options.Po -rm -f ./$(DEPDIR)/ausearch-parse.Po -rm -f ./$(DEPDIR)/ausearch-report.Po -rm -f ./$(DEPDIR)/ausearch-string.Po -rm -f ./$(DEPDIR)/ausearch-time.Po -rm -f ./$(DEPDIR)/ausearch.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-sbinPROGRAMS install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f ./$(DEPDIR)/auditctl-auditctl-listing.Po -rm -f ./$(DEPDIR)/auditctl-auditctl-llist.Po -rm -f ./$(DEPDIR)/auditctl-auditctl.Po -rm -f ./$(DEPDIR)/auditctl-delete_all.Po -rm -f ./$(DEPDIR)/auditd-auditd-config.Po -rm -f ./$(DEPDIR)/auditd-auditd-dispatch.Po -rm -f ./$(DEPDIR)/auditd-auditd-event.Po -rm -f ./$(DEPDIR)/auditd-auditd-listen.Po -rm -f ./$(DEPDIR)/auditd-auditd-reconfig.Po -rm -f ./$(DEPDIR)/auditd-auditd-sendmail.Po -rm -f ./$(DEPDIR)/auditd-auditd.Po -rm -f ./$(DEPDIR)/auditd-config.Po -rm -f ./$(DEPDIR)/aureport-options.Po -rm -f ./$(DEPDIR)/aureport-output.Po -rm -f ./$(DEPDIR)/aureport-scan.Po -rm -f ./$(DEPDIR)/aureport.Po -rm -f ./$(DEPDIR)/ausearch-avc.Po -rm -f ./$(DEPDIR)/ausearch-checkpt.Po -rm -f ./$(DEPDIR)/ausearch-int.Po -rm -f ./$(DEPDIR)/ausearch-llist.Po -rm -f ./$(DEPDIR)/ausearch-lol.Po -rm -f ./$(DEPDIR)/ausearch-lookup.Po -rm -f ./$(DEPDIR)/ausearch-match.Po -rm -f ./$(DEPDIR)/ausearch-nvpair.Po -rm -f ./$(DEPDIR)/ausearch-options.Po -rm -f ./$(DEPDIR)/ausearch-parse.Po -rm -f ./$(DEPDIR)/ausearch-report.Po -rm -f ./$(DEPDIR)/ausearch-string.Po -rm -f ./$(DEPDIR)/ausearch-time.Po -rm -f ./$(DEPDIR)/ausearch.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-sbinPROGRAMS .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--depfiles check check-am clean clean-generic clean-libtool \ clean-sbinPROGRAMS cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-sbinPROGRAMS install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-sbinPROGRAMS .PRECIOUS: Makefile libev/libev.a: make -C libev # 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: audit-4.0.2/src/ausearch-checkpt.c0000644001034500103450000001522714655201403012460 /* * ausearch-checkpt.c - ausearch checkpointing feature * * 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 #include #include #include #include #include #include "ausearch-checkpt.h" #define DBG 0 /* set to non-zero for debug */ #if SIZEOF_LONG < SIZEOF_TIME_T #define TIME_T_SPECIFIER "%lld" #else #define TIME_T_SPECIFIER "%ld" #endif /* Remember why we failed */ unsigned checkpt_failure = 0; /* * Remember the file we were processing when we had incomplete events. * We remember this via it's dev and inode */ static dev_t checkpt_dev = (dev_t)NULL; static ino_t checkpt_ino = (ino_t)NULL; /* Remember the last event output */ static event last_event = {0, 0, 0, NULL, 0}; /* Loaded values from a given checkpoint file */ dev_t chkpt_input_dev = (dev_t)NULL; ino_t chkpt_input_ino = (ino_t)NULL; event chkpt_input_levent = {0, 0, 0, NULL, 0}; /* * Record the dev_t and ino_t of the given file * * Returns: * 1 Failed to get status * 0 OK */ int set_ChkPtFileDetails(const char *fn) { struct stat sbuf; if (stat(fn, &sbuf) != 0) { fprintf(stderr, "Cannot stat audit file for checkpoint " "details - %s: %s\n", fn, strerror(errno)); checkpt_failure |= CP_STATFAILED; return 1; } checkpt_dev = sbuf.st_dev; checkpt_ino = sbuf.st_ino; return 0; } /* * Save the given event in the last_event record * Returns: * 1 no memory * 0 OK */ int set_ChkPtLastEvent(const event *e) { /* Set the event node if necessary */ if (e->node) { if (last_event.node) { if (strcmp(e->node, last_event.node) != 0) { free((void *)last_event.node); last_event.node = strdup(e->node); } } else last_event.node = strdup(e->node); if (last_event.node == NULL) { fprintf(stderr, "No memory to allocate " "checkpoint last event node name\n"); return 1; } } else { if (last_event.node) free((void *)last_event.node); last_event.node = NULL; } last_event.sec = e->sec; last_event.milli = e->milli; last_event.serial = e->serial; last_event.type = e->type; return 0; } /* Free all checkpoint memory */ void free_ChkPtMemory(void) { if (last_event.node) (void)free((void *)last_event.node); last_event.node = NULL; if (chkpt_input_levent.node) (void)free((void *)chkpt_input_levent.node); chkpt_input_levent.node = NULL; } /* * Save the checkpoint to the given file * Returns: * 1 io error * 0 OK */ void save_ChkPt(const char *fn) { FILE *fd; if ((fd = fopen(fn, "w")) == NULL) { fprintf(stderr, "Cannot open checkpoint file - %s: %s\n", fn, strerror(errno)); checkpt_failure |= CP_STATUSIO; return; } // Write the inode in decimal to make ls -i easier to use. fprintf(fd, "dev=0x%X\ninode=%u\n", (unsigned int)checkpt_dev, (unsigned int)checkpt_ino); fprintf(fd, "output=%s %lu.%03u:%lu 0x%X\n", last_event.node ? last_event.node : "-", (long unsigned int)last_event.sec, last_event.milli, last_event.serial, last_event.type); fclose(fd); } /* * Parse a checkpoint file "output=" record * Returns * 1 failed to parse or no memory * 0 parsed OK */ static int parse_checkpt_event(char *lbuf, int ndix, event *e) { char *rest; /* * Find the space after the node, then make it '\0' so * we terminate the node value. We leave 'rest' at the start * of the event time/serial element */ rest = strchr(&lbuf[ndix], ' '); if (rest == NULL) { fprintf(stderr, "Malformed output/event checkpoint line " "near node - [%s]\n", lbuf); checkpt_failure |= CP_STATUSBAD; return 1; } *rest++ = '\0'; if (lbuf[ndix] == '-') e->node = NULL; else { e->node = strdup(&lbuf[ndix]); if (e->node == NULL) { fprintf(stderr, "No memory for node when loading " "checkpoint line - [%s]\n", lbuf); checkpt_failure |= CP_NOMEM; return 1; } } if (sscanf(rest, TIME_T_SPECIFIER ".%03u:%lu 0x%X", &e->sec, &e->milli, &e->serial, &e->type) != 4) { fprintf(stderr, "Malformed output/event checkpoint line " "after node - [%s]\n", lbuf); checkpt_failure |= CP_STATUSBAD; return 1; } return 0; } /* * Load the checkpoint from the given file * Returns: * < -1 error * == -1 no file present * == 0 loaded data */ int load_ChkPt(const char *fn) { #define MAX_LN 1023 FILE *fd; char lbuf[MAX_LN]; if ((fd = fopen(fn, "r")) == NULL) { if (errno == ENOENT) return -1; fprintf(stderr, "Cannot open checkpoint file - %s: %s\n", fn, strerror(errno)); return -2; } chkpt_input_levent.node = NULL; while (fgets(lbuf, MAX_LN, fd) != NULL) { size_t len = strlen(lbuf); if (len && lbuf[len - 1] == '\n') /* drop the newline */ lbuf[len - 1] = '\0'; if (strncmp(lbuf, "dev=", 4) == 0) { errno = 0; chkpt_input_dev = strtoul(&lbuf[4], NULL, 16); if (errno) { fprintf(stderr, "Malformed dev checkpoint " "line - [%s]\n", lbuf); checkpt_failure |= CP_STATUSBAD; break; } } else if (strncmp(lbuf, "inode=", 6) == 0) { errno = 0; chkpt_input_ino = strtoul(&lbuf[6], NULL, 0); if (errno) { fprintf(stderr, "Malformed inode checkpoint " "line - [%s]\n", lbuf); checkpt_failure |= CP_STATUSBAD; break; } } else if (strncmp(lbuf, "output=", 7) == 0) { free((void *)chkpt_input_levent.node); chkpt_input_levent.node = NULL; if (parse_checkpt_event(lbuf, 7, &chkpt_input_levent)) break; } else { fprintf(stderr, "Unknown checkpoint line - [%s]\n", lbuf); checkpt_failure |= CP_STATUSBAD; break; } } if ( (chkpt_input_ino == (ino_t)NULL) || (chkpt_input_dev == (dev_t)NULL) ) { fprintf(stderr, "Missing dev/inode lines from checkpoint " "file %s\n", fn); checkpt_failure |= CP_STATUSBAD; } fclose(fd); if (checkpt_failure) return -3; #if DBG { fprintf(stderr, "Loaded %s - dev: 0x%X, ino: 0x%X\n", fn, chkpt_input_dev, chkpt_input_ino); fprintf(stderr, "output:%s %d.%03d:%lu 0x%X\n", chkpt_input_levent.node ? chkpt_input_levent.node : "-", chkpt_input_levent.sec, chkpt_input_levent.milli, chkpt_input_levent.serial, chkpt_input_levent.type); } #endif /* DBG */ return 0; } audit-4.0.2/src/ausearch-report.c0000644001034500103450000004652714655201403012361 /* * ausearch-report.c - Format and output events * Copyright (c) 2005-09,2011-13,2016-17,2021-23 Red Hat * All Rights Reserved. * * This software may be freely redistributed and/or modified 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, Inc., 51 Franklin Street, Fifth Floor * Boston, MA 02110-1335, USA. * * Authors: * Steve Grubb */ #include "config.h" #include #include #include #include #include "libaudit.h" #include "ausearch-options.h" #include "ausearch-parse.h" #include "ausearch-lookup.h" #include "auparse.h" #include "auparse-idata.h" #include "auditd-config.h" /* Local functions */ static void output_raw(llist *l); static void output_default(llist *l); static void output_interpreted(llist *l); static void output_interpreted_record(const lnode *n, const event *e); static void feed_auparse(llist *l, auparse_callback_ptr callback); static void report_interpret(char *name, char *val, int comma, int rtype); static void csv_event(auparse_state_t *au, auparse_cb_event_t cb_event_type, void *user_data); static void text_event(auparse_state_t *au, auparse_cb_event_t cb_event_type, void *user_data); extern time_t lol_get_eoe_timeout(void); /* The machine based on elf type */ static unsigned long machine = -1; static int cur_syscall = -1; /* The first syscall argument */ static unsigned long long a0, a1; /* tracks state of interpretations */ static int loaded = 0; void ausearch_load_interpretations(const lnode *n) { if (loaded == 0) { _auparse_load_interpretations(n->interp); loaded = 1; } } void ausearch_free_interpretations(void) { if (loaded) { _auparse_free_interpretations(); loaded = 0; } } /* This function branches to the correct output format */ void output_event(llist *l) { switch (report_format) { case RPT_RAW: output_raw(l); break; case RPT_DEFAULT: output_default(l); break; case RPT_INTERP: output_interpreted(l); break; case RPT_PRETTY: break; case RPT_CSV: feed_auparse(l, csv_event); break; case RPT_TEXT: feed_auparse(l, text_event); break; default: fprintf(stderr, "Report format error"); exit(1); } } /* This function will output the record as is */ static void output_raw(llist *l) { const lnode *n; list_first(l); n = list_get_cur(l); if (!n) { fprintf(stderr, "Error - no elements in record."); return; } do { // Only add the separator for enriched events. if (l->fmt == LF_ENRICHED) n->message[n->mlen] = AUDIT_INTERP_SEPARATOR; puts(n->message); } while ((n=list_next(l))); } /* * This function will take the linked list and format it for output. No * interpretation is performed. The output order is lifo for everything. */ static void output_default(llist *l) { const lnode *n; list_last(l); n = list_get_cur(l); printf("----\ntime->%s", ctime(&l->e.sec)); if (!n) { fprintf(stderr, "Error - no elements in record."); return; } if (n->type >= AUDIT_DAEMON_START && n->type < AUDIT_SYSCALL) puts(n->message); // No injection possible else { do { safe_print_string_n(n->message, n->mlen, 1); } while ((n=list_prev(l))); } } /* * This function will take the linked list and format it for output. * Interpretation is performed to aid understanding of records. The output * order is lifo for everything. */ static void output_interpreted(llist *l) { const lnode *n; list_last(l); n = list_get_cur(l); printf("----\n"); if (!n) { fprintf(stderr, "Error - no elements in record."); return; } if (n->type >= AUDIT_DAEMON_START && n->type < AUDIT_SYSCALL) output_interpreted_record(n, &(l->e)); else { do { output_interpreted_record(n, &(l->e)); } while ((n=list_prev(l))); } } /* * This function will cycle through a single record and lookup each field's * value that it finds. */ static void output_interpreted_record(const lnode *n, const event *e) { char *ptr, *str = n->message; int found, comma = 0; int num = n->type; struct tm *btm; char tmp[32]; // Reset these because each record could be different machine = -1; cur_syscall = -1; /* Check and see if we start with a node * If we do, and there is a space in the line * move the pointer to the first character past * the space */ if (e->node) { if ((ptr=strchr(str, ' ')) != NULL) { str = ptr+1; } } // First locate time stamp. ptr = strchr(str, '('); if (ptr == NULL) { fprintf(stderr, "can't find time stamp\n"); return; } *ptr++ = 0; /* move to the start of the timestamp */ // print everything up to it. if (num >= 0) { const char * bptr; bptr = audit_msg_type_to_name(num); if (bptr) { if (e->node) printf("node=%s ", e->node); printf("type=%s msg=audit(", bptr); goto no_print; } } if (e->node) printf("node=%s ", e->node); printf("%s(", str); no_print: str = strchr(ptr, ')'); if(str == NULL) return; *str++ = 0; btm = localtime(&e->sec); if (btm) strftime(tmp, sizeof(tmp), "%x %T", btm); else strcpy(tmp, "?"); printf("%s", tmp); printf(".%03u:%lu) ", e->milli, e->serial); if (n->type == AUDIT_SYSCALL) { a0 = n->a0; a1 = n->a1; } // for each item. ausearch_load_interpretations(n); found = 0; while (str && *str && (ptr = strchr(str, '='))) { char *name, *val; comma = 0; found = 1; // look back to last space - this is name name = ptr; while (*name != ' ' && name > str) --name; *ptr++ = 0; // print everything up to the '=' printf("%s=", str); // Some user messages have msg='uid=500 in this case // skip the msg= piece since the real stuff is the uid= if (strcmp(name, "msg") == 0) { str = ptr; continue; } // In the above case, after msg= we need to trim the ' from uid if (*name == '\'') name++; // get string after = to the next space or end - this is value if (*ptr == '\'' || *ptr == '"') { str = strchr(ptr+1, *ptr); if (str) { str++; if (*str) *str++ = 0; } } else { str = strchr(ptr, ','); val = strchr(ptr, ' '); if (str && val && (str < val)) { // Value side has commas and another field exists // Known: LABEL_LEVEL_CHANGE banners=none,none // Known: ROLL_ASSIGN new-role=r,r // Known: any MAC LABEL can potentially have commas int ftype = auparse_interp_adjust_type(n->type, name, val); if (ftype == AUPARSE_TYPE_MAC_LABEL) { str = val; *str++ = 0; } else { *str++ = 0; comma = 1; } } else if (str && (val == NULL)) { // Goes all the way to the end. Done parsing // Known: MCS context in PATH rec obj=u:r:t:s0:c2,c7 int ftype = auparse_interp_adjust_type(n->type, name, ptr); if (ftype == AUPARSE_TYPE_MAC_LABEL) str = NULL; else { *str++ = 0; comma = 1; } } else if (val) { // There is another field, point to next (normal path) str = val; *str++ = 0; } } // val points to begin & str 1 past end val = ptr; // print interpreted string report_interpret(name, val, comma, n->type); } ausearch_free_interpretations(); // If nothing found, just print out as is if (!found && ptr == NULL && str) safe_print_string(str, 1); // If last field had comma, output the rest else if (comma) safe_print_string(str, 1); printf("\n"); } static void report_interpret(char *name, char *val, int comma, int rtype) { int type; idata id; while (*name == ' '||*name == '(') name++; if (*name == 'a' && strcmp(name, "acct") == 0) { // Remove trailing punctuation int len = strlen(val); if (val[len-1] == ':') val[len-1] = 0; } type = auparse_interp_adjust_type(rtype, name, val); if (rtype == AUDIT_SYSCALL || rtype == AUDIT_SECCOMP || rtype == AUDIT_URINGOP) { if (rtype == AUDIT_URINGOP) machine = MACH_IO_URING; else if (machine == (unsigned long)-1) machine = audit_detect_machine(); if (*name == 'a' && strcmp(name, "arch") == 0) { unsigned long ival; errno = 0; ival = strtoul(val, NULL, 16); if (errno) { printf("arch conversion error(%s) ", val); return; } machine = audit_elf_to_machine(ival); } if (cur_syscall < 0 && ((*name == 's' && strcmp(name, "syscall") == 0) || (*name == 'u' && strcmp(name, "uring_op") == 0))) { unsigned long ival; errno = 0; ival = strtoul(val, NULL, 10); if (errno) { printf("syscall conversion error(%s) ", val); return; } cur_syscall = ival; } id.syscall = cur_syscall; } else id.syscall = 0; id.machine = machine; id.a0 = a0; id.a1 = a1; id.name = name; id.val = val; id.cwd = NULL; char *out = auparse_do_interpretation(type, &id, escape_mode); if (type == AUPARSE_TYPE_UNCLASSIFIED) printf("%s%c", val, comma ? ',' : ' '); else if (name[0] == 'k' && strcmp(name, "key") == 0) { char *str, *ptr = out; int count = 0; while ((str = strchr(ptr, AUDIT_KEY_SEPARATOR))) { *str = 0; if (count == 0) { printf("%s", ptr); count++; } else printf(" key=%s", ptr); ptr = str+1; } if (count == 0) printf("%s ", out); else printf(" key=%s ", ptr); } else if (type == AUPARSE_TYPE_TTY_DATA) printf("%s", out); else printf("%s ", out); free(out); } /* This function will output a normalized line of audit * fields one line per event in csv format */ static int csv_header_done = 0; extern int extra_keys, extra_labels, extra_obj2, extra_time; static void csv_event(auparse_state_t *au, auparse_cb_event_t cb_event_type, void *user_data) { if (cb_event_type != AUPARSE_CB_EVENT_READY) return; if (csv_header_done == 0) { csv_header_done = 1; printf( "NODE,EVENT,DATE,TIME,%sSERIAL_NUM,EVENT_KIND," "SESSION,SUBJ_PRIME,SUBJ_SEC,SUBJ_KIND,%sACTION," "RESULT,OBJ_PRIME,OBJ_SEC,%s%sOBJ_KIND,HOW%s\n", extra_time ? "YEAR,MONTH,DAY,WEEKDAY,HOUR,MILLI,GMT_OFFSET," : "", extra_labels ? "SUBJ_LABEL," : "", extra_obj2 ? "OBJ2," : "", extra_labels ? "OBJ_LABEL," : "", extra_keys ? ",KEY" : ""); } char tmp[20]; const char *item, *type, *evkind, *subj_kind, *action, *str, *how; int rc; time_t t = auparse_get_time(au); struct tm *tv = localtime(&t); // NODE item = auparse_get_node(au); if (item) { printf("%s", auparse_interpret_field(au)); free((void *)item); } putchar(','); // Event type = auparse_get_type_name(au); if (type) printf("%s", type); putchar(','); // Normalize rc = auparse_normalize(au, extra_labels ? NORM_OPT_ALL : NORM_OPT_NO_ATTRS); // DATE if (tv) { strftime(tmp, sizeof(tmp), "%x", tv); printf("%s", tmp); } putchar(','); // TIME if (tv) { strftime(tmp, sizeof(tmp), "%T", tv); printf("%s", tmp); } putchar(','); if (extra_time) { // YEAR if (tv) { strftime(tmp, sizeof(tmp), "%Y", tv); printf("%s", tmp); } putchar(','); // MONTH if (tv) { strftime(tmp, sizeof(tmp), "%m", tv); printf("%s", tmp); } putchar(','); // DAY if (tv) { strftime(tmp, sizeof(tmp), "%d", tv); printf("%s", tmp); } putchar(','); // WEEKDAY if (tv) { strftime(tmp, sizeof(tmp), "%u", tv); printf("%s", tmp); } putchar(','); // HOUR if (tv) { strftime(tmp, sizeof(tmp), "%k", tv); printf("%s", tmp); } putchar(','); // MILLISECOND printf("%u", auparse_get_milli(au)); putchar(','); if (tv) { char sign = tv->tm_gmtoff >= 0 ? '+' : '-'; unsigned long total = labs(tv->tm_gmtoff); unsigned long hour = total/3600; unsigned long min = (total - (hour * 3600))%60; printf("%c%02lu:%02lu", sign, hour, min); } putchar(','); } // SERIAL_NUMBER printf("%lu,", auparse_get_serial(au)); if (rc) { fprintf(stderr, "error normalizing %s\n", type); // Just dump an empty frame printf(",,,,,,,,,%s%s\n", extra_labels ? ",," : "", extra_keys ? "," : ""); return; } // EVENT_KIND evkind = auparse_normalize_get_event_kind(au); printf("%s", evkind ? evkind : "unknown"); putchar(','); // SESSION rc = auparse_normalize_session(au); if (rc == 1) printf("%s", auparse_interpret_field(au)); putchar(','); // SUBJ_PRIME rc = auparse_normalize_subject_primary(au); if (rc == 1) { const char *subj = auparse_interpret_field(au); if (strcmp(subj, "unset") == 0) subj = "system"; printf("%s", subj); } putchar(','); // SUBJ_SEC rc = auparse_normalize_subject_secondary(au); if (rc == 1) printf("%s", auparse_interpret_field(au)); putchar(','); // SUBJ_KIND subj_kind = auparse_normalize_subject_kind(au); if (subj_kind) printf("%s", subj_kind); putchar(','); // SUBJ_LABEL if (extra_labels) { rc = auparse_normalize_subject_first_attribute(au); do { if (rc == 1) { const char *name = auparse_get_field_name(au); if (strcmp(name, "subj") == 0) { printf("%s", auparse_interpret_field(au)); break; } } } while (auparse_normalize_subject_next_attribute(au) == 1); putchar(','); } // ACTION action = auparse_normalize_get_action(au); printf("%s", action ? action : "did-unknown"); putchar(','); // RESULT rc = auparse_normalize_get_results(au); if (rc == 1) { int i = 0; const char *res[] = { "failed", "success" }; item = auparse_interpret_field(au); if (strcmp(item, "yes") == 0) i = 1; else if (strncmp(item, "suc", 3) == 0) i = 1; else if (auparse_get_field_type(au) == AUPARSE_TYPE_SECCOMP && strcmp(item, "allow") == 0) i = 1; printf("%s", res[i]); } putchar(','); // OBJ_PRIME rc = auparse_normalize_object_primary(au); if (rc == 1) { const char *val; if (auparse_get_field_type(au) == AUPARSE_TYPE_ESCAPED_FILE) val = auparse_interpret_realpath(au); else if (auparse_get_type(au) == AUDIT_CONFIG_CHANGE) { if (action && ((strcmp(action, "set") == 0) || (strcmp(action, "seccomp-logging") == 0))) val = auparse_get_field_name(au); else val = auparse_interpret_field(au); } else val = auparse_interpret_field(au); printf("%s", val); } putchar(','); // OBJ_SEC rc = auparse_normalize_object_secondary(au); if (rc == 1) printf("%s", auparse_interpret_field(au)); putchar(','); // OBJECT 2 if (extra_obj2) { rc = auparse_normalize_object_primary2(au); if (rc == 1) { const char *val; if (auparse_get_field_type(au) == AUPARSE_TYPE_ESCAPED_FILE) val = auparse_interpret_realpath(au); else val = auparse_interpret_field(au); printf("%s", val); } putchar(','); } // OBJ_LABEL if (extra_labels) { rc = auparse_normalize_object_first_attribute(au); do { if (rc == 1) { const char *name = auparse_get_field_name(au); if (strcmp(name, "obj") == 0) { printf("%s", auparse_interpret_field(au)); break; } } } while (auparse_normalize_object_next_attribute(au) == 1); putchar(','); } // OBJ_KIND str = auparse_normalize_object_kind(au); printf("%s,", str); // HOW how = auparse_normalize_how(au); if (how) printf("%s", how); // KEY if (extra_keys) { putchar(','); // This is to close out HOW rc = auparse_normalize_key(au); if (rc == 1) printf("%s", auparse_interpret_field(au)); } printf("\n"); } /* This function will output a normalized line of audit * fields one line per event as an english sentence */ static void text_event(auparse_state_t *au, auparse_cb_event_t cb_event_type, void *user_data) { if (cb_event_type != AUPARSE_CB_EVENT_READY) return; char tmp[20]; const char *item, *action, *how; int rc, type, id = -2; time_t t = auparse_get_time(au); struct tm *tv = localtime(&t); if (tv) strftime(tmp, sizeof(tmp), "%T %x", tv); else strcpy(tmp, "?"); type = auparse_get_type(au); auparse_normalize(au, NORM_OPT_NO_ATTRS); item = auparse_get_node(au); if (item) { printf("On %s at %s ", auparse_interpret_field(au), tmp); free((void *)item); } else printf("At %s ", tmp); rc = auparse_normalize_subject_primary(au); if (rc == 1) { const char *subj = auparse_interpret_field(au); id = auparse_get_field_int(au); if (strcmp(subj, "unset") == 0) subj = "system"; printf("%s", subj); } // Need to compare auid and uid before doing this rc = auparse_normalize_subject_secondary(au); if (rc == 1) { int uid = auparse_get_field_int(au); // if they are different, id exists, and uid is not unset if (uid != id && id != -2 && uid != -1) printf(", acting as %s,", auparse_interpret_field(au)); } rc = auparse_normalize_get_results(au); if (rc == 1) { int i = 0; const char *res[] = { "unsuccessfully", "successfully" }; item = auparse_interpret_field(au); if (strcmp(item, "yes") == 0) i = 1; else if (strncmp(item, "suc", 3) == 0) i = 1; else if (auparse_get_field_type(au) == AUPARSE_TYPE_SECCOMP && strcmp(item, "allow") == 0) i = 1; printf(" %s ", res[i]); } else putchar(' '); action = auparse_normalize_get_action(au); if (event_debug) { if (action == NULL) printf("error on type:%d\n", type); } printf("%s ", action ? action : "did-unknown"); rc = auparse_normalize_object_primary(au); if (rc == 1) { const char *val = NULL; int ftype; // If we have an object and this is an AVC, add some words if (action && strstr(action, "violated")) val = "accessing "; ftype = auparse_get_field_type(au); if (ftype == AUPARSE_TYPE_ESCAPED_FILE) val = auparse_interpret_realpath(au); else if (ftype == AUPARSE_TYPE_SOCKADDR) { val = auparse_interpret_sock_address(au); if (val == NULL) val = auparse_interpret_sock_family(au); } else if (type == AUDIT_CONFIG_CHANGE) { if (action && ((strcmp(action, "set") == 0) || strcmp(action, "seccomp-logging") == 0)) val = auparse_get_field_name(au); else val = auparse_interpret_field(au); } if (val == NULL) val = auparse_interpret_field(au); printf("%s ", val); } rc = auparse_normalize_object_primary2(au); if (rc == 1) { const char *val; if (auparse_get_field_type(au) == AUPARSE_TYPE_ESCAPED_FILE) val = auparse_interpret_realpath(au); else val = auparse_interpret_field(au); printf("to %s ", val); } how = auparse_normalize_how(au); if (how && action && *action != 'e') // Don't print for ended-session printf("using %s", how); printf("\n"); } /* This function will push an event into auparse. The callback arg will * perform all formatting for the intended report option. */ static auparse_state_t *au = NULL; static void feed_auparse(llist *l, auparse_callback_ptr callback) { const lnode *n; list_first(l); n = list_get_cur(l); if (!n) { fprintf(stderr, "Error - no elements in record."); return; } if (au == NULL) { au = auparse_init(AUSOURCE_FEED, 0); auparse_set_escape_mode(au, escape_mode); auparse_set_eoe_timeout(lol_get_eoe_timeout()); auparse_add_callback(au, callback, NULL, NULL); } do { // Records need to be terminated by a newline // Temporarily replace it. if (l->fmt == LF_ENRICHED) n->message[n->mlen] = AUDIT_INTERP_SEPARATOR; n->message[n->tlen] = 0x0a; auparse_feed(au, n->message, n->tlen+1); if (l->fmt == LF_ENRICHED) n->message[n->mlen] = 0; n->message[n->tlen] = 0; } while ((n=list_next(l))); auparse_flush_feed(au); } void output_auparse_finish(void) { if (au) auparse_destroy(au); au = NULL; } audit-4.0.2/src/ausearch-string.h0000644001034500103450000000373414655201403012352 /* * ausearch-string.h - Header file for ausearch-string.c * Copyright (c) 2005,2008,2023 Red Hat Inc. * All Rights Reserved. * * This software may be freely redistributed and/or modified 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, Inc., 51 Franklin Street, Fifth Floor * Boston, MA 02110-1335, USA. * * Authors: * Steve Grubb */ #ifndef AUSTRING_HEADER #define AUSTRING_HEADER #include "config.h" /* This is the node of the linked list. message & item are the only elements * at this time. Any data elements that are per item goes here. */ typedef struct _snode{ char *str; // The string char *key; // The key string unsigned int hits; // Number of times this string was attempted to be added struct _snode* next; // Next string node pointer } snode; /* This is the linked list head. Only data elements that are 1 per * event goes here. */ typedef struct { snode *head; // List head snode *cur; // Pointer to current node snode *last; // Pointer to current node unsigned int cnt; // How many items in this list } slist; void slist_create(slist *l); static inline void slist_first(slist *l) { l->cur = l->head; } snode *slist_next(slist *l); static inline snode *slist_get_cur(const slist *l) { return l->cur; } int slist_append(slist *l, const snode *node); void slist_clear(slist* l); /* append a string if its not already on the list */ int slist_add_if_uniq(slist *l, const char *str); void slist_sort_by_hits(slist *l); #endif audit-4.0.2/src/Makefile.am0000644001034500103450000000621114655201403011127 # Makefile.am-- # Copyright 2004-2006, 2008,2011-16,2018 Red Hat Inc. # All Rights Reserved. # # 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; see the file COPYING. If not, write to the # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor # Boston, MA 02110-1335, USA. # # Authors: # Steve Grubb # CONFIG_CLEAN_FILES = *.rej *.orig SUBDIRS = test AM_CPPFLAGS = -I${top_srcdir} -I${top_srcdir}/lib -I${top_srcdir}/src/libev -I${top_srcdir}/auparse -I${top_srcdir}/audisp -I${top_srcdir}/common sbin_PROGRAMS = auditd auditctl aureport ausearch AM_CFLAGS = -D_GNU_SOURCE -Wno-pointer-sign ${WFLAGS} noinst_HEADERS = auditd-config.h auditd-event.h auditd-listen.h ausearch-llist.h ausearch-options.h auditctl-llist.h aureport-options.h ausearch-parse.h aureport-scan.h ausearch-lookup.h ausearch-int.h auditd-dispatch.h ausearch-string.h ausearch-nvpair.h ausearch-common.h ausearch-avc.h ausearch-time.h ausearch-lol.h auditctl-listing.h ausearch-checkpt.h auditd_SOURCES = auditd.c auditd-event.c auditd-config.c auditd-reconfig.c auditd-sendmail.c auditd-dispatch.c if ENABLE_LISTENER auditd_SOURCES += auditd-listen.c endif auditd_CFLAGS = -fPIE -DPIE -g -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pthread -Wno-pointer-sign ${WFLAGS} auditd_LDFLAGS = -pie -Wl,-z,relro -Wl,-z,now auditd_LDADD = @LIBWRAP_LIBS@ ${top_builddir}/src/libev/libev.la ${top_builddir}/audisp/libdisp.la ${top_builddir}/lib/libaudit.la ${top_builddir}/auparse/libauparse.la -lpthread -lm $(gss_libs) ${top_builddir}/common/libaucommon.la auditctl_SOURCES = auditctl.c auditctl-llist.c delete_all.c auditctl-listing.c auditctl_CFLAGS = -fPIE -DPIE -g -D_GNU_SOURCE ${WFLAGS} auditctl_LDFLAGS = -pie -Wl,-z,relro -Wl,-z,now auditctl_LDADD = ${top_builddir}/lib/libaudit.la ${top_builddir}/auparse/libauparse.la ${top_builddir}/common/libaucommon.la aureport_SOURCES = aureport.c auditd-config.c ausearch-llist.c aureport-options.c ausearch-string.c ausearch-parse.c aureport-scan.c aureport-output.c ausearch-lookup.c ausearch-int.c ausearch-time.c ausearch-nvpair.c ausearch-avc.c ausearch-lol.c aureport_LDADD = ${top_builddir}/lib/libaudit.la ${top_builddir}/auparse/libauparse.la ${top_builddir}/common/libaucommon.la ausearch_SOURCES = ausearch.c auditd-config.c ausearch-llist.c ausearch-options.c ausearch-report.c ausearch-match.c ausearch-string.c ausearch-parse.c ausearch-int.c ausearch-time.c ausearch-nvpair.c ausearch-lookup.c ausearch-avc.c ausearch-lol.c ausearch-checkpt.c ausearch_LDADD = ${top_builddir}/lib/libaudit.la ${top_builddir}/auparse/libauparse.la ${top_builddir}/common/libaucommon.la libev/libev.a: make -C libev audit-4.0.2/src/auditd-dispatch.c0000644001034500103450000000446614655201403012320 /* auditd-dispatch.c -- * Copyright 2005-07,2013,2016-17 Red Hat Inc., Durham, North Carolina. * All Rights Reserved. * * 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 * * Authors: * Steve Grubb * Junji Kanemaru */ #include "config.h" #include #include #include #include #include #include #include #include "libaudit.h" #include "private.h" #include "auditd-dispatch.h" #include "libdisp.h" int dispatcher_pid(void) { return 0; } void dispatcher_reaped(void) { shutdown_dispatcher(); } /* This function returns 1 on error & 0 on success */ int init_dispatcher(const struct daemon_conf *config) { return libdisp_init(config); } void shutdown_dispatcher(void) { libdisp_shutdown(); } void reconfigure_dispatcher(const struct daemon_conf *config) { libdisp_reconfigure(config); } /* Returns -1 on err, 0 on success */ int dispatch_event(const struct audit_reply *rep, int protocol_ver) { event_t *e; if (!libdisp_active()) return 0; // Translate event into dispatcher format e = malloc(sizeof(event_t)); if (e == NULL) return -1; e->hdr.ver = protocol_ver; e->hdr.hlen = sizeof(struct audit_dispatcher_header); e->hdr.type = rep->type; // Network originating events have data at rep->message if (protocol_ver == AUDISP_PROTOCOL_VER) { e->hdr.size = rep->msg.nlh.nlmsg_len; memcpy(e->data, (void*)rep->msg.data, e->hdr.size); } else if (protocol_ver == AUDISP_PROTOCOL_VER2) { e->hdr.size = rep->len; memcpy(e->data, (void*)rep->message, e->hdr.size); } else { free(e); return 0; } return libdisp_enqueue(e); } audit-4.0.2/src/ausearch-lol.h0000644001034500103450000000340514655201403011625 /* * ausearch-lol.h - linked list of linked lists library header * Copyright (c) 2008 Red Hat Inc., Durham, North Carolina. * All Rights Reserved. * * This software may be freely redistributed and/or modified 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, Inc., 51 Franklin Street, Fifth Floor * Boston, MA 02110-1335, USA. * * Authors: * Steve Grubb */ #ifndef AUSEARCH_LOL_HEADER #define AUSEARCH_LOL_HEADER #include "config.h" #include "ausearch-llist.h" typedef enum { L_EMPTY, L_BUILDING, L_COMPLETE } lol_t; /* This is the node of the linked list. message & item are the only elements * at this time. Any data elements that are per item goes here. */ typedef struct _lolnode{ llist *l; // The linked list int status; // 0 = empty, 1 in use, 2 complete } lolnode; /* This is the linked list head. Only data elements that are 1 per * event goes here. */ typedef struct { lolnode *array; int maxi; // Largest index used int limit; // Number of nodes in the array } lol; void lol_create(lol *lo); void lol_clear(lol *lo); int lol_add_record(lol *lo, char *buff); void terminate_all_events(lol *lo); void complete_all_events(lol *lo); llist* get_ready_event(lol *lo); void lol_set_eoe_timeout(time_t new_eoe_tmo); #endif audit-4.0.2/src/aureport.c0000644001034500103450000002075614655201403011112 /* * aureport.c - main file for aureport utility * Copyright 2005-08, 2010,11,2013,2020 Red Hat * All Rights Reserved. * * 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 * * Authors: * Steve Grubb */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include "libaudit.h" #include "auditd-config.h" #include "aureport-options.h" #include "aureport-scan.h" #include "ausearch-lol.h" #include "ausearch-lookup.h" #include "auparse-idata.h" #include "ausearch-parse.h" extern event very_first_event; event very_last_event; static FILE *log_fd = NULL; static lol lo; static int found = 0; static int files_to_process = 0; // Logs left when processing multiple static int userfile_is_dir = 0; static struct daemon_conf config; static int process_logs(void); static int process_log_fd(const char *filename); static int process_stdin(void); static int process_file(char *filename); static int get_event(llist **); extern char *user_file; extern int force_logs; /* * User space configuration items */ extern time_t arg_eoe_timeout; static int is_pipe(int fd) { struct stat st; if (fstat(fd, &st) == 0) { if (S_ISFIFO(st.st_mode)) return 1; } return 0; } int main(int argc, char *argv[]) { struct rlimit limit; int rc; /* Check params and build regexpr */ setlocale (LC_ALL, ""); if (check_params(argc, argv)) return 1; /* Raise the rlimits in case we're being started from a shell * with restrictions. Not a fatal error. */ limit.rlim_cur = RLIM_INFINITY; limit.rlim_max = RLIM_INFINITY; setrlimit(RLIMIT_FSIZE, &limit); setrlimit(RLIMIT_CPU, &limit); set_aumessage_mode(MSG_STDERR, DBG_NO); (void) umask( umask( 077 ) | 027 ); very_first_event.sec = 0; reset_counters(); /* Load config so we know where logs are and eoe_timeout */ if (load_config(&config, TEST_SEARCH)) fprintf(stderr, "NOTE - using built-in logs: %s\n", config.log_file); /* Set timeout from the config file */ lol_set_eoe_timeout((time_t)config.end_of_event_timeout); /* * If an override was specified on the command line, override the config */ if (arg_eoe_timeout != 0) lol_set_eoe_timeout((time_t)arg_eoe_timeout); print_title(); if (arg_eoe_timeout != 0) { lol_set_eoe_timeout(arg_eoe_timeout); } lol_create(&lo); if (user_file) { struct stat sb; if (stat(user_file, &sb) == -1) { perror("stat"); return 1; } else { switch (sb.st_mode & S_IFMT) { case S_IFDIR: userfile_is_dir = 1; rc = process_logs(); break; case S_IFREG: default: rc = process_file(user_file); break; } } } else if (force_logs) rc = process_logs(); else if (is_pipe(0)) rc = process_stdin(); else rc = process_logs(); lol_clear(&lo); if (rc) return rc; if (!found && report_detail == D_DETAILED && report_type != RPT_TIME) { printf("\n\n"); destroy_counters(); aulookup_destroy_uid_list(); return 1; } else print_wrap_up(); destroy_counters(); aulookup_destroy_uid_list(); lookup_uid_destroy_list(); free(user_file); return 0; } static int process_logs(void) { char *filename; size_t len; int num = 0; if (user_file && userfile_is_dir) { char dirname[MAXPATHLEN+1]; clear_config (&config); strncpy(dirname, user_file, MAXPATHLEN-32); if (dirname[strlen(dirname)-1] != '/') strcat(dirname, "/"); strcat (dirname, "audit.log"); free((void *)config.log_file); config.log_file=strdup(dirname); fprintf(stderr, "NOTE - using logs in %s\n", config.log_file); } /* for each file */ len = strlen(config.log_file) + 16; filename = malloc(len); if (!filename) { fprintf(stderr, "No memory\n"); free_config(&config); return 1; } /* Find oldest log file */ snprintf(filename, len, "%s", config.log_file); do { if (access(filename, R_OK) != 0) break; // FIXME: do a time check and put them on linked list for later num++; snprintf(filename, len, "%s.%d", config.log_file, num); } while (1); num--; /* * We note how many files we need to process */ files_to_process = num; /* Got it, now process logs from last to first */ if (num > 0) snprintf(filename, len, "%s.%d", config.log_file, num); else snprintf(filename, len, "%s", config.log_file); do { int ret; if ((ret = process_file(filename))) { free(filename); free_config(&config); return ret; } /* Get next log file */ files_to_process--; /* one less file to process */ num--; if (num > 0) snprintf(filename, len, "%s.%d", config.log_file, num); else if (num == 0) snprintf(filename, len, "%s", config.log_file); else break; } while (1); free(filename); free_config(&config); return 0; } static void process_event(llist *entries) { if (scan(entries)) { // If its a single event or SYSCALL load interpretations if ((entries->cnt == 1) || (entries->head->type == AUDIT_SYSCALL)) _auparse_load_interpretations(entries->head->interp); // This is the per entry action item if (per_event_processing(entries)) found = 1; _auparse_free_interpretations(); } } static int process_log_fd(const char *filename) { llist *entries; // entries in a record int ret; int first = 0; event first_event, last_event; last_event.sec = 0; last_event.milli = 0; /* For each event in file */ do { ret = get_event(&entries); if ((ret != 0)||(entries->cnt == 0)||(entries->head == NULL)) break; // If report is RPT_TIME or RPT_SUMMARY, get if (report_type <= RPT_SUMMARY) { if (first == 0) { list_get_event(entries, &first_event); first = 1; } list_get_event(entries, &last_event); } // Are we within time range? if (start_time == 0 || entries->e.sec >= start_time) { if (end_time == 0 || entries->e.sec <= end_time) { process_event(entries); } } list_clear(entries); free(entries); } while (ret == 0); fclose(log_fd); // This is the per file action items very_last_event.sec = last_event.sec; very_last_event.milli = last_event.milli; if (report_type == RPT_TIME) { if (first == 0) { printf("%s: no records\n", filename); } else { struct tm *btm; char tmp[32]; printf("%s: ", filename); btm = localtime(&first_event.sec); if (btm) strftime(tmp, sizeof(tmp), "%x %T", btm); else strcpy(tmp, "?"); printf("%s.%03u - ", tmp, first_event.milli); btm = localtime(&last_event.sec); if (btm) strftime(tmp, sizeof(tmp), "%x %T", btm); else strcpy(tmp, "?"); printf("%s.%03u\n", tmp, last_event.milli); } } return 0; } static int process_stdin(void) { log_fd = stdin; return process_log_fd("stdin"); } static int process_file(char *filename) { log_fd = fopen(filename, "rm"); if (log_fd == NULL) { fprintf(stderr, "Error opening %s (%s)\n", filename, strerror(errno)); return 1; } __fsetlocking(log_fd, FSETLOCKING_BYCALLER); return process_log_fd(filename); } /* * This function returns a linked list of all records in an event. * It returns 0 on success, 1 on eof, -1 on error. */ static int get_event(llist **l) { char *rc; char *buff = NULL; *l = get_ready_event(&lo); if (*l) return 0; while (1) { if (!buff) { buff = malloc(MAX_AUDIT_MESSAGE_LENGTH); if (!buff) return -1; } rc = fgets_unlocked(buff, MAX_AUDIT_MESSAGE_LENGTH, log_fd); if (rc) { if (lol_add_record(&lo, buff)) { *l = get_ready_event(&lo); if (*l) break; } } else { free(buff); if (feof_unlocked(log_fd)) { // Only mark all events complete if this is // the last file. if (files_to_process == 0) { terminate_all_events(&lo); } *l = get_ready_event(&lo); if (*l) return 0; else return 1; } else return -1; } } free(buff); return 0; } audit-4.0.2/src/auditd-config.c0000644001034500103450000015231514655201403011763 /* auditd-config.c -- * Copyright 2004-2011,2013-14,2016,2018,2020-21 Red Hat Inc. * All Rights Reserved. * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: * Steve Grubb */ #include "config.h" #include #include #include #include #include #include #include #include #include #include /* O_NOFOLLOW needs gnu defined */ #include #include #include /* INT_MAX */ #include #include "auditd-config.h" #include "libaudit.h" #include "private.h" #include "common.h" #define TCP_PORT_MAX 65535 /* Local prototypes */ struct nv_pair { const char *name; const char *value; const char *option; }; struct kw_pair { const char *name; int (*parser)(const struct nv_pair *, int, struct daemon_conf *); int max_options; }; struct nv_list { const char *name; int option; }; static char *get_line(FILE *f, char *buf, unsigned size, int *lineno, const char *file); static int nv_split(char *buf, struct nv_pair *nv); static const struct kw_pair *kw_lookup(const char *val); static int local_events_parser(const struct nv_pair *nv, int line, struct daemon_conf *config); static int write_logs_parser(const struct nv_pair *nv, int line, struct daemon_conf *config); static int log_file_parser(const struct nv_pair *nv, int line, struct daemon_conf *config); static int num_logs_parser(const struct nv_pair *nv, int line, struct daemon_conf *config); static int log_group_parser(const struct nv_pair *nv, int line, struct daemon_conf *config); static int qos_parser(const struct nv_pair *nv, int line, struct daemon_conf *config); static int dispatch_parser(const struct nv_pair *nv, int line, struct daemon_conf *config); static int name_format_parser(const struct nv_pair *nv, int line, struct daemon_conf *config); static int name_parser(const struct nv_pair *nv, int line, struct daemon_conf *config); static int max_log_size_parser(const struct nv_pair *nv, int line, struct daemon_conf *config); static int max_log_size_action_parser(const struct nv_pair *nv, int line, struct daemon_conf *config); static int log_format_parser(const struct nv_pair *nv, int line, struct daemon_conf *config); static int flush_parser(const struct nv_pair *nv, int line, struct daemon_conf *config); static int freq_parser(const struct nv_pair *nv, int line, struct daemon_conf *config); static int space_left_parser(const struct nv_pair *nv, int line, struct daemon_conf *config); static int space_action_parser(const struct nv_pair *nv, int line, struct daemon_conf *config); static int action_mail_acct_parser(const struct nv_pair *nv, int line, struct daemon_conf *config); static int verify_email_parser(const struct nv_pair *nv, int line, struct daemon_conf *config); static int admin_space_left_parser(const struct nv_pair *nv, int line, struct daemon_conf *config); static int admin_space_left_action_parser(const struct nv_pair *nv, int line, struct daemon_conf *config); static int disk_full_action_parser(const struct nv_pair *nv, int line, struct daemon_conf *config); static int disk_error_action_parser(const struct nv_pair *nv, int line, struct daemon_conf *config); static int priority_boost_parser(const struct nv_pair *nv, int line, struct daemon_conf *config); static int tcp_listen_port_parser(const struct nv_pair *nv, int line, struct daemon_conf *config); static int tcp_listen_queue_parser(const struct nv_pair *nv, int line, struct daemon_conf *config); static int tcp_max_per_addr_parser(const struct nv_pair *nv, int line, struct daemon_conf *config); static int use_libwrap_parser(const struct nv_pair *nv, int line, struct daemon_conf *config); static int tcp_client_ports_parser(const struct nv_pair *nv, int line, struct daemon_conf *config); static int tcp_client_max_idle_parser(const struct nv_pair *nv, int line, struct daemon_conf *config); static int transport_parser(const struct nv_pair *nv, int line, struct daemon_conf *config); static int enable_krb5_parser(const struct nv_pair *nv, int line, struct daemon_conf *config); static int krb5_principal_parser(const struct nv_pair *nv, int line, struct daemon_conf *config); static int krb5_key_file_parser(const struct nv_pair *nv, int line, struct daemon_conf *config); static int distribute_network_parser(const struct nv_pair *nv, int line, struct daemon_conf *config); static int q_depth_parser(const struct nv_pair *nv, int line, struct daemon_conf *config); static int overflow_action_parser(const struct nv_pair *nv, int line, struct daemon_conf *config); static int max_restarts_parser(const struct nv_pair *nv, int line, struct daemon_conf *config); static int plugin_dir_parser(const struct nv_pair *nv, int line, struct daemon_conf *config); static int eoe_timeout_parser(const struct nv_pair *nv, int line, struct daemon_conf *config); static int sanity_check(struct daemon_conf *config); static const struct kw_pair keywords[] = { {"local_events", local_events_parser, 0}, {"write_logs", write_logs_parser, 0 }, {"log_file", log_file_parser, 0 }, {"log_format", log_format_parser, 0 }, {"log_group", log_group_parser, 0 }, {"flush", flush_parser, 0 }, {"freq", freq_parser, 0 }, {"num_logs", num_logs_parser, 0 }, {"dispatcher", dispatch_parser, 0 }, {"name_format", name_format_parser, 0 }, {"name", name_parser, 0 }, {"disp_qos", qos_parser, 0 }, {"max_log_file", max_log_size_parser, 0 }, {"max_log_file_action", max_log_size_action_parser, 0 }, {"space_left", space_left_parser, 0 }, {"space_left_action", space_action_parser, 1 }, {"action_mail_acct", action_mail_acct_parser, 0 }, {"verify_email", verify_email_parser, 0 }, {"admin_space_left", admin_space_left_parser, 0 }, {"admin_space_left_action", admin_space_left_action_parser, 1 }, {"disk_full_action", disk_full_action_parser, 1 }, {"disk_error_action", disk_error_action_parser, 1 }, {"priority_boost", priority_boost_parser, 0 }, {"tcp_listen_port", tcp_listen_port_parser, 0 }, {"tcp_listen_queue", tcp_listen_queue_parser, 0 }, {"tcp_max_per_addr", tcp_max_per_addr_parser, 0 }, {"use_libwrap", use_libwrap_parser, 0 }, {"tcp_client_ports", tcp_client_ports_parser, 0 }, {"tcp_client_max_idle", tcp_client_max_idle_parser, 0 }, {"transport", transport_parser, 0 }, {"enable_krb5", enable_krb5_parser, 0 }, {"krb5_principal", krb5_principal_parser, 0 }, {"krb5_key_file", krb5_key_file_parser, 0 }, {"distribute_network", distribute_network_parser, 0 }, {"q_depth", q_depth_parser, 0 }, {"overflow_action", overflow_action_parser, 0 }, {"max_restarts", max_restarts_parser, 0 }, {"plugin_dir", plugin_dir_parser, 0 }, {"end_of_event_timeout", eoe_timeout_parser, 0 }, { NULL, NULL, 0 } }; static const struct nv_list log_formats[] = { {"raw", LF_RAW }, {"nolog", LF_NOLOG }, {"enriched", LF_ENRICHED }, { NULL, 0 } }; static const struct nv_list flush_techniques[] = { {"none", FT_NONE }, {"incremental", FT_INCREMENTAL }, {"incremental_async", FT_INCREMENTAL_ASYNC }, {"data", FT_DATA }, {"sync", FT_SYNC }, { NULL, 0 } }; static const struct nv_list failure_actions[] = { {"ignore", FA_IGNORE }, {"syslog", FA_SYSLOG }, {"rotate", FA_ROTATE }, {"email", FA_EMAIL }, {"exec", FA_EXEC }, {"suspend", FA_SUSPEND }, {"single", FA_SINGLE }, {"halt", FA_HALT }, { NULL, 0 } }; // Future ideas: e-mail, run command static const struct nv_list size_actions[] = { {"ignore", SZ_IGNORE }, {"syslog", SZ_SYSLOG }, {"suspend", SZ_SUSPEND }, {"rotate", SZ_ROTATE }, {"keep_logs", SZ_KEEP_LOGS}, { NULL, 0 } }; static const struct nv_list node_name_formats[] = { {"none", N_NONE }, {"hostname", N_HOSTNAME }, {"fqd", N_FQD }, {"numeric", N_NUMERIC }, {"user", N_USER }, { NULL, 0 } }; static const struct nv_list yes_no_values[] = { {"yes", 1 }, {"no", 0 }, { NULL, 0 } }; static const struct nv_list overflow_actions[] = { {"ignore", O_IGNORE }, {"syslog", O_SYSLOG }, {"suspend", O_SUSPEND }, {"single", O_SINGLE }, {"halt", O_HALT }, { NULL, 0 } }; static const struct nv_list transport_words[] = { {"tcp", T_TCP }, #ifdef USE_GSSAPI {"krb5", T_KRB5 }, #endif { NULL, 0 } }; const char *email_command = "/usr/lib/sendmail"; static int allow_links = 0; static const char *config_dir = NULL; static char *config_file = NULL; void set_allow_links(int allow) { allow_links = allow; } int set_config_dir(const char *val) { config_dir = strdup(val); if (config_dir == NULL) return 1; if (asprintf(&config_file, "%s/auditd.conf", config_dir) < 0) return 1; return 0; } /* * Set everything to its default value */ void clear_config(struct daemon_conf *config) { config->local_events = 1; config->sender_uid = 0; config->sender_pid = 0; config->sender_ctx = NULL; config->write_logs = 1; config->log_file = strdup("/var/log/audit/audit.log"); config->log_format = LF_ENRICHED; config->log_group = 0; config->priority_boost = 4; config->flush = FT_NONE; config->freq = 0; config->num_logs = 0L; config->node_name_format = N_NONE; config->node_name = NULL; config->max_log_size = 0L; config->max_log_size_action = SZ_IGNORE; config->space_left = 0L; config->space_left_percent = 0; config->space_left_action = FA_IGNORE; config->space_left_exe = NULL; config->action_mail_acct = strdup("root"); config->verify_email = 1; config->admin_space_left= 0L; config->admin_space_left_percent = 0; config->admin_space_left_action = FA_IGNORE; config->admin_space_left_exe = NULL; config->disk_full_action = FA_IGNORE; config->disk_full_exe = NULL; config->disk_error_action = FA_SYSLOG; config->disk_error_exe = NULL; config->tcp_listen_port = 0; config->tcp_listen_queue = 5; config->tcp_max_per_addr = 1; config->use_libwrap = 1; config->tcp_client_min_port = 0; config->tcp_client_max_port = TCP_PORT_MAX; config->tcp_client_max_idle = 0; config->transport = T_TCP; config->krb5_principal = NULL; config->krb5_key_file = NULL; config->distribute_network_events = 0; config->q_depth = 2000; config->overflow_action = O_SYSLOG; config->max_restarts = 10; config->plugin_dir = strdup("/etc/audit/plugins.d"); config->config_dir = NULL; config->end_of_event_timeout = EOE_TIMEOUT; } static log_test_t log_test = TEST_AUDITD; int load_config(struct daemon_conf *config, log_test_t lt) { int fd, rc, mode, lineno = 1; struct stat st; FILE *f; char buf[160]; clear_config(config); log_test = lt; if (config_file == NULL) config_file = strdup(CONFIG_FILE); /* open the file */ mode = O_RDONLY; if (allow_links == 0) mode |= O_NOFOLLOW; rc = open(config_file, mode); if (rc < 0) { if (errno != ENOENT) { audit_msg(LOG_ERR, "Error opening config file (%s)", strerror(errno)); return 1; } audit_msg(LOG_WARNING, "Config file %s doesn't exist, skipping", config_file); return 0; } fd = rc; /* check the file's permissions: owned by root, not world writable, * not symlink. */ audit_msg(LOG_DEBUG, "Config file %s opened for parsing", config_file); if (fstat(fd, &st) < 0) { audit_msg(LOG_ERR, "Error fstat'ing config file (%s)", strerror(errno)); close(fd); return 1; } if (st.st_uid != 0) { audit_msg(LOG_ERR, "Error - %s isn't owned by root", config_file); close(fd); return 1; } if ((st.st_mode & S_IWOTH) == S_IWOTH) { audit_msg(LOG_ERR, "Error - %s is world writable", config_file); close(fd); return 1; } if (!S_ISREG(st.st_mode)) { audit_msg(LOG_ERR, "Error - %s is not a regular file", config_file); close(fd); return 1; } /* it's ok, read line by line */ f = fdopen(fd, "rm"); if (f == NULL) { audit_msg(LOG_ERR, "Error - fdopen failed (%s)", strerror(errno)); close(fd); return 1; } while (get_line(f, buf, sizeof(buf), &lineno, config_file)) { // convert line into name-value pair const struct kw_pair *kw; struct nv_pair nv; rc = nv_split(buf, &nv); switch (rc) { case 0: // fine break; case 1: // not the right number of tokens. audit_msg(LOG_ERR, "Wrong number of arguments for line %d in %s", lineno, config_file); break; case 2: // no '=' sign audit_msg(LOG_ERR, "Missing equal sign for line %d in %s", lineno, config_file); break; default: // something else went wrong... audit_msg(LOG_ERR, "Unknown error for line %d in %s", lineno, config_file); break; } if (nv.name == NULL) { lineno++; continue; } if (nv.value == NULL) { fclose(f); audit_msg(LOG_ERR, "Not processing any more lines in %s", config_file); return 1; } /* identify keyword or error */ kw = kw_lookup(nv.name); if (kw->name == NULL) { audit_msg(LOG_ERR, "Unknown keyword \"%s\" in line %d of %s", nv.name, lineno, config_file); fclose(f); return 1; } /* Check number of options */ if (kw->max_options == 0 && nv.option != NULL) { audit_msg(LOG_ERR, "Keyword \"%s\" has invalid option " "\"%s\" in line %d of %s", nv.name, nv.option, lineno, config_file); fclose(f); return 1; } /* dispatch to keyword's local parser */ rc = kw->parser(&nv, lineno, config); if (rc != 0) { fclose(f); return 1; // local parser puts message out } lineno++; } fclose(f); if (lineno > 1) return sanity_check(config); return 0; } static char *get_line(FILE *f, char *buf, unsigned size, int *lineno, const char *file) { int too_long = 0; while (fgets_unlocked(buf, size, f)) { /* remove newline */ char *ptr = strchr(buf, 0x0a); if (ptr) { if (!too_long) { *ptr = 0; return buf; } // Reset and start with the next line too_long = 0; *lineno = *lineno + 1; } else { // If a line is too long skip it. // Only output 1 warning if (!too_long) audit_msg(LOG_ERR, "Skipping line %d in %s: too long", *lineno, file); too_long = 1; } } return NULL; } static int nv_split(char *buf, struct nv_pair *nv) { /* Get the name part */ char *ptr; nv->name = NULL; nv->value = NULL; nv->option = NULL; ptr = audit_strsplit(buf); if (ptr == NULL) return 0; /* If there's nothing, go to next line */ if (ptr[0] == '#') return 0; /* If there's a comment, go to next line */ nv->name = ptr; /* Check for a '=' */ ptr = audit_strsplit(NULL); if (ptr == NULL) return 1; if (strcmp(ptr, "=") != 0) return 2; /* get the value */ ptr = audit_strsplit(NULL); if (ptr == NULL) return 1; nv->value = ptr; /* See if there's an option */ ptr = audit_strsplit(NULL); if (ptr) { nv->option = ptr; /* Make sure there's nothing else */ ptr = audit_strsplit(NULL); if (ptr) return 1; } /* Everything is OK */ return 0; } static const struct kw_pair *kw_lookup(const char *val) { int i = 0; while (keywords[i].name != NULL) { if (strcasecmp(keywords[i].name, val) == 0) break; i++; } return &keywords[i]; } static int local_events_parser(const struct nv_pair *nv, int line, struct daemon_conf *config) { unsigned long i; audit_msg(LOG_DEBUG, "local_events_parser called with: %s", nv->value); for (i=0; yes_no_values[i].name != NULL; i++) { if (strcasecmp(nv->value, yes_no_values[i].name) == 0) { config->local_events = yes_no_values[i].option; return 0; } } audit_msg(LOG_ERR, "Option %s not found - line %d", nv->value, line); return 1; } static int write_logs_parser(const struct nv_pair *nv, int line, struct daemon_conf *config) { unsigned long i; audit_msg(LOG_DEBUG, "write_logs_parser called with: %s", nv->value); for (i=0; yes_no_values[i].name != NULL; i++) { if (strcasecmp(nv->value, yes_no_values[i].name) == 0) { config->write_logs = yes_no_values[i].option; return 0; } } audit_msg(LOG_ERR, "Option %s not found - line %d", nv->value, line); return 1; } static int log_file_parser(const struct nv_pair *nv, int line, struct daemon_conf *config) { char *dir = NULL, *tdir; DIR *d; int fd, mode; struct stat buf; audit_msg(LOG_DEBUG, "log_file_parser called with: %s", nv->value); /* get dir from name. */ tdir = strdup(nv->value); if (tdir) dir = dirname(tdir); if (dir == NULL || strlen(dir) < 4) { // '/var' is shortest dirname audit_msg(LOG_ERR, "The directory name: %s is too short - line %d", dir, line); free((void *)tdir); return 1; } /* verify the directory path exists */ d = opendir(dir); if (d == NULL) { audit_msg(LOG_ERR, "Could not open dir %s (%s)", dir, strerror(errno)); free((void *)tdir); return 1; } free((void *)tdir); closedir(d); /* if the file exists, see that its regular, owned by root, * and not world anything */ if (log_test == TEST_AUDITD) mode = O_APPEND; else mode = O_RDONLY; fd = open(nv->value, mode); if (fd < 0) { if (errno == ENOENT) goto finish_up; // Will create the log later else { audit_msg(LOG_ERR, "Unable to open %s (%s)", nv->value, strerror(errno)); return 1; } } if (fstat(fd, &buf) < 0) { audit_msg(LOG_ERR, "Unable to stat %s (%s)", nv->value, strerror(errno)); close(fd); return 1; } close(fd); if (!S_ISREG(buf.st_mode)) { audit_msg(LOG_ERR, "%s is not a regular file", nv->value); return 1; } if (buf.st_uid != 0) { audit_msg(LOG_ERR, "%s is not owned by root", nv->value); return 1; } if ( (buf.st_mode & (S_IXUSR|S_IWGRP|S_IXGRP|S_IRWXO)) ) { audit_msg(LOG_WARNING, "%s permissions should be 0600 or 0640", nv->value); } if ( !(buf.st_mode & S_IWUSR) ) { audit_msg(LOG_WARNING, "audit log is not writable by owner"); } finish_up: free((void *)config->log_file); config->log_file = strdup(nv->value); if (config->log_file == NULL) return 1; return 0; } static int num_logs_parser(const struct nv_pair *nv, int line, struct daemon_conf *config) { const char *ptr = nv->value; unsigned long i; audit_msg(LOG_DEBUG, "num_logs_parser called with: %s", nv->value); /* check that all chars are numbers */ for (i=0; ptr[i]; i++) { if (!isdigit((unsigned char)ptr[i])) { audit_msg(LOG_ERR, "Value %s should only be numbers - line %d", nv->value, line); return 1; } } /* convert to unsigned long */ errno = 0; i = strtoul(nv->value, NULL, 10); if (errno) { audit_msg(LOG_ERR, "Error converting string to a number (%s) - line %d", strerror(errno), line); return 1; } if (i > 999) { audit_msg(LOG_ERR, "num_logs must be 999 or less"); return 1; } config->num_logs = i; return 0; } static int qos_parser(const struct nv_pair *nv, int line, struct daemon_conf *config) { audit_msg(LOG_WARNING, "The disp_qos option is deprecated - line %d", line); return 0; } static int dispatch_parser(const struct nv_pair *nv, int line, struct daemon_conf *config) { audit_msg(LOG_DEBUG, "dispatch_parser called with: %s", nv->value); audit_msg(LOG_WARNING, "The dispatcher option is deprecated - line %d", line); return 0; } static int name_format_parser(const struct nv_pair *nv, int line, struct daemon_conf *config) { int i; audit_msg(LOG_DEBUG, "name_format_parser called with: %s", nv->value); for (i=0; node_name_formats[i].name != NULL; i++) { if (strcasecmp(nv->value, node_name_formats[i].name) == 0) { config->node_name_format = node_name_formats[i].option; return 0; } } audit_msg(LOG_ERR, "Option %s not found - line %d", nv->value, line); return 1; } static int name_parser(const struct nv_pair *nv, int line, struct daemon_conf *config) { audit_msg(LOG_DEBUG, "name_parser called with: %s", nv->value); if (nv->value == NULL) config->node_name = NULL; else config->node_name = strdup(nv->value); return 0; } static int max_log_size_parser(const struct nv_pair *nv, int line, struct daemon_conf *config) { const char *ptr = nv->value; unsigned long i; audit_msg(LOG_DEBUG, "max_log_size_parser called with: %s", nv->value); /* check that all chars are numbers */ for (i=0; ptr[i]; i++) { if (!isdigit((unsigned char)ptr[i])) { audit_msg(LOG_ERR, "Value %s should only be numbers - line %d", nv->value, line); return 1; } } /* convert to unsigned long */ errno = 0; i = strtoul(nv->value, NULL, 10); if (errno) { audit_msg(LOG_ERR, "Error converting string to a number (%s) - line %d", strerror(errno), line); return 1; } config->max_log_size = i; return 0; } static int max_log_size_action_parser(const struct nv_pair *nv, int line, struct daemon_conf *config) { int i; audit_msg(LOG_DEBUG, "max_log_size_action_parser called with: %s", nv->value); for (i=0; size_actions[i].name != NULL; i++) { if (strcasecmp(nv->value, size_actions[i].name) == 0) { config->max_log_size_action = size_actions[i].option; return 0; } } audit_msg(LOG_ERR, "Option %s not found - line %d", nv->value, line); return 1; } static int log_format_parser(const struct nv_pair *nv, int line, struct daemon_conf *config) { int i; audit_msg(LOG_DEBUG, "log_format_parser called with: %s", nv->value); for (i=0; log_formats[i].name != NULL; i++) { if (strcasecmp(nv->value, log_formats[i].name) == 0) { config->log_format = log_formats[i].option; if (config->log_format == LF_NOLOG) { audit_msg(LOG_WARNING, "The NOLOG option to log_format is deprecated. Please use the write_logs option."); if (config->write_logs != 0) audit_msg(LOG_WARNING, "The NOLOG option is overriding the write_logs current setting."); config->write_logs = 0; } return 0; } } audit_msg(LOG_ERR, "Option %s not found - line %d", nv->value, line); return 1; } static int log_group_parser(const struct nv_pair *nv, int line, struct daemon_conf *config) { gid_t gid = 0; audit_msg(LOG_DEBUG, "log_group_parser called with: %s", nv->value); if (isdigit((unsigned char)nv->value[0])) { errno = 0; gid = strtoul(nv->value,NULL,10); if (errno) { audit_msg(LOG_ERR, "Numeric group ID conversion error (%s) for %s - line %d\n", strerror(errno), nv->value, line); return 1; } } else { struct group *gr ; gr = getgrnam(nv->value); if (gr == NULL) { audit_msg(LOG_ERR, "Group ID is non-numeric and unknown (%s) - line %d\n", nv->value, line); return 1; } gid = gr->gr_gid; } config->log_group = gid; return 0; } static int flush_parser(const struct nv_pair *nv, int line, struct daemon_conf *config) { int i; audit_msg(LOG_DEBUG, "flush_parser called with: %s", nv->value); for (i=0; flush_techniques[i].name != NULL; i++) { if (strcasecmp(nv->value, flush_techniques[i].name) == 0) { config->flush = flush_techniques[i].option; return 0; } } audit_msg(LOG_ERR, "Option %s not found - line %d", nv->value, line); return 1; } static int freq_parser(const struct nv_pair *nv, int line, struct daemon_conf *config) { const char *ptr = nv->value; unsigned long i; audit_msg(LOG_DEBUG, "freq_parser called with: %s", nv->value); /* check that all chars are numbers */ for (i=0; ptr[i]; i++) { if (!isdigit((unsigned char)ptr[i])) { audit_msg(LOG_ERR, "Value %s should only be numbers - line %d", nv->value, line); return 1; } } /* convert to unsigned int */ errno = 0; i = strtoul(nv->value, NULL, 10); if (errno) { audit_msg(LOG_ERR, "Error converting string to a number (%s) - line %d", strerror(errno), line); return 1; } /* Check its range */ if (i > INT_MAX) { audit_msg(LOG_ERR, "Error - converted number (%s) is too large - line %d", nv->value, line); return 1; } config->freq = (unsigned int)i; return 0; } static int space_left_parser(const struct nv_pair *nv, int line, struct daemon_conf *config) { char *p, *ptr = (char *)nv->value; unsigned long i; int percent = 0; audit_msg(LOG_DEBUG, "space_left_parser called with: %s", nv->value); config->space_left_percent = 0; /* check that all chars are numbers */ for (i=0; ptr[i]; i++) { if (!isdigit((unsigned char)ptr[i]) && ptr[i] != '%') { audit_msg(LOG_ERR, "Value %c %s should only be numbers or percent - line %d", ptr[i],nv->value, line); return 1; } } /* Check for percent sign */ p = strchr(ptr, '%'); if (p) { percent = 1; *p = ' '; } /* convert to unsigned long */ errno = 0; i = strtoul(nv->value, NULL, 10); if (errno) { audit_msg(LOG_ERR, "Error converting string to a number (%s) - line %d", strerror(errno), line); return 1; } if (percent) { if (i > 99) { audit_msg(LOG_ERR, "Percentages should be less than 100 - line %d", line); return 1; } config->space_left_percent = i; config->space_left = 0L; } else config->space_left = i; return 0; } static int check_exe_name(const char *val, int line) { struct stat buf; if (val == NULL) { audit_msg(LOG_ERR, "Executable path needed for line %d", line); return -1; } if (*val != '/') { audit_msg(LOG_ERR, "Absolute path needed for %s - line %d", val, line); return -1; } if (stat(val, &buf) < 0) { audit_msg(LOG_ERR, "Unable to stat %s (%s) - line %d", val, strerror(errno), line); return -1; } if (!S_ISREG(buf.st_mode)) { audit_msg(LOG_ERR, "%s is not a regular file - line %d", val, line); return -1; } if (buf.st_uid != 0) { audit_msg(LOG_ERR, "%s is not owned by root - line %d", val, line); return -1; } if ((buf.st_mode & (S_IRWXU|S_IRWXG|S_IRWXO)) != (S_IRWXU|S_IRGRP|S_IXGRP) && (buf.st_mode & (S_IRWXU|S_IRWXG|S_IRWXO)) != (S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH) && (buf.st_mode & (S_IRWXU|S_IRWXG|S_IRWXO)) != (S_IRUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH) && (buf.st_mode & (S_IRWXU|S_IRWXG|S_IRWXO)) != (S_IRUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH)) { audit_msg(LOG_ERR, "%s permissions should be 0750, 0755, 0555 or 0550 - line %d", val, line); return -1; } return 0; } static int space_action_parser(const struct nv_pair *nv, int line, struct daemon_conf *config) { int i; audit_msg(LOG_DEBUG, "space_action_parser called with: %s", nv->value); for (i=0; failure_actions[i].name != NULL; i++) { if (strcasecmp(nv->value, failure_actions[i].name) == 0) { if (failure_actions[i].option == FA_EMAIL) { if (access(email_command, X_OK)) { audit_msg(LOG_ERR, "Email option is specified but %s doesn't seem executable.", email_command); } } else if (failure_actions[i].option == FA_EXEC) { if (check_exe_name(nv->option, line)) return 1; config->space_left_exe = strdup(nv->option); } config->space_left_action = failure_actions[i].option; return 0; } } audit_msg(LOG_ERR, "Option %s not found - line %d", nv->value, line); return 1; } // returns 0 if OK, 1 on temp error, 2 on permanent error static int validate_email(const char *acct) { int i, len; char *ptr1; if (acct == NULL) return 2; len = strlen(acct); if (len < 2) { audit_msg(LOG_ERR, "email: %s is too short, expecting at least 2 characters", acct); return 2; } // look for illegal char for (i=0; i ptr2)) { audit_msg(LOG_ERR, "email: %s should have . after @", acct); return 2; } memset(&hints, 0, sizeof(hints)); hints.ai_flags = AI_ADDRCONFIG | AI_CANONNAME; hints.ai_socktype = SOCK_STREAM; rc2 = getaddrinfo(ptr1+1, NULL, &hints, &ai); if (rc2 != 0) { if ((h_errno == HOST_NOT_FOUND) || (h_errno == NO_RECOVERY)) { audit_msg(LOG_ERR, "validate_email: failed looking up host for %s (%s)", ptr1+1, gai_strerror(rc2)); // FIXME: How can we tell that we truly have // a permanent failure and what is that? For // now treat all as temp failure. } else if (h_errno == TRY_AGAIN) { audit_msg(LOG_DEBUG, "validate_email: temporary failure looking up domain for %s", ptr1+1); } return 1; } freeaddrinfo(ai); } return 0; } static int action_mail_acct_parser(const struct nv_pair *nv, int line, struct daemon_conf *config) { char *tmail; audit_msg(LOG_DEBUG, "action_mail_acct_parser called with: %s", nv->value); tmail = strdup(nv->value); if (tmail == NULL) return 1; if (config->verify_email && validate_email(tmail) > 1) { free(tmail); return 1; } if (config->action_mail_acct) free((void *)config->action_mail_acct); config->action_mail_acct = tmail; return 0; } static int verify_email_parser(const struct nv_pair *nv, int line, struct daemon_conf *config) { unsigned long i; audit_msg(LOG_DEBUG, "verify_email_parser called with: %s", nv->value); for (i=0; yes_no_values[i].name != NULL; i++) { if (strcasecmp(nv->value, yes_no_values[i].name) == 0) { config->verify_email = yes_no_values[i].option; return 0; } } audit_msg(LOG_ERR, "Option %s not found - line %d", nv->value, line); return 1; } static int admin_space_left_parser(const struct nv_pair *nv, int line, struct daemon_conf *config) { char *p, *ptr = (char *)nv->value; unsigned long i; int percent = 0; audit_msg(LOG_DEBUG, "admin_space_left_parser called with: %s", nv->value); config->admin_space_left_percent = 0; /* check that all chars are numbers */ for (i=0; ptr[i]; i++) { if (!isdigit((unsigned char)ptr[i]) && ptr[i] != '%') { audit_msg(LOG_ERR, "Value %c %s should only be numbers or percent - line %d", ptr[i],nv->value, line); return 1; } } /* Check for percent sign */ p = strchr(ptr, '%'); if (p) { percent = 1; *p = ' '; } /* convert to unsigned long */ errno = 0; i = strtoul(nv->value, NULL, 10); if (errno) { audit_msg(LOG_ERR, "Error converting string to a number (%s) - line %d", strerror(errno), line); return 1; } if (percent) { if (i > 99) { audit_msg(LOG_ERR, "Percentages should be less than 100 - line %d", line); return 1; } config->admin_space_left_percent = i; config->admin_space_left = 0L; } else config->admin_space_left = i; return 0; } static int admin_space_left_action_parser(const struct nv_pair *nv, int line, struct daemon_conf *config) { int i; audit_msg(LOG_DEBUG, "admin_space_left_action_parser called with: %s", nv->value); for (i=0; failure_actions[i].name != NULL; i++) { if (strcasecmp(nv->value, failure_actions[i].name) == 0) { if (failure_actions[i].option == FA_EMAIL) { if (access(email_command, X_OK)) { audit_msg(LOG_ERR, "Email option is specified but %s doesn't seem executable.", email_command); } } else if (failure_actions[i].option == FA_EXEC) { if (check_exe_name(nv->option, line)) return 1; config->admin_space_left_exe = strdup(nv->option); } config->admin_space_left_action = failure_actions[i].option; return 0; } } audit_msg(LOG_ERR, "Option %s not found - line %d", nv->value, line); return 1; } static int disk_full_action_parser(const struct nv_pair *nv, int line, struct daemon_conf *config) { int i; audit_msg(LOG_DEBUG, "disk_full_action_parser called with: %s", nv->value); for (i=0; failure_actions[i].name != NULL; i++) { if (strcasecmp(nv->value, failure_actions[i].name) == 0) { if (failure_actions[i].option == FA_EMAIL) { audit_msg(LOG_ERR, "Illegal option %s for disk_full_action - line %d", nv->value, line); return 1; } else if (failure_actions[i].option == FA_EXEC) { if (check_exe_name(nv->option, line)) return 1; config->disk_full_exe = strdup(nv->option); } config->disk_full_action = failure_actions[i].option; return 0; } } audit_msg(LOG_ERR, "Option %s not found - line %d", nv->value, line); return 1; } static int disk_error_action_parser(const struct nv_pair *nv, int line, struct daemon_conf *config) { int i; audit_msg(LOG_DEBUG, "disk_error_action_parser called with: %s", nv->value); for (i=0; failure_actions[i].name != NULL; i++) { if (strcasecmp(nv->value, failure_actions[i].name) == 0) { if (failure_actions[i].option == FA_EMAIL || failure_actions[i].option == FA_ROTATE) { audit_msg(LOG_ERR, "Illegal option %s for disk_error_action - line %d", nv->value, line); return 1; } else if (failure_actions[i].option == FA_EXEC) { if (check_exe_name(nv->option, line)) return 1; config->disk_error_exe = strdup(nv->option); } config->disk_error_action = failure_actions[i].option; return 0; } } audit_msg(LOG_ERR, "Option %s not found - line %d", nv->value, line); return 1; } static int priority_boost_parser(const struct nv_pair *nv, int line, struct daemon_conf *config) { const char *ptr = nv->value; unsigned long i; audit_msg(LOG_DEBUG, "priority_boost_parser called with: %s", nv->value); /* check that all chars are numbers */ for (i=0; ptr[i]; i++) { if (!isdigit((unsigned char)ptr[i])) { audit_msg(LOG_ERR, "Value %s should only be numbers - line %d", nv->value, line); return 1; } } /* convert to unsigned int */ errno = 0; i = strtoul(nv->value, NULL, 10); if (errno) { audit_msg(LOG_ERR, "Error converting string to a number (%s) - line %d", strerror(errno), line); return 1; } /* Check its range */ if (i > INT_MAX) { audit_msg(LOG_ERR, "Error - converted number (%s) is too large - line %d", nv->value, line); return 1; } config->priority_boost = (unsigned int)i; return 0; } static int tcp_listen_port_parser(const struct nv_pair *nv, int line, struct daemon_conf *config) { const char *ptr = nv->value; unsigned long i; audit_msg(LOG_DEBUG, "tcp_listen_port_parser called with: %s", nv->value); #ifndef USE_LISTENER audit_msg(LOG_DEBUG, "Listener support is not enabled, ignoring value at line %d", line); return 0; #else /* check that all chars are numbers */ for (i=0; ptr[i]; i++) { if (!isdigit((unsigned char)ptr[i])) { audit_msg(LOG_ERR, "Value %s should only be numbers - line %d", nv->value, line); return 1; } } /* convert to unsigned int */ errno = 0; i = strtoul(nv->value, NULL, 10); if (errno) { audit_msg(LOG_ERR, "Error converting string to a number (%s) - line %d", strerror(errno), line); return 1; } /* Check its range */ if (i > TCP_PORT_MAX) { audit_msg(LOG_ERR, "Error - converted number (%s) is too large - line %d", nv->value, line); return 1; } if (i < 1) { audit_msg(LOG_ERR, "Error - converted number (%s) is too small - line %d", nv->value, line); return 1; } config->tcp_listen_port = (unsigned int)i; return 0; #endif } static int tcp_listen_queue_parser(const struct nv_pair *nv, int line, struct daemon_conf *config) { const char *ptr = nv->value; unsigned long i; audit_msg(LOG_DEBUG, "tcp_listen_queue_parser called with: %s", nv->value); #ifndef USE_LISTENER audit_msg(LOG_DEBUG, "Listener support is not enabled, ignoring value at line %d", line); return 0; #else /* check that all chars are numbers */ for (i=0; ptr[i]; i++) { if (!isdigit((unsigned char)ptr[i])) { audit_msg(LOG_ERR, "Value %s should only be numbers - line %d", nv->value, line); return 1; } } /* convert to unsigned int */ errno = 0; i = strtoul(nv->value, NULL, 10); if (errno) { audit_msg(LOG_ERR, "Error converting string to a number (%s) - line %d", strerror(errno), line); return 1; } /* Check its range. While this value is technically unlimited, it's limited by the kernel, and we limit it here for sanity. */ if (i > TCP_PORT_MAX) { audit_msg(LOG_ERR, "Error - converted number (%s) is too large - line %d", nv->value, line); return 1; } if (i < 1) { audit_msg(LOG_ERR, "Error - converted number (%s) is too small - line %d", nv->value, line); return 1; } config->tcp_listen_queue = (unsigned int)i; return 0; #endif } static int tcp_max_per_addr_parser(const struct nv_pair *nv, int line, struct daemon_conf *config) { const char *ptr = nv->value; unsigned long i; audit_msg(LOG_DEBUG, "tcp_max_per_addr_parser called with: %s", nv->value); #ifndef USE_LISTENER audit_msg(LOG_DEBUG, "Listener support is not enabled, ignoring value at line %d", line); return 0; #else /* check that all chars are numbers */ for (i=0; ptr[i]; i++) { if (!isdigit((unsigned char)ptr[i])) { audit_msg(LOG_ERR, "Value %s should only be numbers - line %d", nv->value, line); return 1; } } /* convert to unsigned int */ errno = 0; i = strtoul(nv->value, NULL, 10); if (errno) { audit_msg(LOG_ERR, "Error converting string to a number (%s) - line %d", strerror(errno), line); return 1; } /* Check its range. While this value is technically unlimited, it's limited by the kernel, and we limit it here for sanity. */ if (i > 1024) { audit_msg(LOG_ERR, "Error - converted number (%s) is too large - line %d", nv->value, line); return 1; } if (i < 1) { audit_msg(LOG_ERR, "Error - converted number (%s) is too small - line %d", nv->value, line); return 1; } config->tcp_max_per_addr = (unsigned int)i; return 0; #endif } static int use_libwrap_parser(const struct nv_pair *nv, int line, struct daemon_conf *config) { unsigned long i; audit_msg(LOG_DEBUG, "use_libwrap_parser called with: %s", nv->value); for (i=0; yes_no_values[i].name != NULL; i++) { if (strcasecmp(nv->value, yes_no_values[i].name) == 0) { config->use_libwrap = yes_no_values[i].option; return 0; } } audit_msg(LOG_ERR, "Option %s not found - line %d", nv->value, line); return 1; } static int tcp_client_ports_parser(const struct nv_pair *nv, int line, struct daemon_conf *config) { const char *ptr = nv->value; unsigned long i, minv, maxv; const char *saw_dash = NULL; audit_msg(LOG_DEBUG, "tcp_listen_queue_parser called with: %s", nv->value); #ifndef USE_LISTENER audit_msg(LOG_DEBUG, "Listener support is not enabled, ignoring value at line %d", line); return 0; #else /* check that all chars are numbers, with an optional inclusive '-'. */ for (i=0; ptr[i]; i++) { if (i > 0 && ptr[i] == '-' && ptr[i+1] != '\0') { saw_dash = ptr + i; continue; } if (!isdigit((unsigned char)ptr[i])) { audit_msg(LOG_ERR, "Value %s should only be numbers, or " "two numbers separated by a dash - line %d", nv->value, line); return 1; } } for (; ptr[i]; i++) { if (!isdigit((unsigned char)ptr[i])) { audit_msg(LOG_ERR, "Value %s should only be numbers, or " "two numbers separated by a dash - line %d", nv->value, line); return 1; } } /* convert to unsigned int */ errno = 0; maxv = minv = strtoul(nv->value, NULL, 10); if (errno) { audit_msg(LOG_ERR, "Error converting string to a number (%s) - line %d", strerror(errno), line); return 1; } if (saw_dash) { maxv = strtoul(saw_dash + 1, NULL, 10); if (errno) { audit_msg(LOG_ERR, "Error converting string to a number (%s) - line %d", strerror(errno), line); return 1; } } /* Check their ranges. */ if (minv > TCP_PORT_MAX) { audit_msg(LOG_ERR, "Error - converted number (%ld) is too large - line %d", minv, line); return 1; } if (maxv > TCP_PORT_MAX) { audit_msg(LOG_ERR, "Error - converted number (%ld) is too large - line %d", maxv, line); return 1; } if (minv > maxv) { audit_msg(LOG_ERR, "Error - converted range (%ld-%ld) is reversed - line %d", minv, maxv, line); return 1; } config->tcp_client_min_port = (unsigned int)minv; config->tcp_client_max_port = (unsigned int)maxv; return 0; #endif } static int tcp_client_max_idle_parser(const struct nv_pair *nv, int line, struct daemon_conf *config) { const char *ptr = nv->value; unsigned long i; audit_msg(LOG_DEBUG, "tcp_client_max_idle_parser called with: %s", nv->value); #ifndef USE_LISTENER audit_msg(LOG_DEBUG, "Listener support is not enabled, ignoring value at line %d", line); return 0; #else /* check that all chars are numbers */ for (i=0; ptr[i]; i++) { if (!isdigit((unsigned char)ptr[i])) { audit_msg(LOG_ERR, "Value %s should only be numbers - line %d", nv->value, line); return 1; } } /* convert to unsigned int */ errno = 0; i = strtoul(nv->value, NULL, 10); if (errno) { audit_msg(LOG_ERR, "Error converting string to a number (%s) - line %d", strerror(errno), line); return 1; } /* Check its range. While this value is technically unlimited, it's limited by the kernel, and we limit it here for sanity. */ if (i > INT_MAX) { audit_msg(LOG_ERR, "Error - converted number (%s) is too large - line %d", nv->value, line); return 1; } config->tcp_client_max_idle = (unsigned int)i; return 0; #endif } static int transport_parser(const struct nv_pair *nv, int line, struct daemon_conf *config) { int i; audit_msg(LOG_DEBUG, "transport_parser called with: %s", nv->value); for (i=0; transport_words[i].name != NULL; i++) { if (strcasecmp(nv->value, transport_words[i].name) == 0) { config->transport = transport_words[i].option; return 0; } } audit_msg(LOG_ERR, "Option %s not found - line %d", nv->value, line); return 1; } static int enable_krb5_parser(const struct nv_pair *nv, int line, struct daemon_conf *config) { audit_msg(LOG_DEBUG, "enable_krb5_parser called with: %s", nv->value); #ifndef USE_GSSAPI audit_msg(LOG_DEBUG, "GSSAPI support is not enabled, ignoring value at line %d", line); return 0; #else unsigned long i; for (i=0; yes_no_values[i].name != NULL; i++) { if (strcasecmp(nv->value, yes_no_values[i].name) == 0) { if (yes_no_values[i].option == 1) config->transport = T_KRB5; return 0; } } audit_msg(LOG_ERR, "Option %s not found - line %d", nv->value, line); return 1; #endif } static int krb5_principal_parser(const struct nv_pair *nv, int line, struct daemon_conf *config) { audit_msg(LOG_DEBUG,"krb5_principal_parser called with: %s",nv->value); #ifndef USE_GSSAPI audit_msg(LOG_DEBUG, "GSSAPI support is not enabled, ignoring value at line %d", line); #else config->krb5_principal = strdup(nv->value); #endif return 0; } static int krb5_key_file_parser(const struct nv_pair *nv, int line, struct daemon_conf *config) { audit_msg(LOG_DEBUG, "krb5_key_file_parser called with: %s", nv->value); #ifndef USE_GSSAPI audit_msg(LOG_DEBUG, "GSSAPI support is not enabled, ignoring value at line %d", line); #else config->krb5_key_file = strdup(nv->value); #endif return 0; } static int distribute_network_parser(const struct nv_pair *nv, int line, struct daemon_conf *config) { unsigned long i; audit_msg(LOG_DEBUG, "distribute_network_parser called with: %s", nv->value); for (i=0; yes_no_values[i].name != NULL; i++) { if (strcasecmp(nv->value, yes_no_values[i].name) == 0) { config->distribute_network_events = yes_no_values[i].option; return 0; } } audit_msg(LOG_ERR, "Option %s not found - line %d", nv->value, line); return 1; } static int q_depth_parser(const struct nv_pair *nv, int line, struct daemon_conf *config) { const char *ptr = nv->value; unsigned long i; audit_msg(LOG_DEBUG, "q_depth_parser called with: %s", nv->value); /* check that all chars are numbers */ for (i=0; ptr[i]; i++) { if (!isdigit((unsigned char)ptr[i])) { audit_msg(LOG_ERR, "Value %s should only be numbers - line %d", nv->value, line); return 1; } } /* convert to unsigned long */ errno = 0; i = strtoul(nv->value, NULL, 10); if (errno) { audit_msg(LOG_ERR, "Error converting string to a number (%s) - line %d", strerror(errno), line); return 1; } if (i > 99999) { audit_msg(LOG_ERR, "q_depth must be 99999 or less"); return 1; } else if (i < 512) audit_msg(LOG_WARNING, "q_depth should be larger than 512 for safety margin"); config->q_depth = i; return 0; } static int overflow_action_parser(const struct nv_pair *nv, int line, struct daemon_conf *config) { int i; audit_msg(LOG_DEBUG, "overflow_action_parser called with: %s", nv->value); for (i=0; overflow_actions[i].name != NULL; i++) { if (strcasecmp(nv->value, overflow_actions[i].name) == 0) { config->overflow_action = overflow_actions[i].option; return 0; } } audit_msg(LOG_ERR, "Option %s not found - line %d", nv->value, line); return 1; } static int max_restarts_parser(const struct nv_pair *nv, int line, struct daemon_conf *config) { const char *ptr = nv->value; unsigned long i; audit_msg(LOG_DEBUG, "max_restarts_parser called with: %s", nv->value); /* check that all chars are numbers */ for (i=0; ptr[i]; i++) { if (!isdigit((unsigned char)ptr[i])) { audit_msg(LOG_ERR, "Value %s should only be numbers - line %d", nv->value, line); return 1; } } /* convert to unsigned int */ errno = 0; i = strtoul(nv->value, NULL, 10); if (errno) { audit_msg(LOG_ERR, "Error converting string to a number (%s) - line %d", strerror(errno), line); return 1; } /* Check its range */ if (i > INT_MAX) { audit_msg(LOG_ERR, "Error - converted number (%s) is too large - line %d", nv->value, line); return 1; } config->max_restarts = (unsigned int)i; return 0; } static int plugin_dir_parser(const struct nv_pair *nv, int line, struct daemon_conf *config) { audit_msg(LOG_DEBUG, "plugin_dir_parser called with: %s", nv->value); if (nv->value == NULL) config->plugin_dir = NULL; else { size_t len = strlen(nv->value); free(config->plugin_dir); config->plugin_dir = malloc(len + 2); if (config->plugin_dir) { strcpy(config->plugin_dir, nv->value); if (len > 1 && config->plugin_dir[len - 1] != '/') config->plugin_dir[len] = '/'; config->plugin_dir[len + 1] = 0; } } return 0; } static int eoe_timeout_parser(const struct nv_pair *nv, int line, struct daemon_conf *config) { const char *ptr = nv->value; unsigned long i; audit_msg(LOG_DEBUG, "eoe_timeout_parser called with: %s", nv->value); /* check that all chars are numbers */ for (i=0; ptr[i]; i++) { if (!isdigit((unsigned char)ptr[i])) { audit_msg(LOG_ERR, "Value %s should only be numbers - line %d", nv->value, line); return 1; } } /* convert to unsigned long */ errno = 0; i = strtoul(nv->value, NULL, 10); if (errno) { audit_msg(LOG_ERR, "Error converting string to a number (%s) - line %d", strerror(errno), line); return 1; } config->end_of_event_timeout = i; return 0; } /* * Query file system and calculate in MB the given percentage is. * Returns 0 on error and a number otherwise. */ static unsigned long calc_percent(float percent, int fd) { int rc; struct statfs buf; rc = fstatfs(fd, &buf); if (rc == 0) { unsigned long free_space; // All blocks * percentage = free blocks threshold fsblkcnt_t free_blocks = buf.f_blocks * (percent/100.0); // That is then converted into megabytes and returned free_space = (buf.f_bsize * free_blocks) / MEGABYTE; return free_space; } return 0; } /* * This function translates a percentage of disk space to the * actual MB value for space left actions. */ void setup_percentages(struct daemon_conf *config, int fd) { if (!config->write_logs) return; if (config->daemonize != D_BACKGROUND) return; if (config->space_left_percent) config->space_left = calc_percent(config->space_left_percent, fd); if (config->admin_space_left_percent) config->admin_space_left = calc_percent(config->admin_space_left_percent, fd); if (config->space_left <= config->admin_space_left) audit_msg(LOG_ERR, "Error - space_left(%lu) must be larger than admin_space_left(%lu)", config->space_left, config->admin_space_left); } /* * This function is where we do the integrated check of the audit config * options. At this point, all fields have been read. Returns 0 if no * problems and 1 if problems detected. */ static int sanity_check(struct daemon_conf *config) { /* Error checking */ if (config->space_left_percent == 0 && config->admin_space_left_percent == 0 && config->space_left <= config->admin_space_left) { audit_msg(LOG_ERR, "Error - space_left(%lu) must be larger than admin_space_left(%lu)", config->space_left, config->admin_space_left); return 1; } if ((config->flush == FT_INCREMENTAL || config->flush == FT_INCREMENTAL_ASYNC) && config->freq == 0) { audit_msg(LOG_ERR, "Error - incremental flushing chosen, but 0 selected for freq"); return 1; } if (config->log_group != 0) { int rc = 0; char *path = strdup(config->log_file); const char *dir = dirname(path); if (dir && strcmp(dir, "/var/log") == 0) { audit_msg(LOG_ERR, "Error - log_file is directly in %s and chgrp" " will alter a system directory's permissions. Use" " another directory.", dir); rc = 1; } free(path); if (rc) return rc; } /* Warnings */ if (config->flush > FT_INCREMENTAL_ASYNC && config->freq != 0) { audit_msg(LOG_WARNING, "Warning - freq is non-zero and incremental flushing not selected."); } config->config_dir = config_dir; return 0; } const char *audit_lookup_format(int fmt) { int i; for (i=0; log_formats[i].name != NULL; i++) { if (log_formats[i].option == fmt) return log_formats[i].name; } return NULL; } int create_log_file(const char *val) { int fd; mode_t u; u = umask(S_IRWXO); fd = open(val, O_CREAT|O_EXCL|O_APPEND, S_IRUSR|S_IWUSR|S_IRGRP); if (fd < 0) audit_msg(LOG_ERR, "Unable to create %s (%s)", val, strerror(errno)); umask(u); return fd; } void free_config(struct daemon_conf *config) { free((void *)config->sender_ctx); free((void *)config->log_file); free((void *)config->node_name); free((void *)config->action_mail_acct); free((void *)config->space_left_exe); free((void *)config->admin_space_left_exe); free((void *)config->disk_full_exe); free((void *)config->disk_error_exe); free((void *)config->krb5_principal); free((void *)config->krb5_key_file); free((void *)config->plugin_dir); free((void *)config_dir); free(config_file); config_file = NULL; config->config_dir = NULL; } int resolve_node(struct daemon_conf *config) { int rc = 0; char tmp_name[255]; /* Get the host name representation */ switch (config->node_name_format) { case N_NONE: break; case N_HOSTNAME: if (gethostname(tmp_name, sizeof(tmp_name))) { audit_msg(LOG_ERR, "Unable to get machine name"); rc = -1; } else { // Remove any spaces char *p; while ((p = strchr(tmp_name, ' '))) *p = '_'; config->node_name = strdup(tmp_name); } break; case N_USER: if (config->node_name == NULL) { audit_msg(LOG_ERR, "User defined name missing"); rc = -1; } break; case N_FQD: if (gethostname(tmp_name, sizeof(tmp_name))) { audit_msg(LOG_ERR, "Unable to get machine name"); rc = -1; } else { int rc2; struct addrinfo *ai; struct addrinfo hints; memset(&hints, 0, sizeof(hints)); hints.ai_flags = AI_ADDRCONFIG | AI_CANONNAME; hints.ai_socktype = SOCK_STREAM; rc2 = getaddrinfo(tmp_name, NULL, &hints, &ai); if (rc2 != 0) { audit_msg(LOG_ERR, "Cannot resolve hostname %s (%s)", tmp_name, gai_strerror(rc2)); rc = -1; break; } config->node_name = strdup(ai->ai_canonname); freeaddrinfo(ai); } break; case N_NUMERIC: if (gethostname(tmp_name, sizeof(tmp_name))) { audit_msg(LOG_ERR, "Unable to get machine name"); rc = -1; } else { int rc2; struct addrinfo *ai; struct addrinfo hints; audit_msg(LOG_DEBUG, "Resolving numeric address for %s", tmp_name); memset(&hints, 0, sizeof(hints)); hints.ai_flags = AI_ADDRCONFIG | AI_PASSIVE; hints.ai_socktype = SOCK_STREAM; rc2 = getaddrinfo(tmp_name, NULL, &hints, &ai); if (rc2) { audit_msg(LOG_ERR, "Cannot resolve hostname %s (%s)", tmp_name, gai_strerror(rc2)); rc = -1; break; } inet_ntop(ai->ai_family, ai->ai_family == AF_INET ? (void *) &((struct sockaddr_in *)ai->ai_addr)->sin_addr : (void *) &((struct sockaddr_in6 *)ai->ai_addr)->sin6_addr, tmp_name, INET6_ADDRSTRLEN); freeaddrinfo(ai); config->node_name = strdup(tmp_name); } break; } if (rc == 0 && config->node_name) audit_msg(LOG_DEBUG, "Resolved node name: %s", config->node_name); return rc; } audit-4.0.2/src/ausearch-options.c0000644001034500103450000007760214655201403012537 /* ausearch-options.c - parse commandline options and configure ausearch * Copyright 2005-08,2010-11,2014,2016-17 Red Hat Inc., Durham, North Carolina. * Copyright (c) 2011 IBM Corp. * All Rights Reserved. * * 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 * * Authors: * Debora Velarde * Steve Grubb * Marcelo Henrique Cerri */ #include "config.h" #include #include #include #include #include #include #include #include #include "ausearch-options.h" #include "ausearch-time.h" #include "ausearch-int.h" #include "libaudit.h" #include "auparse-defs.h" /* Global vars that will be accessed by the main program */ char *user_file = NULL; int force_logs = 0; const char *checkpt_filename = NULL; /* checkpoint filename if present */ report_t report_format = RPT_DEFAULT; /* Global vars that will be accessed by the match model */ unsigned int event_id = -1; gid_t event_gid = -1, event_egid = -1; ilist *event_type = NULL; pid_t event_pid = -1, event_ppid = -1; success_t event_success = S_UNSET; auparse_esc_t escape_mode = AUPARSE_ESC_TTY; int event_exact_match = 0; uid_t event_uid = -1, event_euid = -1, event_loginuid = -2; const char *event_tuid = NULL, *event_teuid = NULL, *event_tauid = NULL; int event_syscall = -1, event_machine = -1; int event_ua = 0, event_ga = 0, event_se = 0; int just_one = 0; uint32_t event_session_id = -2; long long event_exit = 0; int event_exit_is_set = 0; int line_buffered = 0; int event_debug = 0; int checkpt_timeonly = 0; int extra_keys = 0, extra_labels = 0, extra_obj2 = 0, extra_time = 0; const char *event_key = NULL; const char *event_filename = NULL; const char *event_exe = NULL; const char *event_comm = NULL; const char *event_hostname = NULL; const char *event_terminal = NULL; const char *event_subject = NULL; const char *event_object = NULL; const char *event_uuid = NULL; const char *event_vmname = NULL; ilist *event_type; time_t arg_eoe_timeout = (time_t)0; slist *event_node_list = NULL; struct nv_pair { int value; const char *name; }; enum { S_EVENT, S_COMM, S_FILENAME, S_ALL_GID, S_EFF_GID, S_GID, S_HELP, S_HOSTNAME, S_INTERP, S_INFILE, S_MESSAGE_TYPE, S_PID, S_SYSCALL, S_OSUCCESS, S_TIME_END, S_TIME_START, S_TERMINAL, S_ALL_UID, S_EFF_UID, S_UID, S_LOGINID, S_VERSION, S_EXACT_MATCH, S_EXECUTABLE, S_CONTEXT, S_SUBJECT, S_OBJECT, S_PPID, S_KEY, S_RAW, S_NODE, S_IN_LOGS, S_JUST_ONE, S_SESSION, S_EXIT, S_LINEBUFFERED, S_UUID, S_VMNAME, S_DEBUG, S_CHECKPOINT, S_ARCH, S_FORMAT, S_EXTRA_TIME, S_EXTRA_LABELS, S_EXTRA_KEYS, S_EXTRA_OBJ2, S_ESCAPE, S_EOE_TMO }; static const struct nv_pair optiontab[] = { { S_EVENT, "-a" }, { S_ARCH, "--arch" }, { S_EVENT, "--event" }, { S_COMM, "-c" }, { S_COMM, "--comm" }, { S_CHECKPOINT, "--checkpoint" }, { S_DEBUG, "--debug" }, { S_EXIT, "-e" }, { S_EOE_TMO, "--eoe-timeout" }, { S_ESCAPE, "--escape" }, { S_EXIT, "--exit" }, { S_EXTRA_KEYS, "--extra-keys" }, { S_EXTRA_LABELS, "--extra-labels" }, { S_EXTRA_OBJ2, "--extra-obj2" }, { S_EXTRA_TIME, "--extra-time" }, { S_FILENAME, "-f" }, { S_FILENAME, "--file" }, { S_FORMAT, "--format" }, { S_ALL_GID, "-ga" }, { S_ALL_GID, "--gid-all" }, { S_EFF_GID, "-ge" }, { S_EFF_GID, "--gid-effective" }, { S_GID, "-gi" }, { S_GID, "--gid" }, { S_HELP, "-h" }, { S_HELP, "--help" }, { S_HOSTNAME, "-hn" }, { S_HOSTNAME, "--host" }, { S_INTERP, "-i" }, { S_INTERP, "--interpret" }, { S_INFILE, "-if" }, { S_INFILE, "--input" }, { S_IN_LOGS, "--input-logs" }, { S_JUST_ONE, "--just-one" }, { S_KEY, "-k" }, { S_KEY, "--key" }, { S_LINEBUFFERED, "-l" }, { S_LINEBUFFERED, "--line-buffered" }, { S_MESSAGE_TYPE, "-m" }, { S_MESSAGE_TYPE, "--message" }, { S_NODE, "-n" }, { S_NODE, "--node" }, { S_OBJECT, "-o" }, { S_OBJECT, "--object" }, { S_PID, "-p" }, { S_PID, "--pid" }, { S_PPID, "-pp" }, { S_PPID, "--ppid" }, { S_RAW, "-r" }, { S_RAW, "--raw" }, { S_SYSCALL, "-sc" }, { S_SYSCALL, "--syscall" }, { S_CONTEXT, "-se" }, { S_CONTEXT, "--context" }, { S_SESSION, "--session" }, { S_SUBJECT, "-su" }, { S_SUBJECT, "--subject" }, { S_OSUCCESS, "-sv" }, { S_OSUCCESS, "--success" }, { S_TIME_END, "-te"}, { S_TIME_END, "--end"}, { S_TIME_START, "-ts" }, { S_TIME_START, "--start" }, { S_TERMINAL, "-tm" }, { S_TERMINAL, "--terminal" }, { S_ALL_UID, "-ua" }, { S_ALL_UID, "--uid-all" }, { S_EFF_UID, "-ue" }, { S_EFF_UID, "--uid-effective" }, { S_UID, "-ui" }, { S_UID, "--uid" }, { S_UUID, "-uu" }, { S_UUID, "--uuid" }, { S_LOGINID, "-ul" }, { S_LOGINID, "--loginuid" }, { S_VERSION, "-v" }, { S_VERSION, "--version" }, { S_VMNAME, "-vm" }, { S_VMNAME, "--vm-name" }, { S_EXACT_MATCH, "-w" }, { S_EXACT_MATCH, "--word" }, { S_EXECUTABLE, "-x" }, { S_EXECUTABLE, "--executable" } }; #define OPTION_NAMES (sizeof(optiontab)/sizeof(optiontab[0])) static int audit_lookup_option(const char *name) { unsigned int i; for (i = 0; i < OPTION_NAMES; i++) if (!strcmp(optiontab[i].name, name)) return optiontab[i].value; return -1; } static void usage(void) { printf("usage: ausearch [options]\n" "\t-a,--event \tsearch based on audit event id\n" "\t--arch \t\t\tsearch based on the CPU architecture\n" "\t-c,--comm \t\tsearch based on command line name\n" "\t--checkpoint \tsearch from last complete event\n" "\t--debug\t\t\tWrite malformed events that are skipped to stderr\n" "\t-e,--exit \tsearch based on syscall exit code\n" "\t-escape