Index: stable/10/contrib/openbsm/bin/praudit/praudit.1 =================================================================== --- stable/10/contrib/openbsm/bin/praudit/praudit.1 (revision 337255) +++ stable/10/contrib/openbsm/bin/praudit/praudit.1 (revision 337256) @@ -1,119 +1,121 @@ .\" Copyright (c) 2004-2009 Apple Inc. .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. Neither the name of Apple Inc. ("Apple") nor the names of .\" its contributors may be used to endorse or promote products derived .\" from this software without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR .\" ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING .\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd August 4, 2009 +.Dd June 11, 2018 .Dt PRAUDIT 1 .Os .Sh NAME .Nm praudit .Nd "print the contents of audit trail files" .Sh SYNOPSIS .Nm .Op Fl lnpx .Op Fl r | s .Op Fl d Ar del .Op Ar .Sh DESCRIPTION The .Nm utility prints the contents of the audit trail files to the standard output in human-readable form. If no .Ar file argument is specified, the standard input is used by default. .Pp The options are as follows: .Bl -tag -width indent .It Fl d Ar del Specifies the delimiter. The default delimiter is the comma. .It Fl l Prints the entire record on the same line. If this option is not specified, every token is displayed on a different line. .It Fl n Do not convert user and group IDs to their names but leave in their numeric forms. .It Fl p Specify this option if input to .Nm is piped from the .Xr tail 1 utility. This causes .Nm to sync to the start of the next record. .It Fl r Prints the records in their raw, numeric form. This option is exclusive from .Fl s . .It Fl s Prints the tokens in their short form. Short text representations for record and event type are displayed. This option is exclusive from .Fl r . .It Fl x Print audit records in the XML output format. .El .Pp If the raw or short forms are not specified, the default is to print the tokens in their long form. Events are displayed as per their descriptions given in .Pa /etc/security/audit_event ; UIDs and GIDs are expanded to their names; dates and times are displayed in human-readable format. +.Sh EXIT STATUS +.Ex -std .Sh FILES .Bl -tag -width ".Pa /etc/security/audit_control" -compact .It Pa /etc/security/audit_class Descriptions of audit event classes. .It Pa /etc/security/audit_event Descriptions of audit events. .El .Sh SEE ALSO .Xr auditreduce 1 , .Xr audit 4 , .Xr auditpipe 4 , .Xr audit_class 5 , .Xr audit_event 5 .Sh HISTORY The OpenBSM implementation was created by McAfee Research, the security division of McAfee Inc., under contract to Apple Computer Inc.\& in 2004. It was subsequently adopted by the TrustedBSD Project as the foundation for the OpenBSM distribution. .Sh AUTHORS .An -nosplit This software was created by McAfee Research, the security research division of McAfee, Inc., under contract to Apple Computer Inc. Additional authors include .An Wayne Salamon , .An Robert Watson , and SPARTA Inc. .Pp The Basic Security Module (BSM) interface to audit records and audit event stream format were defined by Sun Microsystems. Index: stable/10/contrib/openbsm/bin/praudit/praudit.c =================================================================== --- stable/10/contrib/openbsm/bin/praudit/praudit.c (revision 337255) +++ stable/10/contrib/openbsm/bin/praudit/praudit.c (revision 337256) @@ -1,173 +1,173 @@ /*- * Copyright (c) 2004-2009 Apple Inc. * Copyright (c) 2006 Martin Voros * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of Apple Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ /* * Tool used to parse audit records conforming to the BSM structure. */ /* * praudit [-lnpx] [-r | -s] [-d del] [file ...] */ #include #include #include #include extern char *optarg; extern int optind, optopt, opterr,optreset; static char *del = ","; /* Default delimiter. */ static int oneline = 0; static int partial = 0; static int oflags = AU_OFLAG_NONE; static void usage(void) { fprintf(stderr, "usage: praudit [-lnpx] [-r | -s] [-d del] " "[file ...]\n"); exit(1); } /* * Token printing for each token type . */ static int print_tokens(FILE *fp) { u_char *buf; tokenstr_t tok; int reclen; int bytesread; /* Allow tail -f | praudit to work. */ if (partial) { u_char type = 0; /* Record must begin with a header token. */ do { type = fgetc(fp); } while(type != AUT_HEADER32); ungetc(type, fp); } while ((reclen = au_read_rec(fp, &buf)) != -1) { bytesread = 0; while (bytesread < reclen) { /* Is this an incomplete record? */ if (-1 == au_fetch_tok(&tok, buf + bytesread, reclen - bytesread)) break; au_print_flags_tok(stdout, &tok, del, oflags); bytesread += tok.len; if (oneline) { if (!(oflags & AU_OFLAG_XML)) printf("%s", del); } else printf("\n"); } free(buf); if (oneline) printf("\n"); fflush(stdout); } return (0); } int main(int argc, char **argv) { int ch; int i; FILE *fp; while ((ch = getopt(argc, argv, "d:lnprsx")) != -1) { switch(ch) { case 'd': del = optarg; break; case 'l': oneline = 1; break; case 'n': oflags |= AU_OFLAG_NORESOLVE; break; case 'p': partial = 1; break; case 'r': if (oflags & AU_OFLAG_SHORT) usage(); /* Exclusive from shortfrm. */ oflags |= AU_OFLAG_RAW; break; case 's': if (oflags & AU_OFLAG_RAW) usage(); /* Exclusive from raw. */ oflags |= AU_OFLAG_SHORT; break; case 'x': oflags |= AU_OFLAG_XML; break; case '?': default: usage(); } } if (oflags & AU_OFLAG_XML) au_print_xml_header(stdout); /* For each of the files passed as arguments dump the contents. */ if (optind == argc) { print_tokens(stdin); return (1); } for (i = optind; i < argc; i++) { fp = fopen(argv[i], "r"); if ((fp == NULL) || (print_tokens(fp) == -1)) perror(argv[i]); if (fp != NULL) fclose(fp); } if (oflags & AU_OFLAG_XML) au_print_xml_footer(stdout); - return (1); + return (0); } Index: stable/10/etc/mtree/BSD.tests.dist =================================================================== --- stable/10/etc/mtree/BSD.tests.dist (revision 337255) +++ stable/10/etc/mtree/BSD.tests.dist (revision 337256) @@ -1,694 +1,696 @@ # $FreeBSD$ # # Please see the file src/etc/mtree/README before making changes to this file. # /set type=dir uname=root gname=wheel mode=0755 . bin cat .. chflags .. chmod .. date .. dd .. echo .. expr .. ln .. ls .. mkdir .. mv .. pax .. pkill .. rcp .. rmdir .. sh builtins .. errors .. execution .. expansion .. parameters .. parser .. set-e .. .. sleep .. test .. .. cddl lib .. sbin .. usr.bin .. usr.sbin dtrace common aggs .. arithmetic .. arrays .. assocs .. begin .. bitfields .. buffering .. builtinvar .. cg .. clauses .. cpc .. decls .. drops .. dtraceUtil .. end .. enum .. error .. exit .. fbtprovider .. funcs .. grammar .. include .. inline .. io .. ip .. java_api .. json .. lexer .. llquantize .. mdb .. mib .. misc .. multiaggs .. offsetof .. operators .. pid .. plockstat .. pointers .. pragma .. predicates .. preprocessor .. print .. printa .. printf .. privs .. probes .. proc .. profile-n .. providers .. raise .. rates .. safety .. scalars .. sched .. scripting .. sdt .. sizeof .. speculation .. stability .. stack .. stackdepth .. stop .. strlen .. strtoll .. struct .. syscall .. sysevent .. tick-n .. trace .. tracemem .. translators .. typedef .. types .. uctf .. union .. usdt .. ustack .. vars .. version .. .. .. .. .. etc rc.d .. .. games .. gnu lib .. usr.bin diff .. .. .. lib atf libatf-c detail .. .. libatf-c++ detail .. .. test-programs .. .. libarchive .. libc c063 .. db .. gen execve .. posix_spawn .. .. hash data .. .. iconv .. inet .. locale .. net getaddrinfo data .. .. .. nss .. regex data .. .. resolv .. rpc .. ssp .. setjmp .. stdio .. stdlib .. string .. sys .. time .. tls dso .. .. termios .. ttyio .. .. libcam .. libcrypt .. libkvm .. libmp .. libnv .. libpam .. librt .. libsbuf .. libthr dlopen .. .. libutil .. msun .. .. libexec atf atf-check .. atf-sh .. .. tftpd .. .. sbin dhclient .. devd .. growfs .. mdconfig .. .. secure lib .. libexec .. usr.bin .. usr.sbin .. .. share examples tests atf .. plain .. tap .. .. .. zoneinfo .. .. sys acl .. aio .. fifo .. file .. fs tmpfs .. .. geom class concat .. eli .. gate .. gpt .. mirror .. nop .. raid3 .. shsec .. stripe .. uzip etalon .. .. .. .. kern acct .. execve .. pipe .. .. kqueue libkqueue .. .. mac bsdextended .. portacl .. .. mqueue .. netinet .. pjdfstest chflags .. chmod .. chown .. ftruncate .. granular .. link .. mkdir .. mkfifo .. mknod .. open .. rename .. rmdir .. symlink .. truncate .. unlink .. .. posixshm .. vfs .. vm .. .. usr.bin apply .. basename .. bmake archives fmt_44bsd .. fmt_44bsd_mod .. fmt_oldbsd .. .. basic t0 .. t1 .. t2 .. t3 .. .. execution ellipsis .. empty .. joberr .. plus .. .. shell builtin .. meta .. path .. path_select .. replace .. select .. .. suffixes basic .. src_wild1 .. src_wild2 .. .. syntax directive-t0 .. enl .. funny-targets .. semi .. .. sysmk t0 2 1 .. .. mk .. .. t1 2 1 .. .. mk .. .. t2 2 1 .. .. mk .. .. .. variables modifier_M .. modifier_t .. opt_V .. t0 .. .. .. bsdcat .. calendar .. cmp .. compress .. cpio .. col .. comm .. cut .. dirname .. du .. file2c .. getconf .. grep .. gzip .. join .. jot .. lastcomm .. limits .. m4 .. ncal .. opensm .. pr .. printf .. procstat .. sed regress.multitest.out .. .. stat .. tail .. tar .. timeout .. tr .. truncate .. uudecode .. uuencode .. uniq .. xargs .. yacc yacc .. .. .. usr.sbin chown .. etcupdate .. extattr .. fstyp .. makefs .. newsyslog .. nmtree .. + praudit + .. pw .. rpcbind .. sa .. .. .. # vim: set expandtab ts=4 sw=4: Index: stable/10/usr.sbin/praudit/Makefile =================================================================== --- stable/10/usr.sbin/praudit/Makefile (revision 337255) +++ stable/10/usr.sbin/praudit/Makefile (revision 337256) @@ -1,16 +1,19 @@ # # $FreeBSD$ # OPENBSMDIR=${.CURDIR}/../../contrib/openbsm .PATH: ${OPENBSMDIR}/bin/praudit PROG= praudit MAN= praudit.1 WARNS?= 3 DPADD= ${LIBBSM} LDADD= -lbsm +HAS_TESTS= +SUBDIR.${MK_TESTS}+= tests + .include Index: stable/10/usr.sbin/praudit/tests/Makefile =================================================================== --- stable/10/usr.sbin/praudit/tests/Makefile (nonexistent) +++ stable/10/usr.sbin/praudit/tests/Makefile (revision 337256) @@ -0,0 +1,23 @@ +# $FreeBSD$ + +PACKAGE= tests + +TESTSDIR= ${TESTSBASE}/usr.sbin/praudit + +ATF_TESTS_SH= praudit_test + +${PACKAGE}FILES+= \ + input/trail \ + input/corrupted \ + input/del_comma \ + input/del_underscore \ + input/no_args \ + input/numeric_form \ + input/raw_form \ + input/same_line \ + input/short_form \ + input/xml_form + +TEST_METADATA+= timeout="10" + +.include Property changes on: stable/10/usr.sbin/praudit/tests/Makefile ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: stable/10/usr.sbin/praudit/tests/input/corrupted =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: stable/10/usr.sbin/praudit/tests/input/corrupted ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: stable/10/usr.sbin/praudit/tests/input/del_comma =================================================================== --- stable/10/usr.sbin/praudit/tests/input/del_comma (nonexistent) +++ stable/10/usr.sbin/praudit/tests/input/del_comma (revision 337256) @@ -0,0 +1,7 @@ +header,113,11,socket(2),0,Mon Jun 11 10:18:45 2018, + 380 msec +argument,1,0x1c,domain +argument,2,0x2,type +argument,3,0x0,protocol +subject,root,root,wheel,root,0,7053,4724,37636,10.0.2.2 +return,success,3 +trailer,113 Property changes on: stable/10/usr.sbin/praudit/tests/input/del_comma ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +y \ No newline at end of property Index: stable/10/usr.sbin/praudit/tests/input/del_underscore =================================================================== --- stable/10/usr.sbin/praudit/tests/input/del_underscore (nonexistent) +++ stable/10/usr.sbin/praudit/tests/input/del_underscore (revision 337256) @@ -0,0 +1,7 @@ +header_113_11_socket(2)_0_Mon Jun 11 10:18:45 2018_ + 380 msec +argument_1_0x1c_domain +argument_2_0x2_type +argument_3_0x0_protocol +subject_root_root_wheel_root_0_7053_4724_37636_10.0.2.2 +return_success_3 +trailer_113 Property changes on: stable/10/usr.sbin/praudit/tests/input/del_underscore ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +y \ No newline at end of property Index: stable/10/usr.sbin/praudit/tests/input/no_args =================================================================== --- stable/10/usr.sbin/praudit/tests/input/no_args (nonexistent) +++ stable/10/usr.sbin/praudit/tests/input/no_args (revision 337256) @@ -0,0 +1,7 @@ +header,113,11,socket(2),0,Mon Jun 11 10:18:45 2018, + 380 msec +argument,1,0x1c,domain +argument,2,0x2,type +argument,3,0x0,protocol +subject,root,root,wheel,root,0,7053,4724,37636,10.0.2.2 +return,success,3 +trailer,113 Property changes on: stable/10/usr.sbin/praudit/tests/input/no_args ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +y \ No newline at end of property Index: stable/10/usr.sbin/praudit/tests/input/numeric_form =================================================================== --- stable/10/usr.sbin/praudit/tests/input/numeric_form (nonexistent) +++ stable/10/usr.sbin/praudit/tests/input/numeric_form (revision 337256) @@ -0,0 +1,7 @@ +header,113,11,socket(2),0,Mon Jun 11 10:18:45 2018, + 380 msec +argument,1,0x1c,domain +argument,2,0x2,type +argument,3,0x0,protocol +subject,root,root,wheel,root,0,7053,4724,37636,10.0.2.2 +return,success,3 +trailer,113 Property changes on: stable/10/usr.sbin/praudit/tests/input/numeric_form ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +y \ No newline at end of property Index: stable/10/usr.sbin/praudit/tests/input/raw_form =================================================================== --- stable/10/usr.sbin/praudit/tests/input/raw_form (nonexistent) +++ stable/10/usr.sbin/praudit/tests/input/raw_form (revision 337256) @@ -0,0 +1,7 @@ +20,113,11,183,0,1528712325,380 +45,1,0x1c,domain +45,2,0x2,type +45,3,0x0,protocol +36,0,0,0,0,0,7053,4724,37636,10.0.2.2 +39,0,3 +19,113 Property changes on: stable/10/usr.sbin/praudit/tests/input/raw_form ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +y \ No newline at end of property Index: stable/10/usr.sbin/praudit/tests/input/same_line =================================================================== --- stable/10/usr.sbin/praudit/tests/input/same_line (nonexistent) +++ stable/10/usr.sbin/praudit/tests/input/same_line (revision 337256) @@ -0,0 +1 @@ +header,113,11,socket(2),0,Mon Jun 11 10:18:45 2018, + 380 msec,argument,1,0x1c,domain,argument,2,0x2,type,argument,3,0x0,protocol,subject,root,root,wheel,root,0,7053,4724,37636,10.0.2.2,return,success,3,trailer,113, Property changes on: stable/10/usr.sbin/praudit/tests/input/same_line ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +y \ No newline at end of property Index: stable/10/usr.sbin/praudit/tests/input/short_form =================================================================== --- stable/10/usr.sbin/praudit/tests/input/short_form (nonexistent) +++ stable/10/usr.sbin/praudit/tests/input/short_form (revision 337256) @@ -0,0 +1,7 @@ +header,113,11,AUE_SOCKET,0,Mon Jun 11 10:18:45 2018, + 380 msec +argument,1,0x1c,domain +argument,2,0x2,type +argument,3,0x0,protocol +subject,root,root,wheel,root,0,7053,4724,37636,10.0.2.2 +return,success,3 +trailer,113 Property changes on: stable/10/usr.sbin/praudit/tests/input/short_form ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +y \ No newline at end of property Index: stable/10/usr.sbin/praudit/tests/input/trail =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: stable/10/usr.sbin/praudit/tests/input/trail ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: stable/10/usr.sbin/praudit/tests/input/xml_form =================================================================== --- stable/10/usr.sbin/praudit/tests/input/xml_form (nonexistent) +++ stable/10/usr.sbin/praudit/tests/input/xml_form (revision 337256) @@ -0,0 +1,12 @@ + + + + + + + + + + + + Property changes on: stable/10/usr.sbin/praudit/tests/input/xml_form ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +y \ No newline at end of property Index: stable/10/usr.sbin/praudit/tests/praudit_test.sh =================================================================== --- stable/10/usr.sbin/praudit/tests/praudit_test.sh (nonexistent) +++ stable/10/usr.sbin/praudit/tests/praudit_test.sh (revision 337256) @@ -0,0 +1,183 @@ +# +# Copyright (c) 2018 Aniket Pandey +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + + +atf_test_case praudit_delim_comma +praudit_delim_comma_head() +{ + atf_set "descr" "Verify that comma delimiter is present with -d ',' cmd" +} + +praudit_delim_comma_body() +{ + atf_check -o file:$(atf_get_srcdir)/del_comma \ + praudit -d "," $(atf_get_srcdir)/trail +} + + +atf_test_case praudit_delim_underscore +praudit_delim_underscore_head() +{ + atf_set "descr" "Verify that underscore delimiter is present with -d _" +} + +praudit_delim_underscore_body() +{ + atf_check -o file:$(atf_get_srcdir)/del_underscore \ + praudit -d "_" $(atf_get_srcdir)/trail +} + + +atf_test_case praudit_no_args +praudit_no_args_head() +{ + atf_set "descr" "Verify that praudit outputs default form without " \ + "any arguments" +} + +praudit_no_args_body() +{ + atf_check -o file:$(atf_get_srcdir)/no_args \ + praudit $(atf_get_srcdir)/trail +} + + +atf_test_case praudit_numeric_form +praudit_numeric_form_head() +{ + atf_set "descr" "Verify that praudit outputs the numeric form " \ + "with -n flag" +} + +praudit_numeric_form_body() +{ + atf_check -o file:$(atf_get_srcdir)/numeric_form \ + praudit -n $(atf_get_srcdir)/trail +} + + +atf_test_case praudit_raw_form +praudit_raw_form_head() +{ + atf_set "descr" "Verify that praudit outputs the raw form with -r flag" +} + +praudit_raw_form_body() +{ + atf_check -o file:$(atf_get_srcdir)/raw_form \ + praudit -r $(atf_get_srcdir)/trail +} + + +atf_test_case praudit_same_line +praudit_same_line_head() +{ + atf_set "descr" "Verify that praudit outputs the trail in the same " \ + "line with -l flag" +} + +praudit_same_line_body() +{ + atf_check -o file:$(atf_get_srcdir)/same_line \ + praudit -l $(atf_get_srcdir)/trail +} + + +atf_test_case praudit_short_form +praudit_short_form_head() +{ + atf_set "descr" "Verify that praudit outputs the short form " \ + "with -s flag" +} + +praudit_short_form_body() +{ + atf_check -o file:$(atf_get_srcdir)/short_form \ + praudit -s $(atf_get_srcdir)/trail +} + + +atf_test_case praudit_xml_form +praudit_xml_form_head() +{ + atf_set "descr" "Verify that praudit outputs the XML file with -x flag" +} + +praudit_xml_form_body() +{ + atf_check -o file:$(atf_get_srcdir)/xml_form \ + praudit -x $(atf_get_srcdir)/trail +} + + +atf_test_case praudit_sync_to_next_record +praudit_sync_to_next_record_head() +{ + atf_set "descr" "Verify that praudit(1) outputs the last few audit " \ + "records when the initial part of the trail is " \ + "corrputed." +} + +praudit_sync_to_next_record_body() +{ + # The 'corrupted' binary file contains some redundant + # binary symbols before the actual audit record. + # Since 'praudit -p' syncs to the next legitimate record, + # it would skip the corrupted part and print the desired + # audit record to STDOUT. + atf_check -o file:$(atf_get_srcdir)/no_args \ + praudit -p $(atf_get_srcdir)/corrupted +} + + +atf_test_case praudit_raw_short_exclusive +praudit_raw_short_exclusive_head() +{ + atf_set "descr" "Verify that praudit outputs usage message on stderr " \ + "when both raw and short options are specified" +} + +praudit_raw_short_exclusive_body() +{ + atf_check -s exit:1 -e match:"usage: praudit" \ + praudit -rs $(atf_get_srcdir)/trail +} + + +atf_init_test_cases() +{ + atf_add_test_case praudit_delim_comma + atf_add_test_case praudit_delim_underscore + atf_add_test_case praudit_no_args + atf_add_test_case praudit_numeric_form + atf_add_test_case praudit_raw_form + atf_add_test_case praudit_same_line + atf_add_test_case praudit_short_form + atf_add_test_case praudit_xml_form + atf_add_test_case praudit_sync_to_next_record + atf_add_test_case praudit_raw_short_exclusive +} Property changes on: stable/10/usr.sbin/praudit/tests/praudit_test.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: stable/10 =================================================================== --- stable/10 (revision 337255) +++ stable/10 (revision 337256) Property changes on: stable/10 ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /head:r335287,335290