chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
networkd: support socket activation
[elogind.git]
/
src
/
journal
/
journald-audit.c
diff --git
a/src/journal/journald-audit.c
b/src/journal/journald-audit.c
index 18235d9308043cfeadbbffce4c63c6f19ad43b4c..c2f1545cc9b0a2c89b2e3e92f1826bce31bd3f8c 100644
(file)
--- a/
src/journal/journald-audit.c
+++ b/
src/journal/journald-audit.c
@@
-206,7
+206,7
@@
static int map_generic_field(const char *prefix, const char **p, struct iovec **
return r;
}
return r;
}
-/* Kernel fields are those occuring in the audit string before
+/* Kernel fields are those occur
r
ing in the audit string before
* msg='. All of these fields are trusted, hence carry the "_" prefix.
* We try to translate the fields we know into our native names. The
* other's are generically mapped to _AUDIT_FIELD_XYZ= */
* msg='. All of these fields are trusted, hence carry the "_" prefix.
* We try to translate the fields we know into our native names. The
* other's are generically mapped to _AUDIT_FIELD_XYZ= */
@@
-240,7
+240,7
@@
static const MapField map_fields_kernel[] = {
{}
};
{}
};
-/* Userspace fields are thos
occu
ring in the audit string after
+/* Userspace fields are thos
e occur
ring in the audit string after
* msg='. All of these fields are untrusted, hence carry no "_"
* prefix. We map the fields we don't know to AUDIT_FIELD_XYZ= */
static const MapField map_fields_userspace[] = {
* msg='. All of these fields are untrusted, hence carry no "_"
* prefix. We map the fields we don't know to AUDIT_FIELD_XYZ= */
static const MapField map_fields_userspace[] = {
@@
-360,7
+360,7
@@
static void process_audit_string(Server *s, int type, const char *data, size_t s
if (!p)
return;
if (!p)
return;
- if (sscanf(p, "(%" PRI
i64 ".%" PRIi64 ":%" PRIi
64 "):%n",
+ if (sscanf(p, "(%" PRI
u64 ".%" PRIu64 ":%" PRIu
64 "):%n",
&seconds,
&msec,
&id,
&seconds,
&msec,
&id,
@@
-523,26
+523,22
@@
int server_open_audit(Server *s) {
if (errno == EAFNOSUPPORT || errno == EPROTONOSUPPORT)
log_debug("Audit not supported in the kernel.");
else
if (errno == EAFNOSUPPORT || errno == EPROTONOSUPPORT)
log_debug("Audit not supported in the kernel.");
else
- log_warning
(
"Failed to create audit socket, ignoring: %m");
+ log_warning
_errno(errno,
"Failed to create audit socket, ignoring: %m");
return 0;
}
r = bind(s->audit_fd, &sa.sa, sizeof(sa.nl));
return 0;
}
r = bind(s->audit_fd, &sa.sa, sizeof(sa.nl));
- if (r < 0) {
- log_error("Failed to join audit multicast group: %m");
- return -errno;
- }
+ if (r < 0)
+ return log_error_errno(errno, "Failed to join audit multicast group: %m");
} else
fd_nonblock(s->audit_fd, 1);
r = setsockopt(s->audit_fd, SOL_SOCKET, SO_PASSCRED, &one, sizeof(one));
} else
fd_nonblock(s->audit_fd, 1);
r = setsockopt(s->audit_fd, SOL_SOCKET, SO_PASSCRED, &one, sizeof(one));
- if (r < 0) {
- log_error("Failed to set SO_PASSCRED on audit socket: %m");
- return -errno;
- }
+ if (r < 0)
+ return log_error_errno(errno, "Failed to set SO_PASSCRED on audit socket: %m");
- r = sd_event_add_io(s->event, &s->audit_event_source, s->audit_fd, EPOLLIN, process_datagram, s);
+ r = sd_event_add_io(s->event, &s->audit_event_source, s->audit_fd, EPOLLIN,
server_
process_datagram, s);
if (r < 0)
return log_error_errno(r, "Failed to add audit fd to event loop: %m");
if (r < 0)
return log_error_errno(r, "Failed to add audit fd to event loop: %m");