From: ramsdell@mitre.org (John D. Ramsdell)
To: Steve Grubb <sgrubb@redhat.com>
Cc: Linux Audit <linux-audit@redhat.com>
Subject: [PATCH] Add auparse_version
Date: 27 Jul 2007 08:25:18 -0400 [thread overview]
Message-ID: <ogt7iom11ap.fsf@oolong.mitre.org> (raw)
In-Reply-To: <200707251621.38095.sgrubb@redhat.com>
Let me suggest that a library function be added to auparse that
identifies the version of the library to its clients. This is helpful
for generating good debugging messages, but also eases the task of
associating a version number with the output of a log analysis
program. Knowing the version number may be important as
auparse/interpret.c may interpret more fields in the future, and
analysis programs may be sensitive to the changes.
To apply, use -p2, not the usual -p1.
John
diff -urN a/audit-1.5.6/auparse/auparse.c b/audit-1.5.6/auparse/auparse.c
--- a/audit-1.5.6/auparse/auparse.c 2007-06-18 16:48:53.000000000 -0400
+++ b/audit-1.5.6/auparse/auparse.c 2007-07-27 08:00:58.000000000 -0400
@@ -29,6 +29,12 @@
#include <string.h>
#include <unistd.h>
+/* provide version information for this library to clients */
+const char *
+auparse_version(void)
+{
+ return VERSION;
+}
static int debug = 0;
diff -urN a/audit-1.5.6/auparse/auparse.h b/audit-1.5.6/auparse/auparse.h
--- a/audit-1.5.6/auparse/auparse.h 2007-05-30 16:37:40.000000000 -0400
+++ b/audit-1.5.6/auparse/auparse.h 2007-07-27 07:53:33.000000000 -0400
@@ -89,6 +89,8 @@
int auparse_get_field_int(auparse_state_t *au);
const char *auparse_interpret_field(auparse_state_t *au);
+/* Identify library version */
+const char *auparse_version(void);
#ifdef __cplusplus
}
diff -urN a/audit-1.5.6/docs/auparse_version.3 b/audit-1.5.6/docs/auparse_version.3
--- a/audit-1.5.6/docs/auparse_version.3 1969-12-31 19:00:00.000000000 -0500
+++ b/audit-1.5.6/docs/auparse_version.3 2007-07-27 07:58:42.000000000 -0400
@@ -0,0 +1,18 @@
+.TH "AUPARSE_VERSION" "3" "July 2007" "Red Hat" "Linux Audit API"
+.SH NAME
+auparse_version \- version number of library
+.SH "SYNOPSIS"
+.B #include <auparse.h>
+.sp
+const char *auparse_version (void);
+
+.SH "DESCRIPTION"
+
+auparse_version returns the version number of the library.
+
+.SH "RETURN VALUE"
+
+A string containing the version number.
+
+.SH AUTHOR
+John D. Ramsdell
diff -urN a/audit-1.5.6/docs/Makefile.am b/audit-1.5.6/docs/Makefile.am
--- a/audit-1.5.6/docs/Makefile.am 2007-05-30 16:37:40.000000000 -0400
+++ b/audit-1.5.6/docs/Makefile.am 2007-07-27 07:55:57.000000000 -0400
@@ -43,5 +43,5 @@
auparse_next_field.3 auparse_next_record.3 auparse_reset.3 \
auparse_timestamp_compare.3 aureport.8 ausearch.8 ausearch_add_item.3 \
ausearch_clear.3 ausearch_next_event.3 ausearch_set_stop.3 autrace.8 \
-get_auditfail_action.3 set_aumessage_mode.3
+get_auditfail_action.3 set_aumessage_mode.3 auparse_version.3
diff -urN a/audit-1.5.6/docs/Makefile.in b/audit-1.5.6/docs/Makefile.in
--- a/audit-1.5.6/docs/Makefile.in 2007-07-27 07:28:33.000000000 -0400
+++ b/audit-1.5.6/docs/Makefile.in 2007-07-27 08:02:39.000000000 -0400
@@ -214,7 +214,7 @@
auparse_next_field.3 auparse_next_record.3 auparse_reset.3 \
auparse_timestamp_compare.3 aureport.8 ausearch.8 ausearch_add_item.3 \
ausearch_clear.3 ausearch_next_event.3 ausearch_set_stop.3 autrace.8 \
-get_auditfail_action.3 set_aumessage_mode.3
+get_auditfail_action.3 set_aumessage_mode.3 auparse_version.3
all: all-am
next prev parent reply other threads:[~2007-07-27 12:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-25 20:21 audit 1.5.6 released Steve Grubb
2007-07-27 12:25 ` John D. Ramsdell [this message]
2007-07-27 14:10 ` open record looks like openat John D. Ramsdell
2007-07-27 14:59 ` Steve Grubb
2007-07-27 15:15 ` John D. Ramsdell
2007-07-27 17:41 ` Wieprecht, Karen M.
2007-07-27 17:57 ` John D. Ramsdell
2007-07-27 18:14 ` John D. Ramsdell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ogt7iom11ap.fsf@oolong.mitre.org \
--to=ramsdell@mitre.org \
--cc=linux-audit@redhat.com \
--cc=sgrubb@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox