George C. Wilson wrote:
On Wed, Nov 22, 2006 at 01:16:31PM -0500, Daniel J Walsh wrote:
import audit
fd=audit.audit_open()
print audit.audit_is_enabled(fd)
Getting the current get_reply bindings to work is going to be very
difficult.
Yeah, it don't think it will be straightforward. I got this hokey code
to satisty the method call:
inreply = audit.audit_reply()
rc = audit.audit_get_reply(fd, inreply, audit.GET_REPLY_BLOCKING, 0)
Which obviously can't work without some notion of call by reference. From
looking at the SWIG documentation, a C struct passed by pointer and modified
would be passed out of the python method as an additional return value. So,
something like
rc, reply = audit.audit_get_reply(fd, audit.GET_REPLY_BLOCKING, 0)
is more what I'd expect the method invocation to look like.
Is audit.audit_is_enabled() sufficient? It only returns whether audit is
enabled, not necessarily alive, right?
audit_reply is checking that the status is running. It is doing the
equivalent of what you were trying to do. Steve Grubb wants to
discourage this use of this function, so that people do not do
if (audit_reply()) {
audit_send()
}
But would rather just
audit_send()
--
redhat-lspp mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/redhat-lspp