Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Accessing libbsm functions (conditionally compiled with #if defined(_KERNEL) || defined(KERNEL))

5 views
Skip to first unread message

Mateusz Piotrowski

unread,
Aug 5, 2016, 1:28:52 PM8/5/16
to
Hello,

I am participating in Google Summer of Code and I work on converting auditing logs from the Linux Audit format to the BSM format (more details are available on wiki[1] and GitHub[2][3]).

I use libbsm to generate tokens. After including <bsm/libbsm.h> I am able to most of the functions listed
in au_token(3) (note that this manual is a little bit outdated), however I am unable to call au_to_attr() and to define
a struct vnode_au_info variable which is the parameter of au_to_attr().

I read the source code and I found out that au_to_attr() is prototyped in sys/bsm/audit_record.h like this:

#if defined(_KERNEL) || defined(KERNEL)
token_t *au_to_attr(struct vnode_au_info *vni);
token_t *au_to_attr32(struct vnode_au_info *vni);
token_t *au_to_attr64(struct vnode_au_info *vni);
#endif

The prototype of struct vnode_au_info is wrapped in if-defined-kernel-macros as well in the same file.

What should I do to be able to use those functions?
Why are those functions available only when the library was compiled with KERNEL defined?

Thanks for any help/hints.

-Mateusz

[1]: https://wiki.freebsd.org/SummerOfCode2016/NonBSMtoBSMConversionTools
[2]: https://github.com/0mp/freebsd
[3]: https://github.com/0mp/freebsd/wiki
_______________________________________________
freebsd...@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hacke...@freebsd.org"

0 new messages