Package: libaudit-dev
Version: 1.7.18-1
Severity: minor
Justification: documentation
Tags: upstream patch
Hi,
Today in the boot log, I found
systemd[1]: Failed to connect to audit log: Protocol not supported
Looking at the systemd source, I see that this means audit_open()
returned -1 with errno == EPROTONOSUPPORT. The underlying cause is
that the kernel in use was built without audit support.
So far so sane. I would like to consider patching systemd to accept
this error silently, just as though it had been built without libaudit
support. Something like:
if ((fd = audit_open(...)) < 0 && errno != EPROTONOSUPPORT)
perror(...);
One problem: is that the right errno check? I.e., could audit_open
yield that error code for some other reason? Alas, the audit_open(3)
manpage does not have an ERRORS section like open(2) does, so I don't
know.
How about this patch? It would have told me that another possibility
to check for is EAFNOSUPPORT and that these errno values indeed just
represent lack of kernel support.
---
docs/audit_open.3 | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/docs/audit_open.3 b/docs/audit_open.3
index 0feb7828..6ec8eb0a 100644
--- a/docs/audit_open.3
+++ b/docs/audit_open.3
@@ -14,6 +14,18 @@ audit_open creates a NETLINK_AUDIT socket for communication
with the kernel part
Returns \-1 if an error occurs; otherwise, the return value is a descriptor
referencing the socket.
+.SH ERRORS
+
+The
+.BR audit_open ()
+function may fail and set
+.I errno
+for any of the errors specified for the
+.BR socket (2)
+and
+.BR fcntl (2)
+routines.
+
.SH "SEE ALSO"
.BR netlink (7).
--
1.7.7.rc1
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]