public inbox for linux-audit@redhat.com
 help / color / mirror / Atom feed
* auparse, stdin, and AUPARSE_CB_EVENT_READY
@ 2012-03-06  0:23 dump
  2012-03-07 16:50 ` Guillaume Destuynder
  2012-03-07 17:48 ` Steve Grubb
  0 siblings, 2 replies; 4+ messages in thread
From: dump @ 2012-03-06  0:23 UTC (permalink / raw)
  To: linux-audit

Hi,

I made a audispd plugin, which reads from stdin and sends the strings to
auparse_feed() (auditd-2.1.3).


This works fine on the command line.

When called from audispd however, it gives AUPARSE_CB_EVENT_READY for
each single message, instead of after a complete event has been parsed.

So when you have 4 messages for one event:
- each of them appear as a single event when the plugin is started via
audispd.
- a single even for all 4 messages appear when the plugin is started on
the command line (and the log data fed via stdin, like cat test |
audispd-testplugin)

Looking at the write code it looks ok (audisp/audispd.c):

static int write_to_plugin(event_t *e, const char *string, size_t
string_len,
.. (note that i'm using string type so its the string code part)
if (conf->p->format == F_STRING) {
do {
rc = write(conf->p->plug_pipe[1], string, string_len);
} while (rc < 0 && errno == EINTR);
}

Do you know what causes this behavior, and/or how to "fix" it?


Thanks

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-03-07 17:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-06  0:23 auparse, stdin, and AUPARSE_CB_EVENT_READY dump
2012-03-07 16:50 ` Guillaume Destuynder
2012-03-07 17:19   ` Steve Grubb
2012-03-07 17:48 ` Steve Grubb

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox