chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
journal: allow setting of a cutoff log level for disk storage, syslog, kmsg, console...
[elogind.git]
/
src
/
journal
/
sd-journal.c
diff --git
a/src/journal/sd-journal.c
b/src/journal/sd-journal.c
index 4f3f1b5ff393aede86ecc858503c642c53af545d..9f46f5c6aa4d85e3fa3f02ec2e7cc6a0b28455cb 100644
(file)
--- a/
src/journal/sd-journal.c
+++ b/
src/journal/sd-journal.c
@@
-115,8
+115,17
@@
_public_ int sd_journal_add_match(sd_journal *j, const void *data, size_t size)
return -EINVAL;
if (!data)
return -EINVAL;
return -EINVAL;
if (!data)
return -EINVAL;
- if (size <=
0
)
+ if (size <=
1
)
return -EINVAL;
return -EINVAL;
+ if (!memchr(data, '=', size))
+ return -EINVAL;
+ if (*(char*) data == '=')
+ return -EINVAL;
+
+ /* FIXME: iterating with multiple matches is currently
+ * broken */
+ if (j->matches)
+ return -ENOTSUP;
le_hash = htole64(hash64(data, size));
le_hash = htole64(hash64(data, size));